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

Commit e0c17c71 authored by Ling Ma's avatar Ling Ma
Browse files

Update alarmManager to use exact timing

Fix: 287340791
Test: reporter test script verify
Change-Id: I88dbfa3943d208b0360a71ae6808f7f71b7a6e41
parent 045adef5
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