summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java
Commit message (Collapse)AuthorAgeFilesLines
* Introduce a way to debug relayouts and slow measures/layoutNicolo' Mazzucato2023-01-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This cl introduces a way to debug 2 different but related things: (1) Which classes suffer from long measure and layout pass (2) What caused those classes to be re-measured/re-layout In the current form, only sysui sets the flags to enable the above based on some sysprop. (1) is enabled by `adb shell setprop persist.debug.trace_layouts 1` for all classes in sysui process (note: the process needs to restart). The ideal workflow is to first enable this to spot which are the main classes have long measure/layout slices. Once those are identified (e.g. class X) (2) `adb shell setprop persist.debug.trace_request_layout_class X` enables requestLayout tracing for class X. At this point, every time requestLayout is called on that class, both an instant event (visible in perfetto) and the stacktrace (in logcat) is output. After recording at perfetto trace with (2) enabled, it's possible to aggregate data with an SQL query in ui.perfetto.dev: For example, with the following we can have the most common relayout reasons: ``` SELECT count(*) cnt, msg FROM android_logs WHERE msg LIKE "requestLayout %" GROUP BY msg ORDER BY cnt DESC ``` The following helper bash function makes the above more efficient: trace_class_layouts() { adb shell setprop persist.debug.trace_layouts 1 adb shell setprop persist.debug.trace_request_layout_class $1 adb shell am force-stop com.google.android.apps.nexuslauncher adb shell am force-stop com.android.systemui } Then, use `trace_class_layouts X` and record a perfetto trace. To reduce the overhead, several strings are cached when the view is attached to the window. However, it should be noted that enabling this can have an impact on performance and should only be used for debugging purposes. Test: record a trace after enabling options Bug: 266090955 Merged-In: I89a518d4f3c69c13cdced0f70d8a1e2793bc923a Change-Id: I89a518d4f3c69c13cdced0f70d8a1e2793bc923a
* Move SysUI boot-complete event earlierPeter Kalauskas2022-11-171-1/+2
| | | | | | | | | | | | | | | | | | | Replace Intent.ACTION_BOOT_COMPLETED receiver with Intent.ACTION_LOCKED_BOOT_COMPLETED. This makes the timings of the onBootCompleted() callback more predictable. Previously, onBootCompleted() was typically called after the system user unlocked (e.g. the primary user has entered their PIN). However, there were edge-cases where it could be called earlier. For example, to support secondary users we also checked the sysprop sys.boot_completed during startup. This meant that if SysUI crashed, onBootCompleted() could be called before the system is unlocked. Test: manual Bug: 259474752 Change-Id: I06e61f77f723308f9a82b4756a4c71092e1f308c
* Check if tracing is on before generating stringsPeter Kalauskas2022-11-021-9/+30
| | | | | | | | | | | | | | | Guard Trace.beginSection to avoid unnecessary StringBuilder usage, which would result in GC garbage churn. Also, convert sections to instants when that is more applicable. This also guards against potential run-time crashes if the trace section string is longer than 127 characters. Finally, correct some tracing usage in try blocks. Test: manual Bug: 257075630 Change-Id: Ibe6f194c779256615a7887931256324f7c78811a
* New trace sections for CoreStartablesPeter Kalauskas2022-10-271-8/+29
| | | | | | | | | | | | | - Add trace sections for CoreStartables usage in SystemUIApplication - Convert methods to static when possible - Add trace section for ConfigurationController#onConfigurationChanged() Test: perfetto trace Bug: 253489562 Change-Id: Ie4a49302e90d8c8f6b18e286a00ffe5b9a3ffbe0
* Make CoreStartable an Interface.Dave Mankoff2022-10-131-8/+2
| | | | | | | | | Context is no longer passed in as a constructor arg. Bug: 229228871 Test: manual Change-Id: I3dd5e593f209d120eb36faf33ba629a2066ad3f5 Merged-In: I3dd5e593f209d120eb36faf33ba629a2066ad3f5
* Revert^2 "Change SysemUIFactory to SystemUIInitializer."Dave Mankoff2022-07-141-12/+11
| | | | | | | | | | | Restores ag/18917521 Reverted in ag/15142270fe17845890d147aca8720a32b8c73ecf Test: Ran failed test in http://b/238359875 Bug: 235624311 Change-Id: I08457dac1aa09c44f0c9c02349e8c6773587cd84 Merged-In: I08457dac1aa09c44f0c9c02349e8c6773587cd84
* Remove FileDescriptor from systemui.Dumpable.Dave Mankoff2022-04-051-2/+1
| | | | | | | | | | This is the first step in moving over to the new public android.util.Dumpable api. Bug: 217567642 Test: m SystemUI Merged-In: Ibaebcfb2c6c5326d0c45b8c72d868c76655d89a0 Change-Id: Ibaebcfb2c6c5326d0c45b8c72d868c76655d89a0
* Enable Looper tracingLucas Dupin2022-03-091-0/+5
| | | | | | | | | | Sometimes work that SysUI is doing on the main thread is not visible on perfetto traces. We should enable the app tracing tag on our looper, to be able to properly visualize where the workload is coming from. Test: perfetto trace Fixes: 223615145 Change-Id: I99e11e986996b070288322f24ce68324e93d17b7
* 1/ Remove some unused code from the shared libWinson Chung2022-02-241-5/+5
| | | | | | Bug: 219861883 Test: Builds/Presubmit Change-Id: I884392d2fcbfac6fd27c01f0077d4fb426a24d4a
* PerUser CoreStartables for Primary User.Dave Mankoff2022-02-171-0/+1
| | | | | | | | | Ensure that per-user CoreStartables start for primary user. Before this, they were only being instantiated for the secondary user. Fixes: 220127711 Test: manual Change-Id: I75c72b9e93eefa970ef19bf158f7a0419493a1b6
* Remove config_additionalSystemUIServiceComponentsDave Mankoff2022-02-091-19/+13
| | | | | | | | Also removes @AdditionaStartable and its associated logic. Bug: 205725937 Test: manual Change-Id: I1ba01928b19313e71060d4e4de22b62c8f20207f
* Remove config_systemUIServiceComponents from SystemUI.Dave Mankoff2022-02-091-42/+93
| | | | | | | | | | | | | | | | | | | | Remove's config_systemUIServiceComponents from SystemUI's config.xml and replaces it with a list of Dagger providers that can easily be defined and customized in code. This is a step to removing our reliance on reflection and hopefully lets SystemUI clients better tailor their binary to their needs. Various other small code tweaks are included to address startup-order dependent issues that were discovered while writing this CL. Some startup customization still occurs via XML - one form factor in particular has an overlay that relies on this. It is my intent to find a way to move off of that in the future. Bug: 205725937 Test: manual Change-Id: I4c207bc9487718eddc21f364e81ec760f286bf30
* New API: DumpableContainer.removeDumpable.Felipe Leme2022-02-071-2/+10
| | | | | | | | | | | Test: m update-api Test: atest com.android.internal.util.DumpableContainerImplTest Bug: 149254050 Bug: 217567642 CTS-Coverage-Bug: 149254050 Change-Id: I4efe99a545bd3db2308d0956eaa85e0f799f0f1d
* Creates a generic mechanism to dump app-side information.Felipe Leme2022-01-131-3/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, 'dumpsys activity' can dump the state of some managers: - AutofillManager - ContentCapturemaanger - UiTranslationController But the support for these custom dumping is hardcoded into Activity itself, which makes it harder to extend. For example, automotive builds provide an app-side Car object, which currently cannot be dumped. This CL makes the mechanism more flexible by providing a couple new public / SystemAPIs that let Automotive (or other mainline modules) extend it. Examples: $ adb shell dumpsys activity com.android.car.carlauncher/.CarLauncher --list-dumpables $ adb shell dumpsys activity com.android.car.carlauncher/.CarLauncher --dump-dumpable CarUserManager $ adb shell dumpsys activity service com.android.systemui/.SystemUIService CarUserManager NOTE: this CL only adds the new APIs; a follow-up CL will change the existing managers to use them. Test: see above Test: m update-api Bug: 149254050 CTS-Coverage-Bug: 149254050 Change-Id: I6920ff3542d3d75edd667c2c7658e9d0a7af534f
* Add cheap aidl tracing suitable for always-on-tracing (1/3)Jorim Jaggi2021-12-101-0/+9
| | | | | | | | | | | | | | | | | | | | | | Instead of having only one switch to enable all binder tracing, we seperate between stack tracking and tracing. Stack tracking still works as before. However, the more lightweight option, tracing using android.os.Trace, is toggleable separately and will work on the receiver side without dumping the entire stack trace. We also make the tracing more efficient by caching getTransactionName and concatting the class name. Also, enable this selectively for SysUI+Launcher, which is currently the focus of always-on-tracing effort to figure out what kind of binder calls these processes are calling which seems to contribute a huge amount of jank (long binder calls are in >= 50% of janky traces). Test: external/perfetto/tools/record_android_trace gfx view freq sched wm am aidl Test: atest aidl_unittests Bug: 202278427 Change-Id: I4d803d073cc4b69d07fa433bfef7e1c7f45132b7
* Move #overrideNotificationAppName from CoreStartable.Dave Mankoff2021-11-121-0/+13
| | | | | | Bug: 205725937 Test: manual Change-Id: Iaa4fab4d59b1d08ba1d776f8122e296de3c446c4
* Rename SystemUI class to CoreStartableDave Mankoff2021-11-091-5/+5
| | | | | | Bug: 205725937 Test: manual Change-Id: I045a8b4b21cae0f4a6e61502384e2b1a607bc1c6
* Add additional SystemUI services config.Bryce Lee2021-07-231-2/+13
| | | | | | | | | | | This changelist adds a new array where SystemUI services can be specified through an overlay. This additional array helps prevent drift in overlays in the main services array. Bug: 194454071 Test: manual Change-Id: I8910122f93bf1ebb6a10b6be9cd71c83dd06e7ab
* Remove People Tile flag and clean upFlavio Fiszman2021-03-191-25/+0
| | | | | | Change-Id: Ia4d3f72933bd624fbc414354f8cdca7003737687 Test: manual Bug: 170396074
* Stop checking FeatureFlags for People Tile.Flavio Fiszman2021-02-261-0/+25
| | | | | | | | | | | | | | | | | | | Revert "Use FeatureFlags to enable People Space" Revert "Use FeatureFlags to enable People Space" Revert "Exclude PeopleSpaceWidgetEnabler from Car" Revert submission 13586906-people_space_feature_flag_enable Reason for revert: Performance regression on idle Reverted Changes: I879e86ca3:Exclude PeopleSpaceWidgetEnabler from Car I6361985bc:Use FeatureFlags to enable People Space Ie6758b764:Use FeatureFlags to enable People Space Change-Id: I4da384de8524f60ba0fd203bee811aae2c81308f Test: manual
* Use FeatureFlags to enable People SpaceFlavio Fiszman2021-02-161-19/+0
| | | | | | Change-Id: Ie6758b764d828f635413122db9658a8b01a7b47a Test: manual Bug: 170396074
* Create People Space FeatureFlagFlavio Fiszman2021-02-011-1/+1
| | | | | | | Change-Id: I72acf62327626b62b19665b9ddd70cf766f5ebbd Test: manual Bug: 170396074 178572986 Merged-In: I2d8d9b22b8cff1404b24eb59b81863c6fb9e3964
* Merge "Remove PeopleSpace icon, enable widget by default."Flavio Fiszman2020-12-161-16/+1
|\
| * Remove PeopleSpace icon, enable widget by default.Flavio Fiszman2020-12-161-16/+1
| | | | | | | | | | | | Change-Id: Ied1cc8aa2dc35d8f9ad7d4cbf48b08c120998f02 Test: manual Bug: 170396074
* | Plumbing through GPU context priorityAna Krulec2020-12-151-0/+14
|/ | | | | | | | | If the SF's RE priority is set to REALTIME, then SysUI set's it's ThreadedRendererCompat priority to EGL_CONTEXT_PRIORITY_HIGH_IMG. Test: Compile and observe logcat. Bug: 168740533 Change-Id: Ib2fdac90c22b357d8b9f5c80c03a3d9c4e1a515d
* Allow disabling protolog exceptionsWinson Chung2020-10-281-0/+3
| | | | | | | Bug: 171417169 Test: Build and make sure protologs still works and sysui gradle project can build as well Change-Id: I29684d8b3b5fc49e8179dc15eac9c37cf706322b
* Add default value to People Space flags.Flavio Fiszman2020-10-231-2/+2
| | | | | | Change-Id: Idd6e7c3ef432ee6529d8c9fae740d01224080c18 Test: Boot device without flags and check behaviour. Bug: 169783793
* Creates a widget for People Space.Flavio Fiszman2020-10-211-0/+17
| | | | | | Change-Id: Ic53532d7de1a7d410493e46b4398d03142f78e40 Test: Build, boot, add new widget, see it update. Bug: 169783793
* Enable People Space launch icon based on flag.Flavio Fiszman2020-10-191-0/+17
| | | | | | Change-Id: I96cdca776feafa738f96b8bffa61c780e68067da Test: Boot device with both flag values and check if icon is present. Bug: 169783793
* 6/N Move everything into SysUIComponent.Dave Mankoff2020-08-161-5/+8
| | | | | | | | | | | | | | | 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
* 1/N: Rename SysuiRootComponent to GlobalRootComponentDave Mankoff2020-08-111-2/+2
| | | | | | | | | This is the first step in establishing separate subcomponents for WindowManager and SysUI within the SysUI process. Bug: 162923491 Test: manual Change-Id: I54269e853de92b622d63186e43042780d8ef1d4b
* Make SystemUI config extendableHeemin Seog2020-04-271-3/+3
| | | | | | Bug: 155085702 Test: manual Change-Id: I22e9ecb01993f0dd7be47c10071223bc5348f014
* Introduce DumpManagerNed Burns2020-02-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Introduces DumpManager, a unified dumping system that supports dumping at different priority levels. Currently, when a bug report gets taken, SystemUI is only dumped during the CRITICAL section. This has its advantages (we get to go first!) but also imposes a strict limit on how much we can dump. To get around this restriction, we need to *also* dump SystemUI during the NORMAL section, which has much more forgiving constraints. This CL simply creates the mechanism for systemUI to dump at different priority levels, but doesn't actually cause us to participate in the NORMAL section (yet, see later CLs). It introduces the DumpManager, unified replacement for DumpController & various logic in SystemUIService and Dependency.java. See kdoc in DumpManager for usage notes. Migration of current users of DumpController coming in a later CL. Test: atest, manual Change-Id: If4f41ed496c0c64024a83aad812b77f60fe27555
* Remove Dependency.get(InitController.class)Dave Mankoff2019-12-231-9/+6
| | | | | | Bug: 141882822 Test: atest SystemUITests Change-Id: I3a7fbee69b08abffefc56b722c1753cb733eb528
* Creates a BootCompleteCacheFabian Kozynski2019-11-261-11/+11
| | | | | | | | | | | | | | | This cache is set by SystemUIApplication on boot and can be queried or subscribed to. The cache registration turns into no-op after boot, returning the boot state instead. LocationControllerImpl uses this cache to determine if it can query LocationManager Test: atest BootCompleteCacheTest Fixes: 145019350 Change-Id: I2e34e53bfb8beca730cec8da6125988554c659e4
* Remove Dependency.staticOnConfigurationChangedDave Mankoff2019-11-201-1/+5
| | | | | | | | | | | ConfigurationChangedReceiver is removed. Classes that want to be notified of configuration changes should implement ConfigurationController.ConfigurationListener instead and register themselves with the ConfigurationController. Bug: 144782965 Test: atest SystemUITests Change-Id: Id2c3fe5ae2729b181769fb31b8050da264299d72
* Remove SysUiServiceProvider and mComponents.Dave Mankoff2019-11-141-10/+1
| | | | | | Bug: 142537875 Test: atest SystemUITests Change-Id: I6c48b182c1e6a1ff8b5ce352a40b5afdb5f07442
* Merge "Add prefix to logs based on call source" into qt-qpr1-dev am: 903cd4ceedHeemin Seog2019-11-131-5/+5
|\ | | | | | | | | | | am: 01d77cef37 Change-Id: I4e8ec877740594dd491c9da1b04b2f0ebd0e8557
| * Add prefix to logs based on call sourceHeemin Seog2019-11-081-5/+5
| | | | | | | | | | | | | | | | | | Bug: 144166111 Test: manual, ./external/chromium-trace/systrace.py camera -o /tmp/mytrace.html (after changing tracing tag to "camera" since it isn't used for anything else in automotive) Change-Id: I082888daee17c671ba9ab5c8cf1ae486e683ab16
| * Initialize Dependency with the Application when Dagger starts.Dave Mankoff2019-08-091-3/+15
| | | | | | | | | | | | | | | | | | | | Dependency is no longer a subclass of SystemUI. It gets initialized directly as part of the application, just like the rest of Dagger. It was an awkward implementation of SystemUI anyways. Bug: 137324767 Change-Id: Icf49e9262e8c0710210a8bc0231c4d16396ffdf3 Test: atest SystemUITests
| * Allow Services to be created through Dagger.Dave Mankoff2019-08-011-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a significant change that allows Services to have their constructed injected into. The DozeService is now labeled as injectable (thought it takes no arguments). At least one Service has to be marked as injectable for Dagger to be happy compiling this code. Bug: 138787339 Test: atest SystemUITests Change-Id: I0ec92e01dd236bcee3083c8f8744c53b7ccc92d3 Merged-In: Ib58f8763c996fbc2aea07ead56493d2d9e936f5b
* | Register OverlayPlugins in StatusBar directly.Dave Mankoff2019-11-011-68/+0
| | | | | | | | | | | | | | | | | | | | | | | | This removes the last call to getComponent(StatusBar.class). Prior to this change, we would register a listener for OverlayPlugins inside the SystemUIApp. Because they are directly related to the StatusBar, it is safe and appropriate to have the StatusBar register with the PluginManager itself. Bug: 143224715 Test: atest SystemUITests Change-Id: I5ecdf6a4dae05ba674bcbcd940b9f2655d2b1cbb
* | Move DI related coded into new dagger package.Dave Mankoff2019-10-211-0/+1
| | | | | | | | | | | | | | | | | | This adds new Dagger qualifiers for BgHandler, BgLooper, MainHandler, MainLooper, and MainResources, replacing the use of @Named for them. Bug: 142954072 Test: atest SystemUITests Change-Id: Ibbda8998e587474c26740ba8d49a8b3f90d89efa
* | Make DozeParameters, DozeFactory, DozeService, and ImageWallpaper injectable.Dave Mankoff2019-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | Pass context into the constructor of SystemUI objects.Dave Mankoff2019-10-101-7/+9
| | | | | | | | | | | | | | | | | | The next step is to remove `components` from the SystemUI objects and replace them with Dagger injection. Bug: 138786270 Test: atest SystemUITests Change-Id: I27415a8fa8ba0378599356426d849c9cfb9879d2
* | Provide the ability to inject into SystemUI objects.Dave Mankoff2019-09-051-7/+9
| | | | | | | | | | | | Bug: 140514132 Test: atest SystemUITests Change-Id: Ie3ec4b5d7be2d025f9e2f68cb17a6dc0126d49bd
* | [DO NOT MERGE] qt-qpr1-sysui-dev @ build 5814791Hyunyoung Song2019-09-011-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test: presubmit setup on source branch Bug: 130289146 Create a Gradle build for SystemUI Bug: 136279712 Daggerize FalsingManager Bug: 137324767 "Unable to instantiate service com.android.systemui.doze.DozeService" exception breaks launcher tests Bug: 137563419 Remove Bouncer reveal delay from bypass flow Bug: 138787339 Allow Services and Activities to be injected into directly. Bug: 139128921 [AS 3.5 RC2, SDK API 29 rev 2] Overload resolution ambiguity: while removing element from HashMap Bug: 64712476 Import translations for dev branches Change-Id: Ib7fd4706c070907fd556c3532957f3b1b046de6d
* | Fix the looper that KeyguardUpdateMonitor is using.Dave Mankoff2019-08-311-2/+2
| | | | | | | | | | | | Bug: 139051615 Test: atest SystemUITests && atest SystemUIGoogleTests Change-Id: Ic4dd5978001c208504c137cee41f363d7e70b1b5
* | Allow ContentProviders to be injected into.Dave Mankoff2019-08-281-6/+6
| | | | | | | | | | | | | | | | | | This also allows ContentProviders to call Dependency.get() and similar, dagger-dependent functions. Bug: 139479357 Test: atest SystemUITests Change-Id: I48f370f9506417b04394923fab6bf8cbf19804a4
* | IPC StrictModeLucas Dupin2019-08-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL introduces a way of blocking IPCs on the main thread. This is enforced by StrictMode, and enabled on tests and eng builds. All current blocking IPCs were whitelisted and bugs will be filed, in order to fix them for R. Bug: 139360025 Test: adb logcat Test: atest SystemUITests Change-Id: I45af2619605ee36b6bae83ef080272c62754b654