Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f569759 authored by Aayush Gupta's avatar Aayush Gupta Committed by Nishith Khanna
Browse files

Updater: UpdatesCheckReceiver: Migrate to setExactAndAllowWhileIdle



Signed-off-by: default avatarAayush Gupta <aayushgupta219@gmail.com>

fixup! Updater: UpdatesCheckReceiver: Migrate to setExactAndAllowWhileIdle

This commit partially reverts 99cd083e

(cherry picked from commit 90642329)
parent 9984c786
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -160,8 +160,8 @@ public class UpdatesCheckReceiver extends BroadcastReceiver {

        PendingIntent updateCheckIntent = getRepeatingUpdatesCheckIntent(context);
        AlarmManager alarmMgr = context.getSystemService(AlarmManager.class);
        alarmMgr.setRepeating(AlarmManager.RTC, System.currentTimeMillis() +
                Utils.getUpdateCheckInterval(context), Utils.getUpdateCheckInterval(context),
        alarmMgr.setExactAndAllowWhileIdle(AlarmManager.RTC,
                System.currentTimeMillis() + Utils.getUpdateCheckInterval(context),
                updateCheckIntent);

        Date nextCheckDate = new Date(System.currentTimeMillis() +
@@ -184,7 +184,7 @@ public class UpdatesCheckReceiver extends BroadcastReceiver {
        long millisToNextCheck = AlarmManager.INTERVAL_HOUR * 2;
        PendingIntent updateCheckIntent = getUpdatesCheckIntent(context);
        AlarmManager alarmMgr = context.getSystemService(AlarmManager.class);
        alarmMgr.set(AlarmManager.ELAPSED_REALTIME,
        alarmMgr.setExactAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME,
                SystemClock.elapsedRealtime() + millisToNextCheck,
                updateCheckIntent);