1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-03 21:55:13 +00:00

Refactoring

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

View file

@ -422,14 +422,15 @@ public class Helper {
}
static Boolean isIgnoringOptimizations(Context context) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
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);
}
return null;
}
static Integer getBatteryLevel(Context context) {
try {