From e1467239480ab479b967ec67aec89c6721815803 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 27 Apr 2021 10:00:44 +0200 Subject: [PATCH] Refactoring --- app/src/main/java/eu/faircode/email/Helper.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Helper.java b/app/src/main/java/eu/faircode/email/Helper.java index 16bf049b14..4ea76c5c3b 100644 --- a/app/src/main/java/eu/faircode/email/Helper.java +++ b/app/src/main/java/eu/faircode/email/Helper.java @@ -422,13 +422,14 @@ public class Helper { } static Boolean isIgnoringOptimizations(Context context) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); - if (pm == null) - return null; - return pm.isIgnoringBatteryOptimizations(BuildConfig.APPLICATION_ID); - } - return null; + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) + return null; + + PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); + if (pm == null) + return null; + + return pm.isIgnoringBatteryOptimizations(BuildConfig.APPLICATION_ID); } static Integer getBatteryLevel(Context context) {