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

Commit 4890fa3c authored by Kweku Adams's avatar Kweku Adams Committed by Automerger Merge Worker
Browse files

Merge "Use an exact alarm for location timeout." into sc-dev am: 596af18f am: 03dfe33b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15583514

Change-Id: I037f595f329dabc2145db6f493d351820d99c962
parents 9258c490 03dfe33b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3941,6 +3941,10 @@ public class DeviceIdleController extends SystemService
        if (idleUntil) {
            mAlarmManager.setIdleUntil(AlarmManager.ELAPSED_REALTIME_WAKEUP,
                    mNextAlarmTime, "DeviceIdleController.deep", mDeepAlarmListener, mHandler);
        } else if (mState == STATE_LOCATING) {
            // Use setExact so we don't keep the GPS active for too long.
            mAlarmManager.setExact(AlarmManager.ELAPSED_REALTIME_WAKEUP,
                    mNextAlarmTime, "DeviceIdleController.deep", mDeepAlarmListener, mHandler);
        } else {
            if (mConstants.USE_WINDOW_ALARMS) {
                mAlarmManager.setWindow(AlarmManager.ELAPSED_REALTIME_WAKEUP,
+1 −0
Original line number Diff line number Diff line
@@ -323,6 +323,7 @@ public class DeviceIdleControllerTest {
        when(mPowerManager.newWakeLock(anyInt(), anyString())).thenReturn(mWakeLock);
        doNothing().when(mWakeLock).acquire();
        doNothing().when(mAlarmManager).set(anyInt(), anyLong(), anyString(), any(), any());
        doNothing().when(mAlarmManager).setExact(anyInt(), anyLong(), anyString(), any(), any());
        doNothing().when(mAlarmManager)
                .setWindow(anyInt(), anyLong(), anyLong(), anyString(), any(), any());
        doReturn(mock(Sensor.class)).when(mSensorManager)