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

Commit b5d6eda4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Update alarmManager to use exact timing" into udc-d1-dev

parents e457c677 e0c17c71
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1466,9 +1466,9 @@ public class DataRetryManager extends Handler {
        } else {
            Intent intent = new Intent(ACTION_RETRY);
            intent.putExtra(ACTION_RETRY_EXTRA_HASHCODE, dataRetryEntry.hashCode());
            // No need to wake up the device at the exact time, the retry can wait util next time
            // the device wake up to save power.
            mAlarmManager.setAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME,
            // No need to wake up the device, the retry can wait util next time the device wake up
            // to save power.
            mAlarmManager.setExactAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME,
                    dataRetryEntry.retryElapsedTime,
                    PendingIntent.getBroadcast(mPhone.getContext(),
                            dataRetryEntry.hashCode() /*Unique identifier of this retry attempt*/,
+1 −1
Original line number Diff line number Diff line
@@ -795,7 +795,7 @@ public class DataRetryManagerTest extends TelephonyTest {
        // Verify scheduled via Alarm Manager
        ArgumentCaptor<PendingIntent> pendingIntentArgumentCaptor =
                ArgumentCaptor.forClass(PendingIntent.class);
        verify(mAlarmManager).setAndAllowWhileIdle(anyInt(), anyLong(),
        verify(mAlarmManager).setExactAndAllowWhileIdle(anyInt(), anyLong(),
                pendingIntentArgumentCaptor.capture());

        // Verify starts retry attempt after receiving intent