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

..--

accessibility/accessibilitymenu/14-Jan-2024-6,4445,238

aconfig/15-Dec-2024-1,3351,170

animation/15-Dec-2024-10,9056,662

checks/15-Dec-2024-4,9883,890

common/15-Dec-2024-20191

compose/15-Dec-2024-38,55127,572

customization/15-Dec-2024-5,4252,818

docs/15-Dec-2024-3,6372,757

log/15-Dec-2024-1,009477

multivalentTests/src/com/android/15-Dec-2024-99,04875,017

multivalentTestsForDevice/src/com/android/15-Dec-2024-

multivalentTestsForDeviceless/src/com/android/15-Dec-2024-

plugin/15-Dec-2024-4,2321,975

plugin_core/15-Dec-2024-651197

res/15-Dec-2024-213,837176,742

res-keyguard/15-Dec-2024-20,69116,461

res-product/14-Jan-2024-6,1354,437

schemas/com.android.systemui.communal.data.db.CommunalDatabase/15-Dec-2024-7979

scripts/14-Jan-2024-4,9214,592

shared/15-Dec-2024-13,2808,315

src/com/android/14-Jan-2024-615,325428,251

src-debug/com/android/systemui/14-Jan-2024-257129

src-release/com/android/systemui/14-Jan-2024-192101

tests/15-Dec-2024-374,739273,475

tools/lint/14-Jan-2024-89,94988,962

unfold/15-Dec-2024-3,1651,895

utils/15-Dec-2024-30468

Android.bpD15-Dec-202443.6 KiB968924

AndroidManifest-res.xmlD14-Jan-2024719 194

AndroidManifest.xmlD15-Dec-202453.5 KiB1,120821

CleanSpec.mkD14-Jan-20242.4 KiB512

MODULE_LICENSE_APACHE2D14-Jan-20240

NOTICED14-Jan-202410.4 KiB191158

OWNERSD15-Dec-20242.2 KiB119115

README.mdD14-Jan-20247 KiB171113

TEST_MAPPINGD15-Dec-20244.1 KiB161154

flag_check.pyD15-Dec-20244.4 KiB13996

lint-baseline.xmlD15-Dec-20241.7 MiB32,21629,337

lint.xmlD14-Jan-2024106 44

proguard.flagsD15-Dec-2024238 85

proguard_common.flagsD15-Dec-20242.2 KiB5546

proguard_kotlin.flagsD15-Dec-20242 KiB3832

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