allow to open Autofill settings also if service is enabled

This commit is contained in:
Philipp Crocoll
2018-09-17 10:31:21 +02:00
parent 91e1674833
commit 304a9d90d0

View File

@@ -385,7 +385,16 @@ namespace keepass2android
{
var intent = new Intent(Settings.ActionRequestSetAutofillService);
intent.SetData(Android.Net.Uri.Parse("package:" + Context.PackageName));
if (((AutofillManager) Activity.GetSystemService(Java.Lang.Class.FromType(typeof(AutofillManager))))
.HasEnabledAutofillServices)
{
intent.SetData(Android.Net.Uri.Parse("package:" + Context.PackageName + "notexisting")); //if we use our package name, the activity won't launch
}
else
{
intent.SetData(Android.Net.Uri.Parse("package:" + Context.PackageName));
}
try
{
Context.StartActivity(intent);
@@ -401,6 +410,10 @@ namespace keepass2android
.Show();
}
catch (Exception e)
{
Kp2aLog.LogUnexpectedError(e);
}
};
}
@@ -527,11 +540,6 @@ namespace keepass2android
else
{
autofillPref.Summary = Activity.GetString(Resource.String.not_enabled);
}
}