Android 6.0 Systemui Source Analysis (1)-systemui Introduction

Source: Internet
Author: User

1. Systemui Introduction Systemui is a system application, the main functions are: 1) status bar information display, such as battery, WiFi signal, 3g/4g and other icon display 2) notification panel, such as system messages, third-party application messages, are displayed in the notification panel. 3) Recent task bar display panel. For example, press and hold the home page or recent task shortcut keys to show recently used apps. 4) Provision of services. such as Power + volume plus can. 5) Provide wallpaper service. such as the display of wallpaper. 6) Provide screensaver service. 7) The system UI is displayed.  For example, when a system event arrives, the user is prompted to display the system UI. Systemui Source Path: Frameworks\base\packages\systemui 2.android.mk Introduction Frameworks\base\packages\systemui\android.mk Systemui belongs to the system APK, generated by Android compilation, before learning Systemui source code, need to understand its android.mk, easy to become more familiar with source code. [Plain]View PlainCopy 
  1. Local_path:= $ (call My-dir)
  2. Include $ (clear_vars)
  3. Local_module_tags: = Optional
  4. Local_src_files: = $ (call All-java-files-under, SRC) \
  5. Src/com/android/systemui/eventlogtags.logtags
  6. Local_static_java_libraries: = Keyguard
  7. Local_java_libraries: = Telephony-common
  8. Local_package_name: = Systemui
  9. Local_certificate: = Platform
  10. Local_privileged_module: = True
  11. Local_proguard_flag_files: = Proguard.flags
  12. Local_resource_dir: = \
  13. Frameworks/base/packages/keyguard/res \
  14. $ (Local_path)/res
  15. Local_aapt_flags: =--auto-add-overlay--extra-packages Com.android.keyguard
  16. Ifneq ($ (system_ui_incremental_builds),)
  17. local_proguard_enabled: = disabled
  18. local_jack_enabled: = Incremental
  19. endif
  20. Include Frameworks/base/packages/settingslib/common.mk
  21. Include $ (build_package)
  22. Ifeq ($ (exclude_systemui_tests),)
  23. Include $ (call all-makefiles-under,$ (Local_path))
  24. endif
From the above android.mk can be seen: 1) apply the compiled name: sysemuilocal_package_name: = Systemui 2) After applying the compiled system path:/system/pri-app/systemuilocal_ Privileged_module: = True Description: Do not add this property, the compiled path is/system/app/systemui under the same system permissions, the/system/pri-app under the APK permission is larger than/system/app 3 ) can optionally use the Jack compiler Ifneq ($ (system_ui_incremental_builds),)
local_proguard_enabled: = disabled
local_jack_enabled: = Incremental
EndIf's explanation of local_proguard_enabled and local_jack_enabled can be seen in this article. (Planned @@) 3 Androidmanifest.xml Introduction After analyzing Android.mk, the next step is to analyze the androidmanifest.xml. Androidmanifest.xml is the APK profile, the APK requires permissions, features, and four components, all configured here. And the hierarchy of components can also be seen, it is easy for us to analyze the source code. From Androidmanifest.xml we can see: 1) Systemui belongs to the system apkandroid:shareduserid= "Android.uid.systemui" 2) Systemui belongs to the core apkcoreapp= "true" 3) Systemui will not be killed, that is, will automatically restart after kill android:persistent= "true" here the kill mainly refers to not be low memory Killer kill 4) process name is Com.android.systemui android:process= "Com.android.systemui" 5) The opening service is mainly: <service android: Name= "Systemuiservice"
Android:exported= "true"
/> <service android:name= ". Loadaverageservice "
Android:exported= "true"/>
<service android:name= ". Imagewallpaper "
android:permission= "Android.permission.BIND_WALLPAPER"
Android:exported= "true"/> <service
Android:name= ". Keyguard. Keyguardservice "
Android:exported= "true"
android:enabled= "@bool/config_enablekeyguardservice"/> is unexpectedly the service is not open to the outside, it appears that only the system process can start and use this service <!--started FR Om Phonewindowmanager
Todo:should has an android:permission attribute--
<service android:name= ". Screenshot. Takescreenshotservice "
android:process= ": Screenshot"
Android:exported= "false"/> 6) The main activity is: recent taskbar: <!--Alternate Recents--
<activity android:name= ". Recents. Recentsactivity "
Android:label= "@string/accessibility_desc_recent_apps"
Android:exported= "false"
Android:launchmode= "SingleInstance"
Android:excludefromrecents= "true"
Android:statenotneeded= "true"
Android:resumewhilepausing= "true"
Android:screenorientation= "Behind"
Android:theme= "@style/config_recents_activity_theme" >
<intent-filter>
<action android:name= "Com.android.systemui.recents.TOGGLE_RECENTS"/>
</intent-filter>
</activity> USB Debug related activity, such as mobile phone on the computer insert, phone on the prompt box, ADB connect to the phone, phone authorization prompt box. <!--started from Usbdevicesettingsmanager--
<activity android:name= ". USB. Usbconfirmactivity "
Android:exported= "true"
android:permission= "Android.permission.MANAGE_USB"
Android:theme= "@style/theme.systemui.dialog.alert"
Android:finishonclosesystemdialogs= "true"
Android:excludefromrecents= "true" >
</activity>


