• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

animation/23-Nov-2023-1,317816

docs/23-Nov-2023-2,1001,534

plugin/23-Nov-2023-3,4881,581

plugin_core/23-Nov-2023-427119

res/23-Nov-2023-182,842148,822

res-keyguard/23-Nov-2023-15,35712,228

res-product/23-Nov-2023-4,1292,459

scripts/23-Nov-2023-253196

shared/23-Nov-2023-9,2715,804

src/com/android/23-Nov-2023-327,008234,017

tests/23-Nov-2023-121,14989,269

tools/lint/23-Nov-2023-90,00489,012

Android.bpD23-Nov-20236.3 KiB222203

AndroidManifest.xmlD23-Nov-202341.8 KiB883648

CleanSpec.mkD23-Nov-20232.4 KiB512

MODULE_LICENSE_APACHE2D23-Nov-20230

NOTICED23-Nov-202310.4 KiB191158

OWNERSD23-Nov-20231.3 KiB7167

README.mdD23-Nov-20236.6 KiB15194

TEST_MAPPINGD23-Nov-20233.2 KiB122120

lint.xmlD23-Nov-2023106 44

proguard.flagsD23-Nov-20232.1 KiB5951

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
27Each SystemUI service is expected to be a major part of system ui and the
28goal is to minimize communication between them. So in general they should be
29relatively silo'd.
30
31## Dependencies
32
33The first SystemUI service that is started should always be Dependency.
34Dependency provides a static method for getting a hold of dependencies that
35have a lifecycle that spans sysui. Dependency has code for how to create all
36dependencies manually added. SystemUIFactory is also capable of
37adding/replacing these dependencies.
38
39Dependencies are lazily initialized, so if a Dependency is never referenced at
40runtime, it will never be created.
41
42If an instantiated dependency implements Dumpable it will be included in dumps
43of sysui (and bug reports), allowing it to include current state information.
44This is how \*Controllers dump state to bug reports.
45
46If an instantiated dependency implements ConfigurationChangeReceiver it will
47receive onConfigurationChange callbacks when the configuration changes.
48
49## IStatusBar
50
51CommandQueue is the object that receives all of the incoming events from the
52system_server. It extends IStatusBar and dispatches those callbacks back any
53number of listeners. The system_server gets a hold of the IStatusBar when
54StatusBar calls IStatusBarService#registerStatusBar, so if StatusBar is not
55included in the XML service list, it will not be registered with the OS.
56
57CommandQueue posts all incoming callbacks to a handler and then dispatches
58those messages to each callback that is currently registered. CommandQueue
59also tracks the current value of disable flags and will call #disable
60immediately for any callbacks added.
61
62There are a few places where CommandQueue is used as a bus to communicate
63across sysui. Such as when StatusBar calls CommandQueue#recomputeDisableFlags.
64This is generally used a shortcut to directly trigger CommandQueue rather than
65calling StatusManager and waiting for the call to come back to IStatusBar.
66
67## Default SystemUI services list
68
69### [com.android.systemui.Dependency](/packages/SystemUI/src/com/android/systemui/Dependency.java)
70
71Provides custom dependency injection.
72
73### [com.android.systemui.util.NotificationChannels](/packages/SystemUI/src/com/android/systemui/util/NotificationChannels.java)
74
75Creates/initializes the channels sysui uses when posting notifications.
76
77### [com.android.systemui.keyguard.KeyguardViewMediator](/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java)
78
79Manages keyguard view state.
80
81### [com.android.systemui.recents.Recents](/packages/SystemUI/src/com/android/systemui/recents/Recents.java)
82
83Recents tracks all the data needed for recents and starts/stops the recents
84activity. It provides this cached data to RecentsActivity when it is started.
85
86### [com.android.systemui.volume.VolumeUI](/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java)
87
88Registers all the callbacks/listeners required to show the Volume dialog when
89it should be shown.
90
91### [com.android.systemui.status.phone.StatusBar](/packages/SystemUI/src/com/android/systemui/status/phone/StatusBar.java)
92
93This shows the UI for the status bar and the notification shade it contains.
94It also contains a significant amount of other UI that interacts with these
95surfaces (keyguard, AOD, etc.). StatusBar also contains a notification listener
96to receive notification callbacks.
97
98### [com.android.systemui.usb.StorageNotification](/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java)
99
100Tracks USB status and sends notifications for it.
101
102### [com.android.systemui.power.PowerUI](/packages/SystemUI/src/com/android/systemui/power/PowerUI.java)
103
104Tracks power status and sends notifications for low battery/power saver.
105
106### [com.android.systemui.media.RingtonePlayer](/packages/SystemUI/src/com/android/systemui/media/RingtonePlayer.java)
107
108Plays ringtones.
109
110### [com.android.systemui.keyboard.KeyboardUI](/packages/SystemUI/src/com/android/systemui/keyboard/KeyboardUI.java)
111
112Shows UI for keyboard shortcuts (triggered by keyboard shortcut).
113
114### [com.android.systemui.shortcut.ShortcutKeyDispatcher](/packages/SystemUI/src/com/android/systemui/shortcut/ShortcutKeyDispatcher.java)
115
116Dispatches shortcut to System UI components.
117
118### @string/config_systemUIVendorServiceComponent
119
120Component allowing the vendor/OEM to inject a custom component.
121
122### [com.android.systemui.util.leak.GarbageMonitor$Service](/packages/SystemUI/src/com/android/systemui/util/leak/GarbageMonitor.java)
123
124Tracks large objects in sysui to see if there are leaks.
125
126### [com.android.systemui.LatencyTester](/packages/SystemUI/src/com/android/systemui/LatencyTester.java)
127
128Class that only runs on debuggable builds that listens to broadcasts that
129simulate actions in the system that are used for testing the latency.
130
131### [com.android.systemui.globalactions.GlobalActionsComponent](/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsComponent.java)
132
133Shows the global actions dialog (long-press power).
134
135### [com.android.systemui.ScreenDecorations](/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java)
136
137Draws decorations about the screen in software (e.g. rounded corners, cutouts).
138
139### [com.android.systemui.biometrics.BiometricDialogImpl](/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogImpl.java)
140
141Biometric UI.
142
143### [com.android.systemui.wmshell.WMShell](/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java)
144
145Delegates SysUI events to WM Shell controllers.
146
147---
148
149 * [Plugins](/packages/SystemUI/docs/plugins.md)
150 * [Demo Mode](/packages/SystemUI/docs/demo_mode.md)
151