summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/systemui/doze/DozeService.java
Commit message (Collapse)AuthorAgeFilesLines
* Update SysUI to use new PowerManager WakeReasonsBeverly2022-12-201-2/+2
| | | | | | | Test: manual - check PowerManagerService logs Test: atest CentralSurfacesImplTest PulsingGestureListenerTest Bug: 242628816 Change-Id: I9ff9845a1f98beb336993170ce65886a31dbfdb9
* Add Customization LibHawkwood Glazier2022-11-181-1/+1
| | | | | | Bug: 258424862 Test: Manually rebuilt everything Change-Id: If683023d2f592bb09827a50fbc79559b5b57cb3a
* Uses Configuration.uiMode in DozeMachine to determine if car mode is activeChandru2022-10-191-0/+8
| | | | | | | | | | | 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-2/+2
| | | | | | | | | | | | | | | | | | | @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
* DOZE instead of DOZE_AOD when batterySaver=activeBeverly2022-03-181-1/+3
| | | | | | | | | So we don't mistakenly briefly show the AOD UI when entering AOD with battery saver active. Test: manual Fixes: 219030172 Change-Id: Ida3b52a3a091736b8ba2d3ad614662a0ac4724e1
* Prevent dagger from hanging onto DozeServiceDave Mankoff2020-08-181-4/+1
| | | | | | | | | | | | | | | Evidently, dagger hangs on to classes marked with @Reusable. This is not desirable for DozeService. Instead, institute a better fix which is binding an interface implementation into its subcomponent, which is the part that needs DozeService to exist. We can't bind DozeService directly as Dagger complains that you can't bind classes that already exist in a parent scope. Binding an interface implementation, however, works well. Fixes: 165208002 Test: manual Change-Id: Iae061d636b6e4bdc8bc6a03e9c7daf900610d19f
* 6/N Move everything into SysUIComponent.Dave Mankoff2020-08-161-1/+4
| | | | | | | | | | | | | | | It is far easier to move _everything_ into SysUIComponent, and then selectively promote things back to GlobalScope and/or WMScope than it is to try to do it one at a time. With this change, though lots of files are touched, very little actually changes structurally. After this change goes in, folks should stop using @Singleton quite so freely. Most things should live in @SysuiSingleton. @Singleton is due to quickly be replaced by @GlobalScope. Bug: 162923491 Test: atest SystemUITests && manual Change-Id: Idc31d3d83b030581fb1fa869f7fafc4f2d3a8828
* Remove DozeFactory. Add DozeComponent/DozeScope.Dave Mankoff2020-07-091-4/+6
| | | | | | | | | | | 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/+6
| | | | | | | | | | | | | 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/+1
| | | | | | | | | | 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
* Remove DozeHost from Components.Dave Mankoff2019-11-051-4/+0
| | | | | | | | DozeHost is injectable. Inject it where needed. Bug: 143982853 Test: atest SystemUITests Change-Id: I76e01b6fc6946754baf2218e5fd7b68728e206c1
* Make DozeParameters, DozeFactory, DozeService, and ImageWallpaper injectable.Dave Mankoff2019-10-161-9/+5
| | | | | | | | | | | | This adds providers for some of the system level objects that we rely on as well. A handful of calls for Dependency.get() have been removed in this cl, (though others are added where necessary). Bug: 142536902 Test: atest SystemUITests && manual Change-Id: Id9cb62deba5229895d487803124dd115b7288466
* DozeLog uses new SysuiLogBeverly2019-09-271-2/+4
| | | | | | Test: atest SystemUITests Bug: 141470043 Change-Id: I089dd42ab67b0a37841159c5f1f9702ea45f57e6
* Allow Services to be created through Dagger.Dave Mankoff2019-07-081-3/+7
| | | | | | | | | | | | This is a significant change that allows Services to have their constructed injected into. This change includes DozeService as an example, injecting the FalsingManager into its constructor. Bug: 136279712 Test: atest SystemUITests Change-Id: Ib58f8763c996fbc2aea07ead56493d2d9e936f5b
* Pass FalsingManager down through more classes.Dave Mankoff2019-07-081-1/+3
| | | | | | | | | | | | | | | | This is the first step in getting the code to inject FalsingManager into more places via Dagger. This removes FalsingManagerFactory, replacing it with calls to Depedency.get() and pushes those calls further up the stack in hopes that the FalsingManager can be directly injected where it's needed in the future. Contains a few random lint cleanups. Bug: 136279712 Test: atest SystemUITests Change-Id: Ie24acd33b0d81ae2112aead0c0d5a8658e04994e
* Avoid PluginManager NPELucas Dupin2019-03-181-1/+3
| | | | | | Fixes: 128749863 Test: mp sysuig Change-Id: Ia8ee414b0bb8bef40413edd59f41680ca2bbeaae
* Instrument wake up reasons.Michael Wright2019-02-061-1/+2
| | | | | | | | | This lets us run experiments that need to know the reason for the wake up in addition to the time and latency. Bug: 122949636 Test: manually turning the device on and off, looking at the logs Change-Id: I38429c3387a289010e1a2696ad351ffbe568413b
* Keep PluginManager reference to avoid NPELucas Dupin2018-11-161-3/+4
| | | | | | Test: manual Change-Id: Ie7ff3eca7a9a02afff0a12d64ec8e40f136ed8d4 Fixes: 118969577
* Move plugin support to shared libTony Wickham2018-09-281-1/+1
| | | | | | | | | | | | | In addition to changing imports, this required some changes to use java 7, since that's what the shared lib needs to be for launcher. See bug for more details on this project. Test: "atest com.android.systemui.shared.plugins" build succeeds and all tests pass Bug: 115877296 Change-Id: Ib79ede0a61664df0ba1a194632a345d2229777fc
* AodPolicy: Fix service leakAdrian Roos2018-04-231-0/+1
| | | | | | | | | | | Fixes an issue where the AlwaysOnDisplayPolicy leaked a service context, and with it the entirety of DozeMachine, preventing wakelocks from being GCed and preventing them from being fallback-released. Bug: 78402666 Test: Toggle screen on and off a few times, verify that DozeService is not being leaked. Change-Id: Ie3ad67c2d0c83760f4d04a53394fab4a3a35d6bc
* Clean up DozeService plugin listeners.Dan Sandler2018-02-151-0/+6
| | | | | | | | | | | | | Also adds some additional debugging: `adb shell dumpsys activity service SystemUI` will now dump the plugin map. This will help us discover leaks that happen to interact with plugins, or leaks in the plugins themselves. (Note that plugins only work on debuggable builds.) Bug: 72138063 Test: adb shell dumpsys activity service SystemUI Change-Id: I328aeb9a0940404760e9121ef26a0518371b8319
* Support wallpapers in AoDLucas Dupin2017-12-181-1/+2
| | | | | | | | | | | | | | | | | Such wallpaper has to define supportsAmbientMode, and set it to true on its android.service.wallpaper meta data. Also introduces WallpaperService.Engine#onAmbientModeChanged to notify a live wallpaper that the display state has changed. Change-Id: I49e846069a698b3cc3bb6e7cda98172920eaae4c Bug: 64155983 Test: runtest -x frameworks/base/packages/SystemUI/tests/src/com/android/systemui/doze/DozeWallpaperStateTest.java Test: runtest -x frameworks/base/tests/Internal/src/android/app/WallpaperInfoTest.java Test: runtest -x frameworks/base/tests/Internal/src/android/service/wallpaper/WallpaperServiceTest.java Test: set AoD wallpaper, go to aod, lock screen, launcher Test: set regular wallpaper, go to aod, lock screen, launcher
* DozeService should call super.dumpOnHandlerLucas Dupin2017-11-061-0/+1
| | | | | | Test: adb shell dumpsys activity service com.android.systemui/com.android.systemui.doze.DozeService Change-Id: I2ba3f3574f59a4caaafdc4cb7ac014f42080c171 Fixes: 68090397
* AOD: Refactor doze brigthness controllers, add AOD auto brightness supportAdrian Roos2017-06-301-2/+0
| | | | | | | | | | | - 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
* Add plugin hooks to DozeServiceMady Mellor2017-06-131-4/+43
| | | | | | | | | | - Find out when the dreaming starts / stops - Request the doze UI to show / hide Bug: 62534409 Test: manual, have no plugin, check that doze still works as expected (i.e. pick up gesture shows it, noti shows it) Change-Id: I11618e47e0bab18423f0d89c8daf285d8c14d238
* Merge "DozePlugin: Remove" into oc-dev am: b2484f2258Adrian Roos2017-05-031-4/+1
|\ | | | | | | | | | | am: 825b574892 Change-Id: I5994fbdd9cc15c1dc42fbecd63792eb2214ab017
| * DozePlugin: RemoveAdrian Roos2017-05-021-4/+1
| | | | | | | | | | | | | | | | | | The DozePlugin has not been able to keep up with the changes to DozeMachine. At this point it is cleaner to just remove it. Bug: 30876804 Test: make SystemUI Change-Id: Ie8cd1488eb862017c54b92b1fba07537c0143bff
* | AOD: Don't use DOZE screen state on AOD2Adrian Roos2017-04-281-0/+2
|/ | | | | | | | | 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
* 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
* New system for versioning sysui pluginsJason Monk2017-02-091-1/+1
| | | | | | | | | Use annotations to handle the multi-dimensionalness of interface versions, but still maintain compile time inclusion of current versions. Test: runtest systemui Change-Id: I0789a72112cf6630a6406f76020071c8a6d9e24c
* Fix leaks in sysuiJason Monk2017-02-021-1/+2
| | | | | | | | | | | Add support for testing for PluginManager and TunerService leaks and add tests for the known leaks and fix them. Also port PluginManager and TunerService to Dependency to make them easier to handle in tests. Test: runtest systemui Change-Id: I5642539ee24dd72f802905106decd0c87b41b4eb Fixes: 34846972
* DozeService: Fix crash if StatusBar not yet initializedAdrian Roos2017-01-111-1/+8
| | | | | | | | | Fixes a bug where a crashing SystemUI may crash again after restarting if the services restart in an unexpected order. Bug: 34044765 Test: Crash SystemUI, observe that it doesn't crash again right away. Change-Id: Id6f781ba29ff11be0850b1883ca2942f15e76324
* Add one-shot plugin supportJason Monk2017-01-111-1/+7
| | | | | | | Should have happened a while ago. Test: runtest systemui Change-Id: I0da4deb5c297e8030213810815a408364ec97e14
* Doze: Add plugin hookAdrian Roos2016-11-181-1/+1
| | | | | Test: mmm vendor/google_experimental/users/roosa/DozePlugin/ Change-Id: I7ea55954f0c07be932e8ee7037e03b7c01cc1108
* Doze: Refactor v1Adrian Roos2016-11-071-430/+8
| | | | | | | | | | Pulls appart UI, state, power, display and trigger management into individual components controlled by a state machine. Also adds tests. Test: runtest -x packages/SystemUI/tests/src/com/android/systemui/doze/DozeMachineTest.java Change-Id: I6ee7e79d58a5a3ebeb975775af44ad1e5aaccf93
* Merge "DozeService: Fixup nits from review"Adrian Roos2016-11-021-3/+1
|\
| * DozeService: Fixup nits from reviewAdrian Roos2016-10-271-3/+1
| | | | | | | | Change-Id: Idedfee4047af307238e863331af1ab690c7f3039
* | AmbientDisplay: Add always on prototypeAdrian Roos2016-10-311-1/+35
|/ | | | | Test: adb shell settings put secure doze_always_on 1 Change-Id: I3f293b3ef43847b7848af416b44f212fc40514d4
* AmbientDisplay: Fixed threadingAdrian Roos2016-10-261-0/+4
| | | | Change-Id: Iee8d2b12145f3f1ab98099631539f6421e99f910
* AmbientDisplay: Factor out DozeSensorsAdrian Roos2016-10-261-204/+21
| | | | Change-Id: Ia604e2f1e2ca7af5e514ef434f99b3f85ef0b789
* Separate ambient display triggersAdrian Roos2016-10-181-5/+9
| | | | | | | | | | | Allows configuring notification and sensor triggers separately. Introduces a helper class that hosts the logic for determining what kinds of triggers a device supports. Bug: 32073185 Change-Id: Ie7e8eb6b895dcc54e6f972e70642c7248b9e223a Test: disable "ambient display", sensor triggers should still work
* Ambient: Re-register all trigger sensors if one firesAdrian Roos2016-10-041-0/+17
| | | | | | | | Works around an issue where triggering one trigger sensor can affect other trigger sensors. To be sure, re-register them all. Change-Id: I4a0999275638e8a78c3c604fda6527aff0d9365a Fixes: 31933894
* Merge "DozeService: Seperate double tap and pickup" into nyc-mr1-devTreeHugger Robot2016-09-271-26/+100
|\
| * DozeService: Seperate double tap and pickupAdrian Roos2016-09-271-26/+100
| | | | | | | | | | | | | | | | | | | | Adds handling for a separate double tap gesture and allows enabling double tap and pickup individually. Test: Turn screen off, toggle gestures with `adb shell settings put secure doze_pulse_on_pick_up 0/1` and `adb shell settings put secure doze_pulse_on_double_tap 0/1` Bug: 30595437 Change-Id: Id7b79f90b28429cf321544a3e425cf33c575d1c3
* | Fix wake lock logic during Dream startupAdrian Roos2016-09-231-10/+7
|/ | | | | | | | | | | | | | | | Fixes a crash that would happen in all dreams that did not have permission to acquire wake locks. Instead moves the wake lock logic into the system process. Also fixes a bug in DozeService where the wake lock was not held until dozing was actually properly initialized. Fixes: 31612287 Bug: 31044352 Related-CL: I85955a2b7d6bad5171accbc336117a9660b1b198 Test: adb shell settings put secure screensaver_components com.android.dreams.basic/.Colors; adb shell service call dreams 1 Change-Id: Idb3f921ee71b6da6c2ab0c44c332ef91f93ddbc0
* Ambient: Pulse for every noisy notification exactly onceAdrian Roos2016-08-231-130/+13
| | | | | | | | | | | Also increases the pulse duration and switches timing to elapsed realtime instead of wall time for robustness. Also remove triggering for notification light for simplifying code. Only noisy notifications are able to trigger the light anyway and noisy notifications already trigger ambient on their own. Change-Id: I4efbe530bb1a60cabaa46c2b04bcd5e12cdef680 Fixes: 31004875
* DozeLog: Properly initializeAdrian Roos2016-07-281-3/+3
| | | | | | | | | | Adds lazy initialization to all DozeLog traces that are called externally. Also fixes a bug where certain traces initialized after logging, thus missing the first log. Change-Id: If75d6cc048f76435856f1c570b66cd6ef96e5ee2 Fixes: 30225249
* Doze: Add config for fine grained proximity checksAdrian Roos2016-07-131-6/+12
| | | | | Bug: 29619338 Change-Id: Ic9ff7fc78f47873858881c1a4ac14bc2b834ab84
* Logging tron metrics for ambient display gesturesBhavik Singh2016-06-081-0/+6
| | | | | | | | | Introducing new TRON metric (ACTION_AMBIENT_GESTURE) and implementing logging for metric in DozeService.java BUG=27907309 Change-Id: I324b6ef65e251f62b277beb1cb76af25159dbd90
* am 05f88187: am ab8616cf: am 235a6911: am 714a61cd: Merge "Ambient display ↵Selim Cinek2015-10-061-2/+11
|\ | | | | | | | | | | | | now comes up immediately when a notification comes in" into mnc-dr-dev * commit '05f88187463119d59955a77c463075e4b12adbc2': Ambient display now comes up immediately when a notification comes in