<!--started from Usbdevicesettingsmanager--
<activity android:name= ". USB. Usbpermissionactivity "
Android:exported= "true"
android:permission= "Android.permission.MANAGE_USB"
Android:theme= "@style/theme.systemui.dialog.alert"
Android:finishonclosesystemdialogs= "true"
Android:excludefromrecents= "true" >
</activity>


<!--started from Usbdevicesettingsmanager--
<activity android:name= ". USB. Usbresolveractivity "
Android:exported= "true"
android:permission= "Android.permission.MANAGE_USB"
Android:theme= "@style/theme.systemui.dialog.alert"
Android:finishonclosesystemdialogs= "true"
Android:excludefromrecents= "true" >
</activity>


<!--started from Usbdevicesettingsmanager--
<activity android:name= ". USB. Usbaccessoryuriactivity "
Android:exported= "true"
android:permission= "Android.permission.MANAGE_USB"
Android:theme= "@style/theme.systemui.dialog.alert"
Android:finishonclosesystemdialogs= "true"
Android:excludefromrecents= "true" >
</activity>


<!--started from Usbdebuggingmanager--
<activity android:name= ". USB. Usbdebuggingactivity "
android:permission= "Android.permission.MANAGE_USB"
Android:theme= "@style/theme.systemui.dialog.alert"
Android:finishonclosesystemdialogs= "true"
Android:excludefromrecents= "true" >
</activity>
<activity android:name= ". USB. Usbdebuggingsecondaryuseractivity "
Android:theme= "@style/theme.systemui.dialog.alert"
Android:finishonclosesystemdialogs= "true"
Android:excludefromrecents= "true" >
</activity> Brightness control activity: <activity
Android:name= ". Settings. Brightnessdialog "
Android:label= "@string/quick_settings_brightness_dialog_title"
Android:theme= "@android: Style/theme.devicedefault.dialog"
Android:finishonclosesystemdialogs= "true"
Android:launchmode= "SingleInstance"
Android:excludefromrecents= "true"
Android:exported= "true" >
<intent-filter>
<action android:name= "Android.intent.action.SHOW_BRIGHTNESS_DIALOG"/>
<category android:name= "Android.intent.category.DEFAULT"/>
</intent-filter>
</activity> above about systemui Some basic things, we read the source code, but also the main function of Systemui, as well as the main service and activity analysis, familiar with Google design ideas and code architecture.

Android 6.0 Systemui Source Analysis (1)-systemui Introduction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.