1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-30 12:54:24 +01:00

move power manager check inside try/catch

This commit is contained in:
Kyle Spearrin 2018-09-23 08:08:38 -04:00
parent 5504298251
commit 03a55d38d3

View File

@ -105,18 +105,18 @@ namespace Bit.Android
public override void OnAccessibilityEvent(AccessibilityEvent e)
{
var powerManager = (PowerManager)GetSystemService(PowerService);
if(Build.VERSION.SdkInt > BuildVersionCodes.KitkatWatch && !powerManager.IsInteractive)
{
return;
}
else if(Build.VERSION.SdkInt < BuildVersionCodes.Lollipop && !powerManager.IsScreenOn)
{
return;
}
try
{
var powerManager = (PowerManager)GetSystemService(PowerService);
if(Build.VERSION.SdkInt > BuildVersionCodes.KitkatWatch && !powerManager.IsInteractive)
{
return;
}
else if(Build.VERSION.SdkInt < BuildVersionCodes.Lollipop && !powerManager.IsScreenOn)
{
return;
}
if(SkipPackage(e?.PackageName))
{
return;