mirror of
https://github.com/Etar-Group/Etar-Calendar.git
synced 2024-09-11 10:05:47 +03:00
Remove obsolete version check
This commit is contained in:
parent
f34880f1d8
commit
b8f6061f30
@ -234,13 +234,6 @@ public class Utils {
|
||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the SDK is the Marshmallow release or later.
|
||||
*/
|
||||
public static boolean isMOrLater() {
|
||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the system supports Material You.
|
||||
*
|
||||
|
@ -132,22 +132,19 @@ public class AlertReceiver extends BroadcastReceiver {
|
||||
}
|
||||
mStartingService.acquire();
|
||||
|
||||
if (Utils.isMOrLater()) {
|
||||
if (pm.isIgnoringBatteryOptimizations(context.getPackageName())) {
|
||||
if (Utils.isOreoOrLater()) {
|
||||
if (Utils.isUpsideDownCakeOrLater() && !Utils.canScheduleAlarms(context)) {
|
||||
return;
|
||||
}
|
||||
context.startForegroundService(intent);
|
||||
} else {
|
||||
context.startService(intent);
|
||||
if (pm.isIgnoringBatteryOptimizations(context.getPackageName())) {
|
||||
if (Utils.isOreoOrLater()) {
|
||||
if (Utils.isUpsideDownCakeOrLater() && !Utils.canScheduleAlarms(context)) {
|
||||
return;
|
||||
}
|
||||
context.startForegroundService(intent);
|
||||
} else {
|
||||
Log.d(TAG, "Battery optimizations are not disabled");
|
||||
context.startService(intent);
|
||||
}
|
||||
} else {
|
||||
context.startService(intent);
|
||||
Log.d(TAG, "Battery optimizations are not disabled");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user