|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | - | - |
| docs/ | | 23-Mar-2024 | - | 938 | 685 |
| legacy/recents/ | | 23-Mar-2024 | - | 26,217 | 16,190 |
| plugin/ | | 23-Mar-2024 | - | 2,745 | 1,294 |
| plugin_core/ | | 23-Mar-2024 | - | 414 | 108 |
| res/ | | 23-Mar-2024 | - | 127,510 | 101,445 |
| res-keyguard/ | | 23-Mar-2024 | - | 22,272 | 19,172 |
| scripts/ | | 23-Mar-2024 | - | 181 | 142 |
| shared/ | | 23-Mar-2024 | - | 6,783 | 4,102 |
| src/com/android/ | | 23-Mar-2024 | - | 218,172 | 160,334 |
| tests/ | | 23-Mar-2024 | - | 52,587 | 37,677 |
| tools/lint/ | | 23-Mar-2024 | - | 90,026 | 89,032 |
| Android.bp | D | 23-Mar-2024 | 4.9 KiB | 199 | 175 |
| AndroidManifest.xml | D | 23-Mar-2024 | 32.5 KiB | 695 | 500 |
| CleanSpec.mk | D | 23-Mar-2024 | 2.4 KiB | 51 | 2 |
| MODULE_LICENSE_APACHE2 | D | 23-Mar-2024 | 0 | | |
| NOTICE | D | 23-Mar-2024 | 10.4 KiB | 191 | 158 |
| OWNERS | D | 23-Mar-2024 | 853 | 51 | 45 |
| README.md | D | 23-Mar-2024 | 7.6 KiB | 173 | 109 |
| lint.xml | D | 23-Mar-2024 | 106 | 4 | 4 |
| proguard.flags | D | 23-Mar-2024 | 1.3 KiB | 38 | 33 |
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
8The starting point for most of sysui code is a list of services that extend
9SystemUI that are started up by SystemUIApplication. These services then depend
10on some custom dependency injection provided by Dependency.
11
12Inputs directed at sysui (as opposed to general listeners) generally come in
13through IStatusBar. Outputs from sysui are through a variety of private APIs to
14the android platform all over.
15
16## SystemUIApplication
17
18When SystemUIApplication starts up, it will start up the services listed in
19config_systemUIServiceComponents or config_systemUIServiceComponentsPerUser.
20
21Each of these services extend SystemUI. SystemUI provides them with a Context
22and gives them callbacks for onConfigurationChanged (this historically was
23the main path for onConfigurationChanged, now also happens through
24ConfigurationController). They also receive a callback for onBootCompleted
25since these objects may be started before the device has finished booting.
26
27SystemUI and SystemUIApplication also have methods for putComponent and
28getComponent which were existing systems to get a hold of other parts of
29sysui before Dependency existed. Generally new things should not be added
30to putComponent, instead Dependency and other refactoring is preferred to
31make sysui structure cleaner.
32
33Each SystemUI service is expected to be a major part of system ui and the
34goal is to minimize communication between them. So in general they should be
35relatively silo'd.
36
37## Dependencies
38
39The first SystemUI service that is started should always be Dependency.
40Dependency provides a static method for getting a hold of dependencies that
41have a lifecycle that spans sysui. Dependency has code for how to create all
42dependencies manually added. SystemUIFactory is also capable of
43adding/replacing these dependencies.
44
45Dependencies are lazily initialized, so if a Dependency is never referenced at
46runtime, it will never be created.
47
48If an instantiated dependency implements Dumpable it will be included in dumps
49of sysui (and bug reports), allowing it to include current state information.
50This is how \*Controllers dump state to bug reports.
51
52If an instantiated dependency implements ConfigurationChangeReceiver it will
53receive onConfigurationChange callbacks when the configuration changes.
54
55## IStatusBar
56
57CommandQueue is the object that receives all of the incoming events from the
58system_server. It extends IStatusBar and dispatches those callbacks back any
59number of listeners. The system_server gets a hold of the IStatusBar when
60StatusBar calls IStatusBarService#registerStatusBar, so if StatusBar is not
61included in the XML service list, it will not be registered with the OS.
62
63CommandQueue posts all incoming callbacks to a handler and then dispatches
64those messages to each callback that is currently registered. CommandQueue
65also tracks the current value of disable flags and will call #disable
66immediately for any callbacks added.
67
68There are a few places where CommandQueue is used as a bus to communicate
69across sysui. Such as when StatusBar calls CommandQueue#recomputeDisableFlags.
70This is generally used a shortcut to directly trigger CommandQueue rather than
71calling StatusManager and waiting for the call to come back to IStatusBar.
72
73## Default SystemUI services list
74
75### [com.android.systemui.Dependency](/packages/SystemUI/src/com/android/systemui/Dependency.java)
76
77Provides custom dependency injection.
78
79### [com.android.systemui.util.NotificationChannels](/packages/SystemUI/src/com/android/systemui/util/NotificationChannels.java)
80
81Creates/initializes the channels sysui uses when posting notifications.
82
83### [com.android.systemui.statusbar.CommandQueue$CommandQueueStart](/packages/SystemUI/src/com/android/systemui/sstatusbar/CommandQueue.java)
84
85Creates CommandQueue and calls putComponent because its always been there
86and sysui expects it to be there :/
87
88### [com.android.systemui.keyguard.KeyguardViewMediator](/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java)
89
90Manages keyguard view state.
91
92### [com.android.systemui.recents.Recents](/packages/SystemUI/src/com/android/systemui/recents/Recents.java)
93
94Recents tracks all the data needed for recents and starts/stops the recents
95activity. It provides this cached data to RecentsActivity when it is started.
96
97### [com.android.systemui.volume.VolumeUI](/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java)
98
99Registers all the callbacks/listeners required to show the Volume dialog when
100it should be shown.
101
102### [com.android.systemui.stackdivider.Divider](/packages/SystemUI/src/com/android/systemui/stackdivider/Divider.java)
103
104Shows the drag handle for the divider between two apps when in split screen
105mode.
106
107### [com.android.systemui.SystemBars](/packages/SystemUI/src/com/android/systemui/SystemBars.java)
108
109This is a proxy to the actual SystemUI for the status bar. This loads from
110config_statusBarComponent which defaults to StatusBar. (maybe this should be
111removed and copy how config_systemUiVendorServiceComponent works)
112
113### [com.android.systemui.status.phone.StatusBar](/packages/SystemUI/src/com/android/systemui/status/phone/StatusBar.java)
114
115This shows the UI for the status bar and the notification shade it contains.
116It also contains a significant amount of other UI that interacts with these
117surfaces (keyguard, AOD, etc.). StatusBar also contains a notification listener
118to receive notification callbacks.
119
120### [com.android.systemui.usb.StorageNotification](/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java)
121
122Tracks USB status and sends notifications for it.
123
124### [com.android.systemui.power.PowerUI](/packages/SystemUI/src/com/android/systemui/power/PowerUI.java)
125
126Tracks power status and sends notifications for low battery/power saver.
127
128### [com.android.systemui.media.RingtonePlayer](/packages/SystemUI/src/com/android/systemui/media/RingtonePlayer.java)
129
130Plays ringtones.
131
132### [com.android.systemui.keyboard.KeyboardUI](/packages/SystemUI/src/com/android/systemui/keyboard/KeyboardUI.java)
133
134Shows UI for keyboard shortcuts (triggered by keyboard shortcut).
135
136### [com.android.systemui.pip.PipUI](/packages/SystemUI/src/com/android/systemui/pip/PipUI.java)
137
138Shows the overlay controls when Pip is showing.
139
140### [com.android.systemui.shortcut.ShortcutKeyDispatcher](/packages/SystemUI/src/com/android/systemui/shortcut/ShortcutKeyDispatcher.java)
141
142Dispatches shortcut to System UI components.
143
144### @string/config_systemUIVendorServiceComponent
145
146Component allowing the vendor/OEM to inject a custom component.
147
148### [com.android.systemui.util.leak.GarbageMonitor$Service](/packages/SystemUI/src/com/android/systemui/util/leak/GarbageMonitor.java)
149
150Tracks large objects in sysui to see if there are leaks.
151
152### [com.android.systemui.LatencyTester](/packages/SystemUI/src/com/android/systemui/LatencyTester.java)
153
154Class that only runs on debuggable builds that listens to broadcasts that
155simulate actions in the system that are used for testing the latency.
156
157### [com.android.systemui.globalactions.GlobalActionsComponent](/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsComponent.java)
158
159Shows the global actions dialog (long-press power).
160
161### [com.android.systemui.ScreenDecorations](/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java)
162
163Draws decorations about the screen in software (e.g. rounded corners, cutouts).
164
165### [com.android.systemui.biometrics.BiometricDialogImpl](/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogImpl.java)
166
167Biometric UI.
168
169---
170
171 * [Plugins](/packages/SystemUI/docs/plugins.md)
172 * [Demo Mode](/packages/SystemUI/docs/demo_mode.md)
173