mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 18:08:26 +03:00
move power manager check inside try/catch
This commit is contained in:
parent
5504298251
commit
03a55d38d3
1 changed files with 10 additions and 10 deletions
|
@ -105,18 +105,18 @@ namespace Bit.Android
|
||||||
|
|
||||||
public override void OnAccessibilityEvent(AccessibilityEvent e)
|
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
|
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))
|
if(SkipPackage(e?.PackageName))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue