summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/systemui/doze/DozeMachine.java
Commit message (Collapse)AuthorAgeFilesLines
* Don't crash on transition DOZE_SUSPEND_TRIGGERS => DOZE_PULSE_DONEBeverly2023-03-201-1/+2
| | | | | | | | | | | | | | | | | | | This transition can happen with the following sequence of events: - Heads up notification arrives during doze_aod or doze, pulse begins (DOZE_REQUEST_PULSE, DOZE_PULSING) - While pulsing, car mode begins (DOZE_SUSPEND_TRIGGERS) - Heads up notification stops showing (DOZE_PULSE_DONE) If the device is in DOZE_SUSPEND_TRIGGERS, don't send DOZE_PULSE_DONE to DozeMachine.Parts. DOZE_SUSPEND_TRIGGERS means the device has already ended the pulsing UI. Test: atest DozeMachineTest Test: manually force car mode to start after DOZE_PULSING and see that the device won't crash on pulse-done Fixes: 262346136 Change-Id: Icc16b8a16af1fd266a2afcfdbe6e1121ef788d65
* [DO NOT MERGE] Replace UserHandle.CURRENT with UserTrackerAlex Stetson2023-01-171-3/+5
| | | | | | Bug: 249831072 Test: atest SystemUITests Change-Id: Id98ed38495feaab4780452ded14fe24b68ae6944
* Uses Configuration.uiMode in DozeMachine to determine if car mode is activeChandru2022-10-191-9/+41
| | | | | | | | | | | Other changes: - Use onConfigurationChanged instead of intents to detect when we enter/exit car mode to avoid any race conditions. - Renames mConfig field to mAmbientDisplayConfig. Fixes: 254228426 Test: atest com.android.systemui.doze Test: manual, revert ag/16853283 locally, go to AoD, run 'adb shell cmd uimode car yes', no doze triggers should wake up the device. run 'adb shell cmd uimode car no', doze triggers (tap, pickup, etc) should wake up the device. Change-Id: I017a00ae776482f6ff329f72250bd0584961aedf
* Plumb through the reason for wakeup from Doze.Chandru2022-09-011-6/+7
| | | | | | | | | | | | | | | | | | | @DozeLog.Reason is included along with the powerManager.wakeUp. This would describe why the device was woken up from doze: "intent", "notification", "sigmotion", "pickup", "docking", etc. [1] This also includes the Keyguard session ID along with the UI events logged in DozeTrigger [1]: http://cs/android-internal/frameworks/base/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java;l=435;rcl=6fd5473508c5d4cb15513053ec8a50dcd1d44e74 Bug: 238809124 Test: atest DozeMachineTest Test: atest DozeTriggersTest Test: atest DozeScreenStatePreventingAdapterTest Change-Id: I6f8799112eccf129fa846ff8eb8f549566dfa01d
* Suspend and resume DozeTriggers when entering and exiting car mode.Chandru2022-05-311-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces a new DozeMachine state DOZE_SUSPEND_TRIGGERS that is equivalent of DOZE but also suspends any triggers that awaken the device. Entering car mode transitions the state machine to DOZE_SUSPEND_TRIGGERS and leaving the car mode transitions to either DOZE or DOZE_AOD depending on whether Always on Display is enabled. Current behavior when entering car mode: - DozeService is finished. - Always on display is turned off - Tap on screen doesn’t wake up the device - Lifting device doesn’t wake up the device - Sending a notification doesn’t wake up the device. New behavior when entering car mode: - DozeService is not finished. - Remaining behavior is the same as DozeTrigger stops listening to all triggers (sensors, intents, notifications) Current behavior when exiting car mode: - DozeService is not running, normal triggers don't wake up the device New behavior when exiting car mode: - DozeService is running, normal triggers wake up the device as expected. - DozeSuppressor transitions from DOZE_SUSPEND_TRIGGERS to DOZE/DOZE_AOD Bug: 230968777 Fixes: 230968777 Test: manual Test: atest com.android.systemui.doze Change-Id: I5f49bb5700d7ed38763dccc8c5b6438d934c6476
* DOZE instead of DOZE_AOD when batterySaver=activeBeverly2022-03-181-2/+7
| | | | | | | | | So we don't mistakenly briefly show the AOD UI when entering AOD with battery saver active. Test: manual Fixes: 219030172 Change-Id: Ida3b52a3a091736b8ba2d3ad614662a0ac4724e1
* Refactor doze suppressors into its own classBeverly2022-02-251-3/+2
| | | | | | | | | | | | | | | | | There are multiple ways doze/aod can be suppressed/blocked. This CL consolidates the majority of the logic to DozeSuppressor.java and breaks apart the terminology `doze suppressed` (which refers to the entire doze experience) from `always on suppressed` (which refers to only suppressing always-on-display, but continuing to register for wake-up-gestures). + Added DozeSuppressorTests + Added extra logging to DozeLog Test: atest SystemUITests Test: atest DozeSuppressorTest Bug: 218509239 Change-Id: I8cec55d57b67a6e171849febabf8e92804d74f4e
* Doze-Pulsing should always go to display onBeverly2022-02-161-1/+3
| | | | | | | | | | | The only exception is if the device requires a blank frame before turning the display back on. Test: atest DozeMachineTest Test: make a phone call, then enter AOD and attempt UDFPS to see HBM Bug: 213875085 Change-Id: Ia3025c1b6e479180edf489dcb53dec8f81f7820f
* Add logs for whether doze is suppressedBeverly2020-10-121-0/+1
| | | | | | | | | Dozing can be suppressed by the PowerManager. Log when doze is suppressed this way so it's easier to debug when users no longer see AOD when they expect AOD. Test: manual Change-Id: I4c2b2d322cb8b6af5d18bed73f32b3d7f5b0b4c1
* Add debugging logs for DozeBeverly2020-09-181-0/+2
| | | | | | Test: manual Bug: 168778910 Change-Id: If6c89df1a426fb2f15abf1d53567b5a72d4aab5f
* Don't trust DozeState onScreenState changesBeverly2020-09-171-2/+6
| | | | | | | | | | | In DozeScreenBrightness, we should only rely on the passed displayScreenState because our DozeState (updated by transitionTo) may not be updated yet. Therefore, only register the brightness sensor when the display state is Display.STATE_DOZE/DOZE_SUSPENDED. Test: atest DozeScreenBrightnessTest Bug: 168689990 Change-Id: Ie32f91c5a46bd987649a8a17e6543071847ad97c
* Do not animate NSSL when in battery saverLucas Dupin2020-07-211-3/+0
| | | | | | | | | | | | | | | Until now, we were only checking if the screen shold turn off on the DozeMachine. This works but doesn't propagate the always-on state properly to other parts of SysUI. It's a better idea to hide the implementation detail under DozeParameters, which is a singleton that's shared with other parts of the system. Test: manual Test: atest DozeParametersTest Fixes: 158771494 Change-Id: Ifd43b9b1ea247f4e869505f02d6716400de35091
* Remove DozeFactory. Add DozeComponent/DozeScope.Dave Mankoff2020-07-091-9/+17
| | | | | | | | | | | This replaces DozeFactory with some Dagger idioms. The DozeComponent is a subcomponent, created by DozeService, for all your Doze related needs. Items that should only live within the DozeService can be annotated with @DozeScope. Fixes: 159701507 Test: atest SystemUITests && manual Change-Id: I76d0709b1689408d95b4913d0d46761174cf5ea9
* Don't turn on prox until after screen is off/dozedDave Mankoff2020-05-181-0/+9
| | | | | | | | | | | | | This change ensures that the doze related code does not turn on the proximity sensor until after it has completed its transition to a low power screen state. This fixes the appearance of a white dot on devices with the proximity sensor behind the screen. Fixes: 155441239 Test: atest SystemUITests && manual Change-Id: I58cc9a8e92fa0b219ada13c293478c6fc5e79c78
* Ensure that DozeSensors can unregister itself.Dave Mankoff2020-04-271-0/+12
| | | | | | | | | | When DozeService shuts down, we need to ensure that any registered callbacks in DozeSensors get a chance to remove themselves from the SensorManager. Fixes: 155104806 Test: atest SystemUITests Change-Id: I5126cdb1b65d4db42674722839adb7331091e099
* Prevent requesting invalid state after dockedJerry Chang2020-04-071-2/+2
| | | | | | | | | | Prevent requesting DOZE_AOD_DOCKED while doze pulsing and requesting DOZE_PULSE_DOWN while DOZE_AOD_DOCKED. Fix: 153168608 Test: atest DozeMachineTest DozeDockHandlerTest Test: manual test that docked on paired dock while pulsing won't crash Change-Id: Ieec969c58ac85f90a985ec714643feea51118787
* Fix issue where AOD would not startLucas Dupin2020-04-011-2/+5
| | | | | | | | | | | | We shouldn't mix wakefulness with dream states, they come asynchronously from different parts of the system. This means that the device might not be GOING_TO_SLEEP when DozeService is started. We also can't rely on wakefulness to drive Doze animations. Test: unlock with fingerprint Test: press power from launcher and lock screen multiple times Fixes: 152835247 Change-Id: I3eaf2ae1801bbb999a6466c214234f33804ccf19
* Store ambient display suppression state in memory.Yogisha Dixit2020-03-021-2/+4
| | | | | | | | | | We were previously using a secure setting, which means that the suppression state would be persisted across reboots. Test: atest SystemUITests, atest FrameworksServicesTests:PowerManagerServiceTest Change-Id: I3016bdabc67c15b8759a78ce92f4d9262b1380a3 Bug: 147587449 (cherry picked from commit 05f9538c2ee72b1cffdb1223fa70c02e59b84579)
* Add a content observer for DOZE_SUPPRESSED.Yogisha Dixit2020-02-031-0/+9
| | | | | | Test: manual, atest PlatformScenarioTests:DozeMachineTest Bug: 147584235, 147587999 Change-Id: I5265f8d0572813e28278134196fc0fd26e0dfb25
* Switch DozeLog over to new bufferNed Burns2020-01-291-3/+3
| | | | | | | | DozeLog should really be renamed DozeTracer or similar (to avoid clashes with the new DozeLogger) but I didn't want to nuke the change history. Test: atest Change-Id: Id74d04f3b073b0680b3b39707d2fa38a1706e418
* Introduce new doze state for dockingJerry Chang2019-11-131-4/+14
| | | | | | Bug: 140915138, 136070077 Test: atest SystemUITests.java Change-Id: I03d92c809074fd66b857cd406fc3a200a05e53e9
* Keep interrupts on when in battery saver modeLucas Dupin2019-09-271-1/+8
| | | | | | | | | | | | | | | | Battery saver was completely aborting the doze service, disabling all interrupts. This is not ideal since it impacts the user journey, especially when using face auth. From now on the screen will still be off, but DozeService will be retained, in order to receive sensor events. Test: w/ battery saver: lift, tap, and observe aod being off Test: w/ battery saver: receive notification, no HUN. Test: w/o battery saver: lift, tap, and observe aod being on Test: w/o battery saver: receive notification, HUN is received. Fixes: 134157254 Change-Id: I9b713c78857c4e4c22d8d9bfff165b1b51dfd804
* DozeLog uses new SysuiLogBeverly2019-09-271-5/+7
| | | | | | Test: atest SystemUITests Bug: 141470043 Change-Id: I089dd42ab67b0a37841159c5f1f9702ea45f57e6
* Fix double auth issueLucas Dupin2019-08-131-4/+17
| | | | | | | | | This was a regression from a security fix b/135289187 Test: reach, auth, swipe up Test: reach, auth, ait for timeout, reach again Fixes: 138851575 Change-Id: Icd457dc79cb6f86a7cbb22a78ee80ebfbb4380a7
* Merge "Fix enqueued requests causing crashes"Lucas Dupin2019-03-291-1/+4
|\
| * Fix enqueued requests causing crashesLucas Dupin2019-03-281-1/+4
| | | | | | | | | | | | | | | | | | | | It's possible that transitions will be enqueued will exist when new sensor data arrives. It's not possible to determine the current machine state in these occasions. Test: manual Fixes: 129473841 Change-Id: Ia6f1aabc87e9e864048d86a1c13db75e364a9032
* | Wake up wallpaper even if there's a notificationLucas Dupin2019-03-271-1/+7
|/ | | | | | | | | | | | | | | | Isolated a bright pulse from a regular pulse (dark wallpaper) and created a new machine state for the new case. The state is also propagated to ScrimController, in order to understand if the wallpaper should be dimmed down or not. Fixes: 123991469 Test: receive notification, trigger sensor Test: other manual notification tests Test: repeat with image wallpaper and live wallpaper Test: atest ScrimControllerTest Test: atest DozeWallpaperStateTest Change-Id: I6b54615dd6c7ecadf7dffd2d61ae7f93390d4c97
* Ignore prox data when it's obsoleteLucas Dupin2019-03-211-1/+1
| | | | | | | | | | | The proximity sensor response is asynchronous, this means that the user might have interacted with the phone while sensor data is being processed. Let's ignore its response in case it arrives late. Fixes: 129012983 Test: press power while uncovering prox sensor Change-Id: Ib31e6c53b9f5993349c5eaed6122af5228d07728
* Move AmbientDisplayConfiguration class out of internal package.Issei Suzuki2019-02-271-1/+1
| | | | | | Test: m droid (run full build), atest SystemUITests Bug: 126327497 Change-Id: Ife8303924bd02e9639008293bf9028f4871a9b16
* Named wake lock reasonsLucas Dupin2019-02-201-4/+7
| | | | | | | | | | Fixes: 121039718 Test: atest ScrimControllerTest Test: atest KeepAwakeAnimationListenerTest Test: atest SettableWakeLockTest Test: atest WakeLockTest Test: adb shell dumpsys activity service com.android.systemui Change-Id: I612874da597fba6974edd1f702932ee1a5629fc7
* Screen off animationLucas Dupin2018-03-201-4/+4
| | | | | | | | | | | | | | | | | | | | | SysUI can now control the screen off animation as long as config_dozeAfterScreenOff is set to false. The current implementation collapses the notification shade and moves the clock whenever the use is on the lock screen, or will fade the scrims and show the clock when the keyguard is occluded. Display state change (on, doze, doze_suspended) is delayed to let the animations occur at 60Hz. Test: atest packages/SystemUI/tests/src/com/android/systemui/doze/DozeUiTest.java Test: atest packages/SystemUI/tests/src/com/android/systemui/doze/DozeWallpaperStateTest.java Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java Test: atest tests/src/com/android/systemui/statusbar/phone/DozeScrimControllerTest.java Test: atest tests/src/com/android/systemui/statusbar/phone/DozeParametersTest.java Test: atest packages/SystemUI/tests/src/com/android/systemui/keyguard/WakefulnessLifecycleTest.java Fixes: 73178121 Change-Id: Id5d964452f342d4e97bedf1084efa808604e602c
* Remove black frame when pulsingLucas Dupin2018-02-081-2/+5
| | | | | | Fixes: 73121392 Test: Receive notification on AOD Change-Id: I04802b3b456e2c484fc5aaab8460a08b82f952e4
* AOD: When prox covered disable touch during pulse instead of abortingAdrian Roos2017-07-281-0/+4
| | | | | | | | | | | | | Fixes a UX issue where covering the prox would abort dozing. This was done to prevent falsing and save power, but in practice results in a frustrating experience when the proximity sensor is covered transiently when reaching for the device. Instead, just ignore touch while the sensor is covered. Change-Id: Id70f8605c6c7a37288a383d587025bb9b4191b42 Fixes: 64007762 Test: Trigger AOD2, cover sensor. Verify phone stays on but double tap does nothing.
* Flicker free screen-on from AODAdrian Roos2017-07-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | When pulsing from AOD, we force the display OFF first. This allows us to transition smoothly from AOD. Also, we add a scrim transition for whenever we are waking up from dozing. This relies on I4f3a863709a970f0fc8682c0a0c3547886e1fd0f which forces the DOZE -> ON transition through OFF first. Also fixes the WAKE_AND_UNLOCK transition that happens when waking up with the fingerprint sensor. Also fix an issue where KeyguardViewMediator's mWakeAndUnlocking was cleared in onScreenTurnedOff; this should have been added to the wakefulness lifecycle instead and now that the AOD -> ON transtion dispatches the screen off callback it broke the fingerprint unlock transition. Fixes: 35849781 Fixes: 63887857 Fixes: 63783651 Fixes: 63727166 Test: AOD, receive notification; AOD, unlock with fingerprint; AOD, wake to lockscreen. Verify that everything is flicker-free. Change-Id: I7d539db80a1c7e9216cf4c5c1e6d314c1893f12d
* Merge "AOD: Refactor doze brigthness controllers, add AOD auto brightness ↵TreeHugger Robot2017-06-301-8/+31
|\ | | | | | | support" into oc-dr1-dev
| * AOD: Refactor doze brigthness controllers, add AOD auto brightness supportAdrian Roos2017-06-301-8/+31
| | | | | | | | | | | | | | | | | | | | | | - Factor out doze brightness and screen state controllers - Add support for setting the screen brightness from a sensor in AOD / when pulsing - Refactor FakeSensorManager for generic sensors, add a light sensor Bug: 38354633 Test: runtest -x packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenTest.java Change-Id: I55f2bee253cee23a76ba857ba1f19052ff88a753
* | AOD: Add hysteresis to pausing the displayAdrian Roos2017-06-301-2/+7
|/ | | | | | | | | | | | Delays pausing the display by several seconds to avoid flickering when the prox is only covered transiently. Also adds cooldown to the proximity sensor, such that when it toggles too often it gets disabled for a while. Bug: 62292293 Test: cover prox for less than 10s, observe display stays on. Cover for more, observe display turns off. Change-Id: Ifa407b84760fc299fbbcfa92d9e942e0093c4b73
* Merge "AOD: Pass through pulse reason to DozeUi" into oc-dev am: 838e5f04beAdrian Roos2017-05-031-3/+42
|\ | | | | | | | | | | am: 4c49f656fb Change-Id: I297365d186814fe0502f8cf155a650546ce959fd
| * AOD: Pass through pulse reason to DozeUiAdrian Roos2017-04-281-3/+42
| | | | | | | | | | | | | | | | | | | | Fixes an issue where the Ambient Display transition is too slow in response to double tap / lift, because we are applying the animation for the notification case. Bug: 34716110 Test: runtest systemuig Change-Id: I84f2c59205d157d89baac1688dd6cd97a170a489
* | AOD: Don't use DOZE screen state on AOD2Adrian Roos2017-04-281-1/+1
| | | | | | | | | | | | | | | | | | Fixes an issue where AOD2 had low color gamut. Instead, we now use the high-power screen state there. Bug: 36781008 Test: Receive notification on AOD2, observe that color is not distorted Change-Id: I370a74c0f1d5cfd49194b53b9e20bf1f0dc5d4d0
* | Merge "AOD: Fix broken triggers after failed prox check" into oc-dev am: ↵Adrian Roos2017-04-201-1/+1
|\| | | | | | | | | | | | | | | 017f5df1e7 am: 06c68a68ef Change-Id: Ifbcaaf8d580e5c55016040e9bdc5afd27ebcefd6
| * AOD: Fix broken triggers after failed prox checkAdrian Roos2017-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes an issue where after a failed prox check we would not correctly reset mPulsePending and thus never trigger a pulse again until the DozeService restarts. Also adds logging for dropped and canceled pulses to aid diagnosing similar or different bugs in the future. Also adds a regression test. Fixes: 37477968 Test: runtest -x /frameworks/base/packages/SystemUI/tests/src/com/android/systemui/doze/DozeTriggersTest.java Change-Id: Ic465b7686ae1937a29d07a66fe44cf7ad18419ef
* | Merge "AOD: Prolong AOD2 after interaction, turn off AOD when prox covered" ↵Adrian Roos2017-04-151-1/+10
|\| | | | | | | | | | | | | | | into oc-dev am: 490ef3cda4 am: 153159130f Change-Id: Iabcf85cb191df80d1a24277dd420e3045838ded8
| * AOD: Prolong AOD2 after interaction, turn off AOD when prox coveredAdrian Roos2017-04-141-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turns off AOD 1 and 2 when the proximity sensor is covered. Also extends the AOD2 duration when the screen is touched or the lift gesture is triggered. Also fixes some issues with the fingerprint unlock transition from AOD where the doze state for the NotificationPanelView was cleared too early. Also hides the wallpaper while we're dozing. Test: runtest -x packages/SystemUI/tests/src/com/android/systemui/doze/DozeMachineTest.java Fixes: 36893539 Fixes: 36893538 Fixes: 36033906 Fixes: 37327153 Change-Id: I3fccae1515a0daf2ff99589ed78ec947687e6262
* | AOD: Use DOZE_SUSPEND screenstate when supportedAdrian Roos2017-03-281-1/+2
|/ | | | | | | Bug: 30876804 Bug: 33175018 Test: runtest -x packages/SystemUI/tests/src/com/android/systemui/doze/DozeSuspendScreenStatePreventingAdapterTest.java Change-Id: If4d0cadced1f0ac3e737d78759820858b70081e6
* AOD: Add wakelock for charging text while dozingAdrian Roos2017-03-091-2/+3
| | | | | | | | | Also refactors the WakeLocks in SystemUI. Bug: 30876804 Bug: 35850304 Test: runtest systemui Change-Id: Ie17eedfd266deb3aa46dabd701bc784330b2e030
* Revert "Revert "AOD: Refactor always on configuration""Adrian Roos2017-03-091-5/+7
| | | | | | | This reverts commit cdcc5c438949ce3d942c95204555680e080c17ed. Bug: 36027947 Change-Id: Iee23682a9d82f930484c3f4c15d99f21a0f1bc36
* Revert "AOD: Refactor always on configuration"Adrian Roos2017-03-071-7/+5
| | | | | | | This reverts commit 28d26a821f5fa078af756ceb3e94090a10f73175. Bug: 36027947 Change-Id: I3d4c2e58b753120ff668a4594f60692abc6a3426
* AOD: Refactor always on configurationAdrian Roos2017-03-031-5/+7
| | | | | | | | Moves the AOD configuration helper to the framework such that it is available outside SystemUI Bug: 30876804 Change-Id: Ic35bd3c04d150fd3eb85d76db0043880b31a011f
* AOD: Refactor DozeMachine to allow waking upAdrian Roos2017-02-161-0/+8
| | | | | | Bug: 30876804 Test: runtest -x $ANDROID_BUILD_TOP/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/doze/DozeMachineTest.java Change-Id: I1d01ab5d8ba3c1bf7b11b0b4911b25f3416ca6e9