mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 02:18:27 +03:00
try/catch on autofill service detection
This commit is contained in:
parent
e59ac5d65d
commit
3b7078e565
1 changed files with 21 additions and 7 deletions
|
@ -323,11 +323,18 @@ namespace Bit.Droid.Services
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
var activity = (MainActivity)CrossCurrentActivity.Current.Activity;
|
var activity = (MainActivity)CrossCurrentActivity.Current.Activity;
|
||||||
var type = Java.Lang.Class.FromType(typeof(AutofillManager));
|
var type = Java.Lang.Class.FromType(typeof(AutofillManager));
|
||||||
var manager = activity.GetSystemService(type) as AutofillManager;
|
var manager = activity.GetSystemService(type) as AutofillManager;
|
||||||
return manager.IsAutofillSupported;
|
return manager.IsAutofillSupported;
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int SystemMajorVersion()
|
public int SystemMajorVersion()
|
||||||
{
|
{
|
||||||
|
@ -514,10 +521,17 @@ namespace Bit.Droid.Services
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
var activity = (MainActivity)CrossCurrentActivity.Current.Activity;
|
var activity = (MainActivity)CrossCurrentActivity.Current.Activity;
|
||||||
var afm = (AutofillManager)activity.GetSystemService(Java.Lang.Class.FromType(typeof(AutofillManager)));
|
var afm = (AutofillManager)activity.GetSystemService(Java.Lang.Class.FromType(typeof(AutofillManager)));
|
||||||
return afm.IsEnabled && afm.HasEnabledAutofillServices;
|
return afm.IsEnabled && afm.HasEnabledAutofillServices;
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void OpenAccessibilitySettings()
|
public void OpenAccessibilitySettings()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue