allow to open Autofill settings also if service is enabled
This commit is contained in:
		| @@ -385,7 +385,16 @@ namespace keepass2android | |||||||
|                 { |                 { | ||||||
|  |  | ||||||
|                     var intent = new Intent(Settings.ActionRequestSetAutofillService); |                     var intent = new Intent(Settings.ActionRequestSetAutofillService); | ||||||
|  |                     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)); |                         intent.SetData(Android.Net.Uri.Parse("package:" + Context.PackageName)); | ||||||
|  |                     } | ||||||
|  |  | ||||||
|                     try |                     try | ||||||
|                     { |                     { | ||||||
|                         Context.StartActivity(intent); |                         Context.StartActivity(intent); | ||||||
| @@ -401,6 +410,10 @@ namespace keepass2android | |||||||
|                             .Show(); |                             .Show(); | ||||||
|  |  | ||||||
|                     } |                     } | ||||||
|  |                     catch (Exception e) | ||||||
|  |                     { | ||||||
|  |                         Kp2aLog.LogUnexpectedError(e); | ||||||
|  |                     } | ||||||
|                 }; |                 }; | ||||||
|             } |             } | ||||||
|  |  | ||||||
| @@ -527,11 +540,6 @@ namespace keepass2android | |||||||
|                 else |                 else | ||||||
|                 { |                 { | ||||||
|                     autofillPref.Summary = Activity.GetString(Resource.String.not_enabled); |                     autofillPref.Summary = Activity.GetString(Resource.String.not_enabled); | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|                 } |                 } | ||||||
|  |  | ||||||
|             } |             } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Philipp Crocoll
					Philipp Crocoll