SlideShare a Scribd company logo
1 of 27
Download to read offline
1
Customizing
Android's UI
AnDevCon Boston 2015
Karim Yaghmour
@karimyaghmour
karim.yaghmour@opersys.com
2
These slides are made available to you under a Creative Commons Share-
Alike 3.0 license. The full terms of this license are here:
https://creativecommons.org/licenses/by-sa/3.0/
Attribution requirements and misc., PLEASE READ:
● This slide must remain as-is in this specific location (slide #2), everything
else you are free to change; including the logo :-)
● Use of figures in other documents must feature the below “Originals at”
URL immediately under that figure and the below copyright notice where
appropriate.
● You are free to fill in the “Delivered and/or customized by” space on the
right as you see fit.
● You are FORBIDEN from using the default “About” slide as-is or any of its
contents.
●
You are FORBIDEN from using any content provided by 3rd
parties without
the EXPLICIT consent from those parties.
(C) Copyright 2013-2015, Opersys inc.
These slides created by: Karim Yaghmour
Originals at: www.opersys.com/community/docs
Delivered and/or customized by
3
About
●
Author of:
●
Introduced Linux Trace Toolkit in 1999
●
Originated Adeos and relayfs (kernel/relay.c)
●
Ara Android Arch Oversight
●
Training, Custom Dev, Consulting, ...
4
Agenda
● Architecture
● Launcher App
● Kiosk App
● System UI
● Screen Overlays
● Theming
● Boot Animation
● Other UI Elements
● References
5
1. Architecture
● Android Architecture
● Display Hardware
● Classic Linux Display Stack
● Display stack in Android
● HAL defininition
● HAL module
● Surface Flinger
● Window Manager
6
7
1.2. Display Hardware
MMU
IOMMU
8
1.3. Classic Linux display stack
9
1.4. Display stack in Android
10
11
1.5. HAL Definition
● /hardware/libhardware/include/hardware/hwcomposer.h
● struct hwc_procs:
● invalidate()
● vsync()
● struct hwc_composer_device:
● prepare()
● set()
● dump()
● registerProcs()
● query()
● *()
12
1.6. HAL module
● Skeleton /hardware/libhardware/modules/hwcomposer.cpp
● /system/lib/hw/hwcomposer.BOARD.so
● /system/lib/hw/gralloc.BOARD.so
● Ex. - Mot Xoom:
● hwcomposer.tegra.so
● gralloc.tegra.so
● Surface Flinger hook:
● /frameworks/native/services/surfaceflinger/DisplayHardware
– HWComposer.cpp
– Provides fake vsync if none is provided in HW
13
1.7. Surface Flinger
● Actual server:
● /frameworks/native/services/surfaceflinger
● Client side:
● /frameworks/native/libs/gui
● Client / Server interface:
● ISurfaceComposerClient.cpp
● ISurfaceComposer.cpp
● This is NOT an aidl'ed service
● All communication is manually
marshalled/unmarshalled
14
1.8. Window Manager
● Server side:
● /frameworks/base/services/java/com/android/server/wm/
– WindowManagerService.java
– Session.java
● Client side:
● /frameworks/base/core/java/android/view/
– WindowManager.java
– WindowManagerImpl.java
– ViewRootImpl.java
● Interfaces:
● IWindowManager.aidl
● IWindowSession.aidl
● Parameters (incl. z-order):
● See WindowManager.java
15
2. Launcher
● This is the “Home” App
● Compiled as part of AOSP
● See /packages/app/Launcher2
● There's actually a real “Home” App:
– development/samples/Home
● Android.mk:
LOCAL_OVERRIDES_PACKAGES := Home
16
●
AndroidManifest.xml:
<activity
...
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
...
●
At least two ways for it to be triggered:
● Activity Manager sends android.intent.category.HOME intent at startup
● Clicking on the “Home” button
●
What this app DOESN'T do:
● Use any of the hidden APIs (LOCAL_SDK_VERSION := current)
● Be signed by the platform key (LOCAL_CERTIFICATE := shared)
● Be persistent
17
3. Kiosk App
● Just replace the Launcher/Home with your
home
● Implement an activity that catches:
android.intent.category.HOME
● You may want to disable the status bar
18
4. System UI
● Comprises:
● Status Bar
● Navigation Bar
● Screen Shot
● Load Average Service
● Wallpaper
● Recent Activities
● USB settings
● A unique app
● See /frameworks/base/packages/SystemUI
● Connects to Status Bar Manager and gives an interface it can use to call
back into Status Bar
19
5. Screen Overlays
● You can talk to the Window Manager directly
● Have it add a View above the current display
● Example:
● Load Average service in SystemUI
20
6. Theming
● Nothing really different from regular resources
● More art than programming
● See frameworks/base/core/res/res
● Generates /system/framework/framework-res.apk
● Lots of theming mods out there show how to manipulate this
apk.
● But since you've got the sources ...
● Examples:
● https://github.com/elelinux/HTC.Elegance
● https://github.com/nadeemsultan/HolofiedCM11Theme
21
● More resources on Theming:
http://xda-university.com/as-a-
user/introduction-to-basic-rom-theming
http://janrain.com/blog/introduction-to-android-
theme-customization/
http://www.vogella.com/tutorials/AndroidStyles
Themes/article.html
http://www.phonesdevelopers.com/1717751/
22
7. Boot animation
● Started by Surface Flinger
● “bootanim” binary
● /frameworks/base/cmds/bootanimation
● Relies on bootanimation.zip w/ PNGs (nothing but)
● See
https://github.com/CyanogenMod/android_vendor_cm/tree/jellybean/pre
built/common/bootanimation
● Must contain a desc.txt:
<width> <height> <fps>
p <count> <pause> <path>
p <count> <pause> <path>
23
8. Other UI Elements
● Wallpaper Manager Service
● Notification Service
● App Widgets
24
8.1. Wallpaper Manager Service
● See
/frameworks/base/services/java/com/android/se
rver/WallpaperManagerService.java
25
8.2. Notification Service
● Toasts
● Status bar notifications
● Gets handle to Status Bar Service at
instantiation
● Uses handle to communicate with Status Bar
26
8.3. App Widgets
● See
/frameworks/base/services/java/com/android/se
rver/AppWidgetService.java
27
Thank you ...
karim.yaghmour@opersys.com

