Remove unnecessary check canScheduleExactAlarms() as Settings always
has the permission. Test: make RunSettingsRoboTests Bug: 256123455 Change-Id: I5089494164581465da9533671fc414c7bee1196f
This commit is contained in:
@@ -73,10 +73,6 @@ public final class PeriodicJobManager {
|
||||
// Cancels the previous alert job and schedules the next one.
|
||||
final PendingIntent pendingIntent = getPendingIntent();
|
||||
cancelJob(pendingIntent);
|
||||
if (!canScheduleExactAlarms()) {
|
||||
Log.w(TAG, "cannot schedule exact alarm job");
|
||||
return;
|
||||
}
|
||||
// Uses UTC time to avoid scheduler is impacted by different timezone.
|
||||
final long triggerAtMillis = getTriggerAtMillis(Clock.systemUTC());
|
||||
mAlarmManager.setExactAndAllowWhileIdle(
|
||||
@@ -111,13 +107,4 @@ public final class PeriodicJobManager {
|
||||
broadcastIntent,
|
||||
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
|
||||
}
|
||||
|
||||
private boolean canScheduleExactAlarms() {
|
||||
return canScheduleExactAlarms(mAlarmManager);
|
||||
}
|
||||
|
||||
/** Whether we can schedule exact alarm or not? */
|
||||
public static boolean canScheduleExactAlarms(AlarmManager alarmManager) {
|
||||
return alarmManager.canScheduleExactAlarms();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user