SystemUI是系统应用,包括StatusBar(状态栏)、NavigationBar(导航栏),手机一开机就开始显示手机运行的状态并实时更新手机的一些运行状态。
1、先看Manifest.xml:
Service:
SystemUIService、TakeScreenshotService、KeyguardService、LoadAverageService、ImageWallpaper、DessertCaseDream、DozeService
Receiver:
BootReceiver、APChangedReceiver、RecentsUserEventProxyReceiver(最近应用相关)
TargetChosenReceiver(截屏分享)、DeleteScreenshotReceiver(删除屏幕截图通知)、TunnerService$ClearReceiver
Activity:
(1)TunerActivity、RecentsActivity、UsbStorageActivity、BrightnessDialog、Somnambulator
(2)started from UsbDeviceSettingsManager:
UsbConfirmActivity、UsbPermissionActivity、UsbAccessoryUriActivity、UsbResolverActvity
(3)started from UsbDebuggingManager:
UsbDebuggingActivity、UsbDebuggingSecondaryUserActivity
(4)started from NetworkPolicyManagerService:
NetworkOverLimitActivity
(5)started from MediaProjectionManager:
MediaProjectionPermissionActivity
(6)platform logo easter egg activity彩蛋
DessertCase、MLandActivity
SystemUIService是如何开启的?
系统服务:SystemServer.java
private void startOtherServices() {
//ActivityManagerService mActivityManagerService
mActivityManagerService.systemReady(new Runnable(){
@Override
public void run(){
try{
//启动SystemUI服务
startSystemUi(context);
}catch(Thorwable e){
reportWtf("starting System UI", e);
}
}
});
}
static final void startSystemUi(Context context){
Intent intent = new Intent();
intent.setComponent(new CompenentName("com.android.systemui","com.android.systemui.SystemUIService");
context.startServiceAsUser(intent, UserHandle.OWNER);
}
SystemService类调用startSystemUi函数启动systemuiservice,那么我们再来看看SystemUIService,它继承Service
public class SystemUIService extends Service