More Related Content

What's hot

Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014Opersys inc.
 
Customizing Android's UI
Customizing Android's UICustomizing Android's UI
Customizing Android's UIOpersys inc.
 
Leveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VILeveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VIOpersys inc.
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave InternalsOpersys inc.
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
 
Android Security, From the Ground Up
Android Security, From the Ground UpAndroid Security, From the Ground Up
Android Security, From the Ground UpOpersys inc.
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Opersys inc.
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things InternalsOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in AndroidOpersys inc.
 
Extending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteExtending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave InternalsOpersys inc.
 
Android On Development Boards at AnDevCon3
Android On Development Boards at AnDevCon3Android On Development Boards at AnDevCon3
Android On Development Boards at AnDevCon3Opersys inc.
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Opersys inc.
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UIOpersys inc.
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with NougatOpersys inc.
 
Developing Android Platform Tools
Developing Android Platform ToolsDeveloping Android Platform Tools
Developing Android Platform ToolsOpersys inc.
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Opersys inc.
 

What's hot (20)

Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014
 
Customizing Android's UI
Customizing Android's UICustomizing Android's UI
Customizing Android's UI
 
Leveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VILeveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VI
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave Internals
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
Android Security, From the Ground Up
Android Security, From the Ground UpAndroid Security, From the Ground Up
Android Security, From the Ground Up
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things Internals
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 
Extending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteExtending Android's Platform Toolsuite
Extending Android's Platform Toolsuite
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave Internals
 
Android Platform Debugging & Development
Android Platform Debugging & Development Android Platform Debugging & Development
Android Platform Debugging & Development
 
