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

Commit 309386c5 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Updater: UpdatesCheckReceiver: Migrate to setRepeating and setAndAllowWhileIdle

This reverts commit efc97fe7 ce02c5a1.

Change-Id: Id950e6c4f44a445f78be60416e159045d120152e
parent 752df4ef
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@
    <uses-permission android:name="android.permission.REBOOT" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.RECOVERY" />
    <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
    <uses-permission android:name="android.permission.START_ACTIVITIES_FROM_BACKGROUND" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

+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.setExactAndAllowWhileIdle(AlarmManager.RTC,
                System.currentTimeMillis() + Utils.getUpdateCheckInterval(context),
        alarmMgr.setRepeating(AlarmManager.RTC, System.currentTimeMillis() +
                Utils.getUpdateCheckInterval(context), 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.setExactAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME,
        alarmMgr.setAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME,
                SystemClock.elapsedRealtime() + millisToNextCheck,
                updateCheckIntent);