1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-01 04:35:57 +00:00

Refactoring

This commit is contained in:
M66B 2021-04-27 10:00:44 +02:00
parent a79a38ddec
commit e146723948

View file

@ -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) {