Android On Development Boards at AnDevCon3
Android On Development Boards at AnDevCon3Android On Development Boards at AnDevCon3
Android On Development Boards at AnDevCon3
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UI
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
 
Developing Android Platform Tools
Developing Android Platform ToolsDeveloping Android Platform Tools
Developing Android Platform Tools
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?
 

Similar to Customizing Android's UI

Customizing Android's UI
Customizing Android's UICustomizing Android's UI
Customizing Android's UIOpersys inc.
 
Inside Android's UI at AnDevCon V
Inside Android's UI at AnDevCon VInside Android's UI at AnDevCon V
Inside Android's UI at AnDevCon VOpersys inc.
 
Inside Android's UI at AnDevCon IV
Inside Android's UI at AnDevCon IVInside Android's UI at AnDevCon IV
Inside Android's UI at AnDevCon IVOpersys inc.
 
Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Opersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Android Platform Debugging and Development at ABS 2014
Android Platform Debugging and Development at ABS 2014Android Platform Debugging and Development at ABS 2014
Android Platform Debugging and Development at ABS 2014Opersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentKarim Yaghmour
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Is Android the New King of Embedded OSes at Embedded World 2014
Is Android the New King of Embedded OSes at Embedded World 2014Is Android the New King of Embedded OSes at Embedded World 2014
Is Android the New King of Embedded OSes at Embedded World 2014Opersys inc.
 
Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013Opersys inc.
 
Android Things: Android for IoT
Android Things: Android for IoTAndroid Things: Android for IoT
Android Things: Android for IoTOpersys inc.
 
Android Platform Debugging and Development at ELCE 2013
Android Platform Debugging and Development at ELCE 2013Android Platform Debugging and Development at ELCE 2013
Android Platform Debugging and Development at ELCE 2013Opersys inc.
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things InternalsOpersys inc.
 
Brillo/Weave Internals
Brillo/Weave InternalsBrillo/Weave Internals
Brillo/Weave InternalsOpersys inc.
 
Is Android the New Embedded Linux? at AnDevCon V
Is Android the New Embedded Linux? at AnDevCon VIs Android the New Embedded Linux? at AnDevCon V
Is Android the New Embedded Linux? at AnDevCon VOpersys inc.
 

Similar to Customizing Android's UI (20)

Customizing Android's UI
Customizing Android's UICustomizing Android's UI
Customizing Android's UI
 
Inside Android's UI at AnDevCon V
Inside Android's UI at AnDevCon VInside Android's UI at AnDevCon V
Inside Android's UI at AnDevCon V
 
Inside Android's UI at AnDevCon IV
Inside Android's UI at AnDevCon IVInside Android's UI at AnDevCon IV
Inside Android's UI at AnDevCon IV
 
Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HAL
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android Platform Debugging and Development at ABS 2014
Android Platform Debugging and Development at ABS 2014Android Platform Debugging and Development at ABS 2014
Android Platform Debugging and Development at ABS 2014
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Is Android the New King of Embedded OSes at Embedded World 2014
Is Android the New King of Embedded OSes at Embedded World 2014Is Android the New King of Embedded OSes at Embedded World 2014
Is Android the New King of Embedded OSes at Embedded World 2014
 
Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013
 
Android Things: Android for IoT
Android Things: Android for IoTAndroid Things: Android for IoT
Android Things: Android for IoT
 
Android Platform Debugging and Development at ELCE 2013
Android Platform Debugging and Development at ELCE 2013Android Platform Debugging and Development at ELCE 2013
Android Platform Debugging and Development at ELCE 2013
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things Internals
 
Brillo/Weave Internals
Brillo/Weave InternalsBrillo/Weave Internals
Brillo/Weave Internals
 
Is Android the New Embedded Linux? at AnDevCon V
Is Android the New Embedded Linux? at AnDevCon VIs Android the New Embedded Linux? at AnDevCon V
Is Android the New Embedded Linux? at AnDevCon V
 

