Loading services/core/java/com/android/server/power/PowerManagerService.java +3 −8 Original line number Diff line number Diff line Loading @@ -2684,8 +2684,8 @@ public final class PowerManagerService extends SystemService @GuardedBy("mLock") private void updateUserActivitySummaryLocked(long now, int dirty) { // Update the status of the user activity timeout timer. if ((dirty & (DIRTY_DISPLAY_GROUP_WAKEFULNESS | DIRTY_WAKE_LOCKS | DIRTY_USER_ACTIVITY | DIRTY_WAKEFULNESS | DIRTY_SETTINGS | DIRTY_ATTENTIVE)) == 0) { if ((dirty & (DIRTY_DISPLAY_GROUP_WAKEFULNESS | DIRTY_WAKE_LOCKS | DIRTY_USER_ACTIVITY | DIRTY_WAKEFULNESS | DIRTY_SETTINGS)) == 0) { return; } mHandler.removeMessages(MSG_USER_ACTIVITY_TIMEOUT); Loading Loading @@ -2772,11 +2772,6 @@ public final class PowerManagerService extends SystemService screenDimDuration); } if (isAttentiveTimeoutExpired(powerGroup, now)) { groupUserActivitySummary = 0; groupNextTimeout = -1; } hasUserActivitySummary |= groupUserActivitySummary != 0; if (nextTimeout == -1) { Loading Loading @@ -3132,7 +3127,7 @@ public final class PowerManagerService extends SystemService Message msg = mHandler.obtainMessage(MSG_SANDMAN); msg.arg1 = powerGroup.getGroupId(); msg.setAsynchronous(true); mHandler.sendMessageAtTime(msg, mClock.uptimeMillis()); mHandler.sendMessage(msg); } } } Loading services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java +0 −17 Original line number Diff line number Diff line Loading @@ -1058,23 +1058,6 @@ public class PowerManagerServiceTest { assertThat(mService.getGlobalWakefulnessLocked()).isNotEqualTo(WAKEFULNESS_ASLEEP); } @SuppressWarnings("GuardedBy") @Test public void testInattentiveSleep_goesToSleepFromDream() throws Exception { setAttentiveTimeout(20000); createService(); startSystem(); setPluggedIn(true); forceAwake(); forceDream(); when(mDreamManagerInternalMock.isDreaming()).thenReturn(true); assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_DREAMING); advanceTime(20500); assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP); } @Test public void testWakeLock_affectsProperDisplayGroup() { final int nonDefaultDisplayGroupId = Display.DEFAULT_DISPLAY_GROUP + 1; Loading Loading
services/core/java/com/android/server/power/PowerManagerService.java +3 −8 Original line number Diff line number Diff line Loading @@ -2684,8 +2684,8 @@ public final class PowerManagerService extends SystemService @GuardedBy("mLock") private void updateUserActivitySummaryLocked(long now, int dirty) { // Update the status of the user activity timeout timer. if ((dirty & (DIRTY_DISPLAY_GROUP_WAKEFULNESS | DIRTY_WAKE_LOCKS | DIRTY_USER_ACTIVITY | DIRTY_WAKEFULNESS | DIRTY_SETTINGS | DIRTY_ATTENTIVE)) == 0) { if ((dirty & (DIRTY_DISPLAY_GROUP_WAKEFULNESS | DIRTY_WAKE_LOCKS | DIRTY_USER_ACTIVITY | DIRTY_WAKEFULNESS | DIRTY_SETTINGS)) == 0) { return; } mHandler.removeMessages(MSG_USER_ACTIVITY_TIMEOUT); Loading Loading @@ -2772,11 +2772,6 @@ public final class PowerManagerService extends SystemService screenDimDuration); } if (isAttentiveTimeoutExpired(powerGroup, now)) { groupUserActivitySummary = 0; groupNextTimeout = -1; } hasUserActivitySummary |= groupUserActivitySummary != 0; if (nextTimeout == -1) { Loading Loading @@ -3132,7 +3127,7 @@ public final class PowerManagerService extends SystemService Message msg = mHandler.obtainMessage(MSG_SANDMAN); msg.arg1 = powerGroup.getGroupId(); msg.setAsynchronous(true); mHandler.sendMessageAtTime(msg, mClock.uptimeMillis()); mHandler.sendMessage(msg); } } } Loading
services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java +0 −17 Original line number Diff line number Diff line Loading @@ -1058,23 +1058,6 @@ public class PowerManagerServiceTest { assertThat(mService.getGlobalWakefulnessLocked()).isNotEqualTo(WAKEFULNESS_ASLEEP); } @SuppressWarnings("GuardedBy") @Test public void testInattentiveSleep_goesToSleepFromDream() throws Exception { setAttentiveTimeout(20000); createService(); startSystem(); setPluggedIn(true); forceAwake(); forceDream(); when(mDreamManagerInternalMock.isDreaming()).thenReturn(true); assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_DREAMING); advanceTime(20500); assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP); } @Test public void testWakeLock_affectsProperDisplayGroup() { final int nonDefaultDisplayGroupId = Display.DEFAULT_DISPLAY_GROUP + 1; Loading