Beruflich Dokumente
Kultur Dokumente
Inside Android's UI
Embedded Linux Conference Europe 2012
Karim Yaghmour
@arim!aghmour
karim.yaghmour@opersys.com
2
These slides are made available to you under a Creative Commons Share-
Alike 3. license. The !ull terms o! this license are here"
https"##creativecommons.org#licenses#by-sa#3.#
Attribution re$uirements and misc.% &'(AS( )(A*"
This slide must remain as-is in this speci!ic location +slide ,2-% everything
else you are !ree to change. including the logo "--
/se o! !igures in other documents must !eature the belo0 12riginals at3
/)' immediately under that !igure and the belo0 copyright notice 0here
appropriate.
4ou are !ree to !ill in the 1*elivered and#or customi5ed by3 space on the
right as you see !it.
4ou are 62)78*(9 !rom using the de!ault 1About3 slide as-is or any o! its
contents.
Author o!"
Architecture 7asics
*isplay Core
2penA'
8nput 'ayer
System Startup
"oC # $%U
&ouch inpu'
LC(
Ke!board
)))
C
1.1. Dhat 8?m 92T covering
Eedia layer
Stage6right
Fideo playback
Camera
*)E
(tc.
G
2. Architecture 7asics
A2S&
7inder
System Services
HA'
I
=
1
11
12
13
#!rame0orks#base#services#Java#...
#!rame0orks#base#services#Jni#
#hard0are#libhard0are#
#device#KEA9/6.L#K*(F8C(L
#sdk#emulator#
;ernel or module
#!rame0orks#base#core#...
A2S&-provided
AS'
Eanu!.-provided
Eanu!. license
Eanu!.-provided
GPL-license
1>
3. *isplay Core
*isplay Hard0are
;ernel driver
HA' de!inition
HA' module
Sur!ace 6linger
Dindo0 Eanager
Dalkthrough
1B
3.1. *isplay Hard0are
EE/
82EE/
1C
3.2. Classic 'inu< display stack
1G
3.3. *isplay stack in Android
1I
1=
3.>. ;ernel driver
Eode setting
Checking o! parameters
Eotorola :oom"
#dev#nvhdcp1
#dev#nvhost-ctrl
#dev#nvhost-display
#dev#nvhost-dsi
#dev#nvhost-gr2d
#dev#nvhost-gr3d
#dev#nvhost-isp
#dev#nvhost-mpe
#dev#nvhost-vi
#dev#nvmap
#dev#tegra-crypto
#dev#tegraMavp
#dev#tegraMcamera
#dev#tegraM!use
#dev#tegraMrpc
#dev#tegraMsema
#hard0are#libhard0are#include#hard0are#h0composer.h
struct h0cMprocs"
invalidate+-
vsync+-
struct h0cMcomposerMdevice"
prepare+-
set+-
dump+-
register&rocs+-
$uery+-
N+-
21
3.C. HA' module
Skeleton #hard0are#libhard0are#modules#h0composer.cpp
#system#lib#h0#h0composer.72A)*.so
#system#lib#h0#gralloc.72A)*.so
h0composer.tegra.so
gralloc.tegra.so
#!rame0orks#native#services#sur!ace!linger#*isplayHard0are
HDComposer.cpp
Actual server"
#!rame0orks#native#services#sur!ace!linger
Client side"
#!rame0orks#native#libs#gui
8Sur!aceComposerClient.cpp
8Sur!aceComposer.cpp
Server side"
#!rame0orks#base#services#Java#com#android#server#0m#
Dindo0EanagerService.Java
Session.Java
Client side"
#!rame0orks#base#core#Java#android#vie0#
Dindo0Eanager.Java
Dindo0Eanager8mpl.Java
Fie0)oot8mpl.Java
8nter!aces"
8Dindo0Eanager.aidl
8Dindo0Session.aidl
See Dindo0Eanager.Java
2>
3.=. Dalkthrough
Fie0)oot8mpl?s per!ormTraversals+-
Calls on relayoutDindo0+-
Call to createSur!ace'ocked+-
ne0 Sur!ace+...-
2B
>. 2penA'
Dhat?s 2penA'@
;ernel driver
(A' libs
9ative inter!ace
Oava inter!ace
/p to (S 3.
Android support up to (S 2.
2G
>.2. Dhat?s in a modern-day A&/@
...
2I
>.3. So!t0are layers involved
;ernel driver
A' libraries
#!rame0orks#base#native#opengl#libs
egl.c!g
lib(A'Mper!hud.so
lib(A'Mtegra.so
libA'(SMandroid.so
libA'(Sv1MCEMper!hud.so
libA'(Sv1MCEMtegra.so
libA'(Sv2Mper!hud.so
libA'(Sv2Mtegra.so
elg.c!g"
tegra
31
>.C. 9ative inter!ace
#!rame0orks#native#opengl#include
(A'
(TC1
A'(S
A'(S2
;H)
32
>.G. Oava inter!ace
#!rame0orks#base#opengl#Java#android#opengl"
...
33
>.I. So!t0are A' implementation
#!rame0orks#native#opengl#libagl
3>
B. 8nput 'ayer
#dev#input#N
9o HA' use
9ative lib"
libinput
#!rame0orks#base#services#input
#!rame0orks#base#services#Java#com#android#server#input
So!t keyboard"
#!rame0orks#base#core#Java#android#inputmethodservice
8nput methods"
#packages#inputmehods
http"##developer.android.com#guide#topics#te<t#creating-input-method.html
3B
C. )elevant Apps and Services
'auncher
Status7ar
9oti!ication Service
App Didgets
3C
C.1. 'auncher
See #packages#app#'auncher2
3G
C.2. Status7ar
A uni$ue app
See #!rame0orks#base#packages#System/8
See
#!rame0orks#base#services#Java#com#android#se
rver#DallpaperEanagerService.Java
3=
C.>. 9oti!ication Service
Toasts
See
#!rame0orks#base#services#Java#com#android#se
rver#AppDidgetService.Java
>1
G. System Startup
;ernel
8nit
7oot animation
'auncher
>2
G.1. 7oot animation
1bootanim3 binary
#!rame0orks#base#cmds#bootanimation
See
https"##github.com#CyanogenEod#androidMvendorMcm#tree#Jellybean#pre
built#common#bootanimatino
http"##developer.mips.com#212#>#11#learning-about-
android-graphics-subsystem#
http"##source.android.com#tech#input#inde<.html
>>
Thank you ...
karim.yaghmour@opersys.com