More from Opersys inc.

Android Automotive
Android AutomotiveAndroid Automotive
Android AutomotiveOpersys inc.
 
Android 10 Internals Update
Android 10 Internals UpdateAndroid 10 Internals Update
Android 10 Internals UpdateOpersys inc.
 
Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security InternalsOpersys inc.
 
Embedded Android Workshop with Pie
Embedded Android Workshop with PieEmbedded Android Workshop with Pie
Embedded Android Workshop with PieOpersys inc.
 
Embedded Android Workshop with Oreo
Embedded Android Workshop with OreoEmbedded Android Workshop with Oreo
Embedded Android Workshop with OreoOpersys inc.
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with NougatOpersys inc.
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with NougatOpersys inc.
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowOpersys inc.
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowOpersys inc.
 

More from Opersys inc. (11)

Android Automotive
Android AutomotiveAndroid Automotive
Android Automotive
 
Android 10 Internals Update
Android 10 Internals UpdateAndroid 10 Internals Update
Android 10 Internals Update
 
Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security Internals
 
Embedded Android Workshop with Pie
Embedded Android Workshop with PieEmbedded Android Workshop with Pie
Embedded Android Workshop with Pie
 
Embedded Android Workshop with Oreo
Embedded Android Workshop with OreoEmbedded Android Workshop with Oreo
Embedded Android Workshop with Oreo
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
 
Project Ara
Project AraProject Ara
Project Ara
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
 
Project Ara
Project AraProject Ara
Project Ara
 

