郑州网站建设大华伟业,做彩票网站要什么接口,自己买服务器做网站,网站备案服务类型8种机械键盘轴体对比本人程序员#xff0c;要买一个写代码的键盘#xff0c;请问红轴和茶轴怎么选#xff1f;一、SystemUI组成SystemUI是Android的系统界面#xff0c;包括状态栏statusbar、锁屏keyboard、任务列表recents等等#xff0c;都继承于SystemUI这个类#xf…8种机械键盘轴体对比本人程序员要买一个写代码的键盘请问红轴和茶轴怎么选一、SystemUI组成SystemUI是Android的系统界面包括状态栏statusbar、锁屏keyboard、任务列表recents等等都继承于SystemUI这个类如锁屏KeyguardViewMediator。二、SystemUI启动流程SystemUI的启动由SystemServer开始。SystemServer由Zygote fork生成的进程名为system_server该进程承载着framework的核心服务。Zygote启动过程中会调用startSystemServer()。SystemUI的分析从SystemServer的main方法开始。SystemUI启动的大致流程如下2.1 SystemServerSystemServer在run方法中负责启动系统的各种服务。123456789101112131415..........// Start services.try {traceBeginAndSlog(StartServices);startBootstrapServices();startCoreServices();startOtherServices();SystemServerInitThreadPool.shutdown();} catch (Throwable ex) {Slog.e(System, ******************************************);Slog.e(System, ************ Failure starting system services, ex);throw ex;} finally {traceEnd();}在startOtherServices方法中先是创建并添加WindowManagerService、InputManagerService等service,并且调用startSystemUi方法跳转SystemUIService。12345678910111213141516171819202122232425private void startOtherServices() {//创建注册服务...WindowManagerService wm null;SerialService serial null;NetworkTimeUpdateService networkTimeUpdater null;CommonTimeManagementService commonTimeMgmtService null;InputManagerService inputManager null;...traceBeginAndSlog(IpConnectivityMetrics);mSystemServiceManager.startService(IpConnectivityMetrics.class);traceEnd();traceBeginAndSlog(NetworkWatchlistService);mSystemServiceManager.startService(NetworkWatchlistService.Lifecycle.class);traceEnd();...traceBeginAndSlog(StartSystemUI);try {startSystemUi(context, windowManagerF);} catch (Throwable e) {reportWtf(starting System UI, e);}启动跳转SystemUIService。123456789static final void startSystemUi(Context context, WindowManagerService windowManager) {Intent intent new Intent();intent.setComponent(new ComponentName(com.android.systemui,com.android.systemui.SystemUIService));intent.addFlags(Intent.FLAG_DEBUG_TRIAGED_MISSING);//Slog.d(TAG, Starting service: intent);context.startServiceAsUser(intent, UserHandle.SYSTEM);windowManager.onSystemUiStarted();}2.2 SystemUIServiceSystemUIService在onCreate中调用SystemUIApplication的startServicesIfNeeded方法。123456789101112Overridepublic void onCreate() {super.onCreate();((SystemUIApplication) getApplication()).startServicesIfNeeded();// For debugging RescuePartyif (Build.IS_DEBUGGABLE SystemProperties.getBoolean(debug.crash_sysui, false)) {throw new RuntimeException();}...}2.3 SystemUIApplicationSystemUIApplication先获取配置的systemUI组件。1234public void startServicesIfNeeded() {String[] names getResources().getStringArray(R.array.config_systemUIServiceComponents);startServicesIfNeeded(names);}配置文件在/frameworks/base/packages/SystemUI/res/values/config.xml中配置的systemui组件如图1234567891011121314151617181920212223332 com.android.systemui.Dependency333 com.android.systemui.util.NotificationChannels334 com.android.systemui.statusbar.CommandQueue$CommandQueueStart335 com.android.systemui.keyguard.KeyguardViewMediator336 com.android.systemui.recents.Recents337 com.android.systemui.volume.VolumeUI338 com.android.systemui.stackdivider.Divider339 com.android.systemui.SystemBars340 com.android.systemui.usb.StorageNotification341 com.android.systemui.power.PowerUI342 com.android.systemui.media.RingtonePlayer343 com.android.systemui.keyboard.KeyboardUI344 com.android.systemui.pip.PipUI345 com.android.systemui.shortcut.ShortcutKeyDispatcher346 string/config_systemUIVendorServiceComponent347 com.android.systemui.util.leak.GarbageMonitor$Service348 com.android.systemui.LatencyTester349 com.android.systemui.globalactions.GlobalActionsComponent350 com.android.systemui.ScreenDecorations351 com.android.systemui.fingerprint.FingerprintDialogImpl352 com.android.systemui.SliceBroadcastRelayHandler353 在startServicesIfNeeded方法中根据config配置创建SystemUI并调用SystemUI的start方法。12345678910111213141516171819202122232425262728293031private void startServicesIfNeeded(String[] services) {if (mServicesStarted) {return;}mServices new SystemUI[services.length];final int N services.length;for (int i 0; i N; i) {String clsName services[i];if (DEBUG) Log.d(TAG, loading: clsName);log.traceBegin(StartServices clsName);long ti System.currentTimeMillis();Class cls;try {cls Class.forName(clsName);mServices[i] (SystemUI) cls.newInstance();} catch(ClassNotFoundException ex){throw new RuntimeException(ex);} catch (IllegalAccessException ex) {throw new RuntimeException(ex);} catch (InstantiationException ex) {throw new RuntimeException(ex);}mServices[i].mContext this;mServices[i].mComponents mComponents;if (DEBUG) Log.d(TAG, running: mServices[i]);mServices[i].start();log.traceEnd();...}2.4 SystemUISystemUI是一个抽象类start()是抽象方法具体实现在子类。12345678910111213141516public abstract class SystemUI implements SysUiServiceProvider {public Context mContext;public Map, Object mComponents;public abstract void start();protected void onConfigurationChanged(Configuration newConfig) {}public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {}protected void onBootCompleted() {}...}