commit | 4d9e43160e098d6e15e3ee7bc6db8287598d691d | [log] [tgz] |
---|---|---|
author | Alex Salo <asalo@google.com> | Wed Feb 13 14:59:42 2019 -0800 |
committer | Alex Salo <asalo@google.com> | Wed Feb 13 15:04:01 2019 -0800 |
tree | 36956ac39542baf56846466881ec26883d816620 | |
parent | a0d18b60f3a3d771d21749bc77a6f5ec55dc0c45 [diff] [blame] |
Initialize wakefulness state to AWAKE upon boot Device always boots into AWAKE state, but onWakefulnessChange is not called until after the screen turns off. Test: manually with logging Bug: 111939367 Change-Id: If74464c400f7fa0f904178268b9108eb9e7f9dba
diff --git a/services/core/java/com/android/server/power/AttentionDetector.java b/services/core/java/com/android/server/power/AttentionDetector.java index 4186154..1d6dcbd1 100644 --- a/services/core/java/com/android/server/power/AttentionDetector.java +++ b/services/core/java/com/android/server/power/AttentionDetector.java
@@ -123,6 +123,9 @@ public AttentionDetector(Runnable onUserAttention, Object lock) { mOnUserAttention = onUserAttention; mLock = lock; + + // Device starts with an awake state upon boot. + mWakefulness = PowerManagerInternal.WAKEFULNESS_AWAKE; } public void systemReady(Context context) {