Customizing Android's UI

  • 1. 1 Customizing Android's UI AnDevCon Boston 2015 Karim Yaghmour @karimyaghmour karim.yaghmour@opersys.com
  • 2. 2 These slides are made available to you under a Creative Commons Share- Alike 3.0 license. The full terms of this license are here: https://creativecommons.org/licenses/by-sa/3.0/ Attribution requirements and misc., PLEASE READ: ● This slide must remain as-is in this specific location (slide #2), everything else you are free to change; including the logo :-) ● Use of figures in other documents must feature the below “Originals at” URL immediately under that figure and the below copyright notice where appropriate. ● You are free to fill in the “Delivered and/or customized by” space on the right as you see fit. ● You are FORBIDEN from using the default “About” slide as-is or any of its contents. ● You are FORBIDEN from using any content provided by 3rd parties without the EXPLICIT consent from those parties. (C) Copyright 2013-2015, Opersys inc. These slides created by: Karim Yaghmour Originals at: www.opersys.com/community/docs Delivered and/or customized by
  • 3. 3 About ● Author of: ● Introduced Linux Trace Toolkit in 1999 ● Originated Adeos and relayfs (kernel/relay.c) ● Ara Android Arch Oversight ● Training, Custom Dev, Consulting, ...
  • 4. 4 Agenda ● Architecture ● Launcher App ● Kiosk App ● System UI ● Screen Overlays ● Theming ● Boot Animation ● Other UI Elements ● References
  • 5. 5 1. Architecture ● Android Architecture ● Display Hardware ● Classic Linux Display Stack ● Display stack in Android ● HAL defininition ● HAL module ● Surface Flinger ● Window Manager
  • 6. 6
  • 8. 8 1.3. Classic Linux display stack
  • 9. 9 1.4. Display stack in Android
  • 10. 10
  • 11. 11 1.5. HAL Definition ● /hardware/libhardware/include/hardware/hwcomposer.h ● struct hwc_procs: ● invalidate() ● vsync() ● struct hwc_composer_device: ● prepare() ● set() ● dump() ● registerProcs() ● query() ● *()
  • 12. 12 1.6. HAL module ● Skeleton /hardware/libhardware/modules/hwcomposer.cpp ● /system/lib/hw/hwcomposer.BOARD.so ● /system/lib/hw/gralloc.BOARD.so ● Ex. - Mot Xoom: ● hwcomposer.tegra.so ● gralloc.tegra.so ● Surface Flinger hook: ● /frameworks/native/services/surfaceflinger/DisplayHardware – HWComposer.cpp – Provides fake vsync if none is provided in HW
  • 13. 13 1.7. Surface Flinger ● Actual server: ● /frameworks/native/services/surfaceflinger ● Client side: ● /frameworks/native/libs/gui ● Client / Server interface: ● ISurfaceComposerClient.cpp ● ISurfaceComposer.cpp ● This is NOT an aidl'ed service ● All communication is manually marshalled/unmarshalled
  • 14. 14 1.8. Window Manager ● Server side: ● /frameworks/base/services/java/com/android/server/wm/ – WindowManagerService.java – Session.java ● Client side: ● /frameworks/base/core/java/android/view/ – WindowManager.java – WindowManagerImpl.java – ViewRootImpl.java ● Interfaces: ● IWindowManager.aidl ● IWindowSession.aidl ● Parameters (incl. z-order): ● See WindowManager.java
  • 15. 15 2. Launcher ● This is the “Home” App ● Compiled as part of AOSP ● See /packages/app/Launcher2 ● There's actually a real “Home” App: – development/samples/Home ● Android.mk: LOCAL_OVERRIDES_PACKAGES := Home
  • 16. 16 ● AndroidManifest.xml: <activity ... <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.HOME" /> ... ● At least two ways for it to be triggered: ● Activity Manager sends android.intent.category.HOME intent at startup ● Clicking on the “Home” button ● What this app DOESN'T do: ● Use any of the hidden APIs (LOCAL_SDK_VERSION := current) ● Be signed by the platform key (LOCAL_CERTIFICATE := shared) ● Be persistent
  • 17. 17 3. Kiosk App ● Just replace the Launcher/Home with your home ● Implement an activity that catches: android.intent.category.HOME ● You may want to disable the status bar
  • 18. 18 4. System UI ● Comprises: ● Status Bar ● Navigation Bar ● Screen Shot ● Load Average Service ● Wallpaper ● Recent Activities ● USB settings ● A unique app ● See /frameworks/base/packages/SystemUI ● Connects to Status Bar Manager and gives an interface it can use to call back into Status Bar
  • 19. 19 5. Screen Overlays ● You can talk to the Window Manager directly ● Have it add a View above the current display ● Example: ● Load Average service in SystemUI
  • 20. 20 6. Theming ● Nothing really different from regular resources ● More art than programming ● See frameworks/base/core/res/res ● Generates /system/framework/framework-res.apk ● Lots of theming mods out there show how to manipulate this apk. ● But since you've got the sources ... ● Examples: ● https://github.com/elelinux/HTC.Elegance ● https://github.com/nadeemsultan/HolofiedCM11Theme
  • 21. 21 ● More resources on Theming: http://xda-university.com/as-a- user/introduction-to-basic-rom-theming http://janrain.com/blog/introduction-to-android- theme-customization/ http://www.vogella.com/tutorials/AndroidStyles Themes/article.html http://www.phonesdevelopers.com/1717751/
  • 22. 22 7. Boot animation ● Started by Surface Flinger ● “bootanim” binary ● /frameworks/base/cmds/bootanimation ● Relies on bootanimation.zip w/ PNGs (nothing but) ● See https://github.com/CyanogenMod/android_vendor_cm/tree/jellybean/pre built/common/bootanimation ● Must contain a desc.txt: <width> <height> <fps> p <count> <pause> <path> p <count> <pause> <path>
  • 23. 23 8. Other UI Elements ● Wallpaper Manager Service ● Notification Service ● App Widgets
  • 24. 24 8.1. Wallpaper Manager Service ● See /frameworks/base/services/java/com/android/se rver/WallpaperManagerService.java
  • 25. 25 8.2. Notification Service ● Toasts ● Status bar notifications ● Gets handle to Status Bar Service at instantiation ● Uses handle to communicate with Status Bar
  • 26. 26 8.3. App Widgets ● See /frameworks/base/services/java/com/android/se rver/AppWidgetService.java