|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | 25-May-2024 | - |
| accessibility/accessibilitymenu/ | H | 25-May-2024 | - | 6,267 | 5,085 |
| animation/ | H | 25-May-2024 | - | 8,819 | 5,358 |
| checks/ | H | 25-May-2024 | - | 3,918 | 3,090 |
| common/ | H | 25-May-2024 | - | 199 | 89 |
| compose/ | H | 25-May-2024 | - | 11,472 | 7,706 |
| customization/ | H | 25-May-2024 | - | 3,090 | 2,137 |
| docs/ | H | 25-May-2024 | - | 2,954 | 2,186 |
| log/ | H | 25-May-2024 | - | 1,141 | 567 |
| monet/ | H | 25-May-2024 | - | 785 | 588 |
| plugin/ | H | 25-May-2024 | - | 4,040 | 1,894 |
| plugin_core/ | H | 25-May-2024 | - | 633 | 180 |
| res/ | H | 25-May-2024 | - | 198,907 | 161,812 |
| res-keyguard/ | H | 25-May-2024 | - | 20,302 | 16,176 |
| res-product/ | H | 25-May-2024 | - | 6,135 | 4,437 |
| scripts/ | H | 25-May-2024 | - | 4,921 | 4,592 |
| shared/ | H | 25-May-2024 | - | 13,007 | 8,492 |
| src/com/android/ | H | 25-May-2024 | - | 497,192 | 347,514 |
| src-debug/com/android/systemui/ | H | 25-May-2024 | - | 277 | 130 |
| src-release/com/android/systemui/ | H | 25-May-2024 | - | 211 | 101 |
| tests/ | H | 25-May-2024 | - | 323,654 | 241,466 |
| tools/lint/ | H | 25-May-2024 | - | 89,982 | 88,992 |
| unfold/ | H | 25-May-2024 | - | 2,576 | 1,507 |
| Android.bp | H A D | 25-May-2024 | 19 KiB | 554 | 513 |
| AndroidManifest-res.xml | H A D | 25-May-2024 | 719 | 19 | 4 |
| AndroidManifest.xml | H A D | 25-May-2024 | 53.5 KiB | 1,126 | 830 |
| CleanSpec.mk | H A D | 25-May-2024 | 2.4 KiB | 51 | 2 |
| MODULE_LICENSE_APACHE2 | H A D | 25-May-2024 | 0 | | |
| NOTICE | H A D | 25-May-2024 | 10.4 KiB | 191 | 158 |
| OWNERS | H A D | 25-May-2024 | 2 KiB | 110 | 105 |
| README.md | H A D | 25-May-2024 | 7 KiB | 171 | 113 |
| TEST_MAPPING | H A D | 25-May-2024 | 3.8 KiB | 142 | 140 |
| ktfmt_includes.txt | H A D | 25-May-2024 | 65.3 KiB | 744 | 743 |
| lint.xml | H A D | 25-May-2024 | 106 | 4 | 4 |
| proguard.flags | H A D | 25-May-2024 | 237 | 7 | 5 |
| proguard_common.flags | H A D | 25-May-2024 | 6.3 KiB | 141 | 122 |
README.md
1# SystemUI
2
3“Everything you see in Android that's not an app”
4
5SystemUI is a persistent process that provides UI for the system but outside
6of the system_server process.
7
8Inputs directed at sysui (as opposed to general listeners) generally come in
9through IStatusBar. Outputs from sysui are through a variety of private APIs to
10the android platform all over.
11
12## SystemUIApplication
13
14When SystemUIApplication starts up, it instantiates a Dagger graph from which
15various pieces of the application are built.
16
17To support customization, SystemUIApplication relies on the AndroidManifest.xml
18having an `android.app.AppComponentFactory` specified. Specifically, it relies
19on an `AppComponentFactory` that subclases `SystemUIAppComponentFactoryBase`.
20Implementations of this abstract base class must override
21`#createSystemUIInitializer(Context)` which returns a `SystemUIInitializer`.
22`SystemUIInitializer` primary job in turn is to intialize and return the Dagger
23root component back to the `SystemUIApplication`.
24
25Writing a custom `SystemUIAppComponentFactoryBase` and `SystemUIInitializer`,
26should be enough for most implementations to stand up a customized Dagger
27graph, and launch a custom version of SystemUI.
28
29## Dagger / Dependency Injection
30
31See [dagger.md](docs/dagger.md) and https://dagger.dev/.
32
33## CoreStartable
34
35The starting point for most of SystemUI code is a list of classes that
36implement `CoreStartable` that are started up by SystemUIApplication.
37CoreStartables are like miniature services. They have their `#start` method
38called after being instantiated, and a reference to them is stored inside
39SystemUIApplication. They are in charge of their own behavior beyond this,
40registering and unregistering with the rest of the system as needed.
41
42`CoreStartable` also receives a callback for `#onBootCompleted`
43since these objects may be started before the device has finished booting.
44
45`CoreStartable` is an ideal place to add new features and functionality
46that does not belong directly under the umbrella of an existing feature.
47It is better to define a new `CoreStartable` than to stick unrelated
48initialization code together in catch-all methods.
49
50CoreStartables are tied to application startup via Dagger:
51
52```kotlin
53class FeatureStartable
54@Inject
55constructor(
56 /* ... */
57) : CoreStartable {
58 override fun start() {
59 // ...
60 }
61}
62
63@Module
64abstract class FeatureModule {
65 @Binds
66 @IntoMap
67 @ClassKey(FeatureStartable::class)
68 abstract fun bind(impl: FeatureStartable): CoreStartable
69}
70```
71
72Including `FeatureModule` in the Dagger graph such as this will ensure that
73`FeatureStartable` gets constructed and that its `#start` method is called.
74
75## IStatusBar
76
77CommandQueue is the object that receives all of the incoming events from the
78system_server. It extends IStatusBar and dispatches those callbacks back any
79number of listeners. The system_server gets a hold of the IStatusBar when
80StatusBar calls IStatusBarService#registerStatusBar, so if StatusBar is not
81included in the XML service list, it will not be registered with the OS.
82
83CommandQueue posts all incoming callbacks to a handler and then dispatches
84those messages to each callback that is currently registered. CommandQueue
85also tracks the current value of disable flags and will call #disable
86immediately for any callbacks added.
87
88There are a few places where CommandQueue is used as a bus to communicate
89across sysui. Such as when StatusBar calls CommandQueue#recomputeDisableFlags.
90This is generally used a shortcut to directly trigger CommandQueue rather than
91calling StatusManager and waiting for the call to come back to IStatusBar.
92
93### [com.android.systemui.util.NotificationChannels](/packages/SystemUI/src/com/android/systemui/util/NotificationChannels.java)
94
95Creates/initializes the channels sysui uses when posting notifications.
96
97### [com.android.systemui.keyguard.KeyguardViewMediator](/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java)
98
99Manages keyguard view state.
100
101### [com.android.systemui.recents.Recents](/packages/SystemUI/src/com/android/systemui/recents/Recents.java)
102
103Recents tracks all the data needed for recents and starts/stops the recents
104activity. It provides this cached data to RecentsActivity when it is started.
105
106### [com.android.systemui.volume.VolumeUI](/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java)
107
108Registers all the callbacks/listeners required to show the Volume dialog when
109it should be shown.
110
111### [com.android.systemui.status.phone.CentralSurfaces](/packages/SystemUI/src/com/android/systemui/status/phone/CentralSurfaces.java)
112
113This shows the UI for the status bar and the notification shade it contains.
114It also contains a significant amount of other UI that interacts with these
115surfaces (keyguard, AOD, etc.). CentralSurfaces also contains a notification listener
116to receive notification callbacks.
117
118### [com.android.systemui.usb.StorageNotification](/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java)
119
120Tracks USB status and sends notifications for it.
121
122### [com.android.systemui.power.PowerUI](/packages/SystemUI/src/com/android/systemui/power/PowerUI.java)
123
124Tracks power status and sends notifications for low battery/power saver.
125
126### [com.android.systemui.media.RingtonePlayer](/packages/SystemUI/src/com/android/systemui/media/RingtonePlayer.java)
127
128Plays ringtones.
129
130### [com.android.systemui.keyboard.KeyboardUI](/packages/SystemUI/src/com/android/systemui/keyboard/KeyboardUI.java)
131
132Shows UI for keyboard shortcuts (triggered by keyboard shortcut).
133
134### [com.android.systemui.shortcut.ShortcutKeyDispatcher](/packages/SystemUI/src/com/android/systemui/shortcut/ShortcutKeyDispatcher.java)
135
136Dispatches shortcut to System UI components.
137
138### @string/config_systemUIVendorServiceComponent
139
140Component allowing the vendor/OEM to inject a custom component.
141
142### [com.android.systemui.util.leak.GarbageMonitor$Service](/packages/SystemUI/src/com/android/systemui/util/leak/GarbageMonitor.java)
143
144Tracks large objects in sysui to see if there are leaks.
145
146### [com.android.systemui.LatencyTester](/packages/SystemUI/src/com/android/systemui/LatencyTester.java)
147
148Class that only runs on debuggable builds that listens to broadcasts that
149simulate actions in the system that are used for testing the latency.
150
151### [com.android.systemui.globalactions.GlobalActionsComponent](/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsComponent.java)
152
153Shows the global actions dialog (long-press power).
154
155### [com.android.systemui.ScreenDecorations](/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java)
156
157Draws decorations about the screen in software (e.g. rounded corners, cutouts).
158
159### [com.android.systemui.biometrics.BiometricDialogImpl](/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogImpl.java)
160
161Biometric UI.
162
163### [com.android.systemui.wmshell.WMShell](/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java)
164
165Delegates SysUI events to WM Shell controllers.
166
167---
168
169 * [Plugins](/packages/SystemUI/docs/plugins.md)
170 * [Demo Mode](/packages/SystemUI/docs/demo_mode.md)
171