diff options
author | Narayan Kamath <narayan@google.com> | 2014-05-21 12:07:35 +0100 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2014-05-21 12:07:35 +0100 |
commit | d862ebb6036a769cb3be371b396e9e33f89ee365 (patch) | |
tree | ebe36d1f47fc0c58ee0dfa295bb776ea3faad1c0 /services/core/java/com/android/server/power | |
parent | 9853e2a8b37c80a11427f48b3b4976408f615e57 (diff) | |
parent | fcc4fed3c16a57ef713a96b7298ed43aaeef2df4 (diff) | |
download | frameworks_base-d862ebb6036a769cb3be371b396e9e33f89ee365.zip frameworks_base-d862ebb6036a769cb3be371b396e9e33f89ee365.tar.gz frameworks_base-d862ebb6036a769cb3be371b396e9e33f89ee365.tar.bz2 |
resolved conflicts for merge of fcc4fed3 to master
Change-Id: Icebca982b01debd67a1470c02651ef8936f6e5b0
Diffstat (limited to 'services/core/java/com/android/server/power')
-rw-r--r-- | services/core/java/com/android/server/power/PowerManagerService.java | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java index 716ee27..aca17bf 100644 --- a/services/core/java/com/android/server/power/PowerManagerService.java +++ b/services/core/java/com/android/server/power/PowerManagerService.java @@ -949,9 +949,9 @@ public final class PowerManagerService extends com.android.server.SystemService return true; } - private void goToSleepInternal(long eventTime, int reason) { + private void goToSleepInternal(long eventTime, int reason, int flags) { synchronized (mLock) { - if (goToSleepNoUpdateLocked(eventTime, reason)) { + if (goToSleepNoUpdateLocked(eventTime, reason, flags)) { updatePowerStateLocked(); } } @@ -960,9 +960,10 @@ public final class PowerManagerService extends com.android.server.SystemService // This method is called goToSleep for historical reasons but we actually start // dozing before really going to sleep. @SuppressWarnings("deprecation") - private boolean goToSleepNoUpdateLocked(long eventTime, int reason) { + private boolean goToSleepNoUpdateLocked(long eventTime, int reason, int flags) { if (DEBUG_SPEW) { - Slog.d(TAG, "goToSleepNoUpdateLocked: eventTime=" + eventTime + ", reason=" + reason); + Slog.d(TAG, "goToSleepNoUpdateLocked: eventTime=" + eventTime + + ", reason=" + reason + ", flags=" + flags); } if (eventTime < mLastWakeTime @@ -1005,6 +1006,11 @@ public final class PowerManagerService extends com.android.server.SystemService } } EventLog.writeEvent(EventLogTags.POWER_SLEEP_REQUESTED, numWakeLocksCleared); + + // Skip dozing if requested. + if ((flags & PowerManager.GO_TO_SLEEP_FLAG_NO_DOZE) != 0) { + reallyGoToSleepNoUpdateLocked(eventTime); + } return true; } @@ -1408,7 +1414,7 @@ public final class PowerManagerService extends com.android.server.SystemService changed = napNoUpdateLocked(time); } else { changed = goToSleepNoUpdateLocked(time, - PowerManager.GO_TO_SLEEP_REASON_TIMEOUT); + PowerManager.GO_TO_SLEEP_REASON_TIMEOUT, 0); } } } @@ -1555,7 +1561,7 @@ public final class PowerManagerService extends com.android.server.SystemService // Dream has ended or will be stopped. Update the power state. if (isItBedTimeYetLocked()) { goToSleepNoUpdateLocked(SystemClock.uptimeMillis(), - PowerManager.GO_TO_SLEEP_REASON_TIMEOUT); + PowerManager.GO_TO_SLEEP_REASON_TIMEOUT, 0); updatePowerStateLocked(); } else { wakeUpNoUpdateLocked(SystemClock.uptimeMillis()); @@ -2715,7 +2721,7 @@ public final class PowerManagerService extends com.android.server.SystemService } @Override // Binder call - public void goToSleep(long eventTime, int reason) { + public void goToSleep(long eventTime, int reason, int flags) { if (eventTime > SystemClock.uptimeMillis()) { throw new IllegalArgumentException("event time must not be in the future"); } @@ -2725,7 +2731,7 @@ public final class PowerManagerService extends com.android.server.SystemService final long ident = Binder.clearCallingIdentity(); try { - goToSleepInternal(eventTime, reason); + goToSleepInternal(eventTime, reason, flags); } finally { Binder.restoreCallingIdentity(ident); } |