android presentation
TRANSCRIPT
![Page 1: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/1.jpg)
Android Architecture
![Page 2: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/2.jpg)
Agenda
● Linux Kernel● Native Libraries● Android Runtime● Application Framework● Inside The System
Connectivity(Bluetooth,WiFi...)Power ManagementDisplay & Multimedia (Surfaceflinger, Audioflinger,Camera/Video) Telephony (Radio Interface Layer)
● Android Boot sequence● Layer Interaction
![Page 3: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/3.jpg)
Android System Architecture
![Page 4: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/4.jpg)
Agenda
● Linux Kernel● Native Libraries● Android Runtime● Application Framework● Inside The System
Connectivity(Bluetooth,WiFi...)Power ManagementDisplay & Multimedia (Surfaceflinger, Audioflinger,Camera/Video) Telephony (Radio Interface Layer)
● Android Boot sequence● Layer Interaction
![Page 5: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/5.jpg)
Linux Kernel
● Android is built on the Linux kernel, but Android is not Linux
● No native windowing system● Does not include the full set of standard
Linux utilities● Patch of “kernel enhancements” to support
Android
![Page 6: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/6.jpg)
Why Linux Kernel?
● Great memory and process management● Permissions-based security model● Proven driver model● Support for shared libraries● It's already open source!
![Page 7: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/7.jpg)
Kernel Enhancements
• Binder• Power Management
![Page 8: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/8.jpg)
Binder: Problem
● Applications and Services may run in separate processes but must communicate and share data
● IPC can introduce significant processing overhead and security holes
![Page 9: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/9.jpg)
Binder: Solution
● Driver to facilitate inter-process communication (IPC)
● High performance through shared memory● Per-process thread pool for processing
requests● Reference counting, and mapping of object
references across processes● Synchronous calls between processes
![Page 10: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/10.jpg)
Binder in Action
![Page 11: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/11.jpg)
Binder in Action
![Page 12: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/12.jpg)
Binder in Action
![Page 13: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/13.jpg)
Binder in Action
![Page 14: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/14.jpg)
Binder in Action
![Page 15: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/15.jpg)
Binder in Action
![Page 16: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/16.jpg)
Binder in Action
![Page 17: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/17.jpg)
Binder
Android Interface Definition Language (AIDL)
http://developer.android.com/guide/components/aidl.html
![Page 18: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/18.jpg)
PM Problem
● Mobile devices run on battery power● Batteries have limited capacity
![Page 19: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/19.jpg)
PM Solution
● Built on top of standard Linux Power Management (PM)
● More aggressive power management policy● Components make requests to keep the
power on through “wake locks”● Supports different types of wake locks
![Page 20: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/20.jpg)
Android PM in Action
![Page 21: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/21.jpg)
Android PM in Action
![Page 22: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/22.jpg)
Android PM in Action
![Page 23: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/23.jpg)
Android PM in Action
![Page 24: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/24.jpg)
Android PM in Action
![Page 25: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/25.jpg)
Android PM in Action
![Page 26: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/26.jpg)
Android PM
● Use wake locks carefully!● sysfs entries for wakelocks in android "/sys/power/wake_lock", "/sys/power/wake_unlock", "/sys/power/state"
![Page 27: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/27.jpg)
Kernel
Download and Build android kernel from:
http://source.android.com/source/building-kernels.html
![Page 28: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/28.jpg)
Agenda
● Linux Kernel● Native Libraries● Android Runtime● Application Framework● Inside The System
Connectivity(Bluetooth,WiFi...)Power ManagementDisplay & Multimedia (Surfaceflinger, Audioflinger,Camera/Video) Telephony (Radio Interface Layer)
● Android Boot sequence● Layer Interaction
![Page 29: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/29.jpg)
Native Libraries
![Page 30: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/30.jpg)
Native Libraries
● Bionic Libc● Function Libraries● Native Servers● Hardware Abstraction Libraries
![Page 31: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/31.jpg)
Native Libraries
● Bionic Libc● Function Libraries● Native Servers● Hardware Abstraction Libraries
![Page 32: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/32.jpg)
What is Bionic?
● What is bionic?Custom libc implementation, optimized for embedded use.
![Page 33: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/33.jpg)
What is Bionic?
Why build a custom libc library?● License: we want to keep GPL out of user-
space● Size: will load in each process, so it needs to
be small● Fast: limited CPU power means we need to
be fast
![Page 34: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/34.jpg)
Bionic libc
● BSD License● Small size and fast code paths● Very fast and small custom pthread
implementation
![Page 35: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/35.jpg)
Bionic libc
● Built-in support for important Android-specific servicesa. system properties
getprop(“my.system.property”, buff, default);b. log capabilities
LOGI(“Logging a message with priority ‘Info’”);
![Page 36: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/36.jpg)
Native Libraries
● Bionic Libc● Function Libraries● Native Servers● Hardware Abstraction Libraries
![Page 37: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/37.jpg)
WebKit
● Based on open source WebKit browser: http://webkit.org
● Renders pages in full (desktop) view● Full CSS, Javascript, DOM, AJAX support● Support for single-column and adaptive view
rendering
![Page 38: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/38.jpg)
Media Framework
● Based on PacketVideo OpenCORE platform● Supports standard video, audio, still-frame
formats● Support for hardware / software codec plug-
ins
![Page 39: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/39.jpg)
SQLite
● Light-weight transactional data store● Back end for most platform data storage
![Page 40: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/40.jpg)
Native Libraries
● Bionic Libc● Function Libraries● Native Servers● Hardware Abstraction Libraries
![Page 41: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/41.jpg)
Surface Flinger
● Provides system-wide surface “composer”, handling all surface rendering to frame buffer device
● Can combine 2D and 3D surfaces and surfaces from multiple applications
![Page 42: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/42.jpg)
Surface Manager
● Surfaces passed as buffers via Binder IPC calls
● Can use OpenGL ES and 2D hardware accelerator for its compositions
● Double-buffering using page-flip
![Page 43: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/43.jpg)
Audio Flinger
● Manages all audio output devices● Processes multiple audio streams into PCM audio out
paths● Handles audio routing to various outputs
![Page 44: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/44.jpg)
Native Libraries
● Bionic Libc● Function Libraries● Native Servers● Hardware Abstraction Libraries
![Page 45: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/45.jpg)
Hardware Abstraction Layer
![Page 46: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/46.jpg)
Hardware Abstraction Libraries
● Why do we need a user-space HAL?○ Not all components have standardized kernel driver
interfaces○ Kernel drivers are GPL which exposes any
proprietary IP○ Android has specific requirements for hardware
drivers
![Page 47: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/47.jpg)
Hardware Abstraction Libraries
● Libraries are loaded dynamically at runtime as needed
QualcommCameraHardware.cpp...libqcamera = dlopen(“/system/lib/liboemcamera.so”, TLD_NOW);...*(void **)&LINK_camera_init = ::dlsym(libqcamera, "camera_init");...LINK_camera_init();
![Page 48: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/48.jpg)
Agenda
● Linux Kernel● Native Libraries● Android Runtime● Application Framework● Inside The System
Connectivity(Bluetooth,WiFi...)Power ManagementDisplay & Multimedia (Surfaceflinger, Audioflinger,Camera/Video) Telephony (Radio Interface Layer)
● Android Boot sequence● Layer Interaction
![Page 49: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/49.jpg)
Android Runtime
![Page 50: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/50.jpg)
What is the Dalvik VM?
● Android's custom clean-room implementation virtual machine
● run on a slow CPU● with relatively little RAM● on an OS without swap space● while powered by a battery
![Page 51: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/51.jpg)
Dalvik Virtual Machine
● Provides application portability and runtime consistency
● Runs optimized file format (.dex) and Dalvik bytecode
● Java .class / .jar files converted to .dex at build time
![Page 52: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/52.jpg)
Core Libraries
● Core APIs for Java language provide a powerful, yet simple and familiar development platform○ Data structures○ Utilities○ File access○ Network Access○ Graphics○ …
![Page 53: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/53.jpg)
.dex file
![Page 54: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/54.jpg)
.jar Vs .dex
![Page 55: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/55.jpg)
.class files
![Page 56: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/56.jpg)
.dex file
![Page 57: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/57.jpg)
Agenda
● Linux Kernel● Native Libraries● Android Runtime● Application Framework● Inside The System
Connectivity(Bluetooth,WiFi...)Power ManagementDisplay & Multimedia (Surfaceflinger, Audioflinger,Camera/Video) Telephony (Radio Interface Layer)
● Android Boot sequence● Layer Interaction
![Page 58: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/58.jpg)
Application Framework
![Page 59: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/59.jpg)
Core Platform Services
● Services that are essential to the Android platform
● Behind the scenes - applications typically don't access them directly
![Page 60: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/60.jpg)
Core Platform Services
● Activity Manager
![Page 61: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/61.jpg)
Core Platform Services
● Activity Manager● Package Manager
![Page 62: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/62.jpg)
Core Platform Services
● Activity Manager● Package Manager● Window Manager
![Page 63: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/63.jpg)
Core Platform Services
● Activity Manager● Package Manager● Window Manager● Resource Manager
![Page 64: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/64.jpg)
Core Platform Services
● Activity Manager● Package Manager● Window Manager● Resource Manager● Content Providers
![Page 65: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/65.jpg)
Core Platform Services
● Activity Manager● Package Manager● Window Manager● Resource Manager● Content Providers● View System
![Page 66: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/66.jpg)
Hardware Services
● Provide access to lower-level hardware APIs● Typically accessed through local Manager
object
LocationManager lm = (LocationManager) Context.getSystemService(Context.LOCATION_SERVICE);
![Page 67: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/67.jpg)
Hardware Services
● Telephony Service
![Page 68: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/68.jpg)
Hardware Services
● Telephony Service● Location Service
![Page 69: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/69.jpg)
Hardware Services
● Telephony Service● Location Service● Bluetooth Service
![Page 70: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/70.jpg)
Hardware Services
● Telephony Service● Location Service● Bluetooth Service● WiFi Service
![Page 71: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/71.jpg)
Hardware Services
● Telephony Service● Location Service● Bluetooth Service● WiFi Service● USB Service
![Page 72: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/72.jpg)
Hardware Services
● Telephony Service● Location Service● Bluetooth Service● WiFi Service● USB Service● Sensor Service
![Page 73: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/73.jpg)
Android System
![Page 74: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/74.jpg)
Agenda
● Linux Kernel● Native Libraries● Android Runtime● Application Framework● Inside The System
Connectivity(Bluetooth,WiFi...)Power ManagementDisplay & Multimedia (Surfaceflinger, Audioflinger,Camera/Video) Telephony (Radio Interface Layer)
● Android Boot sequence● Layer Interaction
![Page 75: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/75.jpg)
Inside The System
● Connectivity ○ Bluetooth○ WiFi
● Power Management● Display & Multimedia
○ Display Subsystem○ Audio Subsystem○ Camera/Video Subsystem
● Telephony
![Page 76: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/76.jpg)
Connectivity
● Bluetooth● Wi-Fi
![Page 77: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/77.jpg)
Bluetooth
Note: Android 4.2 introduces a new Bluetooth stack optimized for use with Android devices. The new Bluetooth stack developed in collaboration between Google and Broadcom replaces the stack based on BlueZ and provides improved compatibility and reliability.
![Page 78: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/78.jpg)
Wi-Fi
● Android uses wpa_supplicant as the platform interface to the Wi-Fi device.
● Your Wi-Fi driver must be compatible with the standard wpa_supplicant
![Page 79: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/79.jpg)
Wi-Fi
![Page 80: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/80.jpg)
Inside The System
● Connectivity ○ Bluetooth○ WiFi
● Power Management● Display & Multimedia
○ Display Subsystem○ Audio Subsystem○ Camera/Video Subsystem
● Telephony
![Page 81: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/81.jpg)
Power Management
![Page 82: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/82.jpg)
Inside The System
● Connectivity ○ Bluetooth○ WiFi
● Power Management● Display & Multimedia
○ Display Subsystem○ Audio Subsystem○ Camera/Video Subsystem
● Telephony
![Page 83: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/83.jpg)
Display & Multimedia
● Display Subsystem● Audio Subsystem● Camera/Video Subsystem
![Page 84: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/84.jpg)
Display Subsystem
![Page 85: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/85.jpg)
Audio Subsystem
![Page 86: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/86.jpg)
Camera/Video Subsystem
![Page 87: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/87.jpg)
Android Multimedia Framework
![Page 88: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/88.jpg)
Inside The System
● Connectivity ○ Bluetooth○ WiFi
● Power Management● Display & Multimedia
○ Display Subsystem○ Audio Subsystem○ Camera/Video Subsystem
● Telephony
![Page 89: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/89.jpg)
Telephony
● Radio Interface Layer
Android's Radio Interface Layer (RIL) provides an abstraction layer between Android telephony services (android.telephony) and radio hardware.
![Page 90: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/90.jpg)
Radio Interface Layer
![Page 91: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/91.jpg)
Agenda
● Linux Kernel● Native Libraries● Android Runtime● Application Framework● Inside The System
Connectivity(Bluetooth,WiFi...)Power ManagementDisplay & Multimedia (Surfaceflinger, Audioflinger,Camera/Video) Telephony (Radio Interface Layer)
● Android Boot sequence● Layer Interaction
![Page 92: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/92.jpg)
Runtime Walkthrough
It all starts with init…
Similar to most Linux-based systems at startup, the bootloader loads the Linux kernel and starts the init process.
![Page 93: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/93.jpg)
Runtime Walkthrough
● Init starts Linux daemons, including:○ USB Daemon (usbd) to manage USB connections○ Android Debug Bridge (adbd) to manage ADB connections○ Debugger Daemon (debuggerd) to manage debug processes requests
(dump memory, etc.)○ Radio Interface Layer Daemon (rild) to manage communication with
the radio
![Page 94: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/94.jpg)
Runtime Walkthrough
● Init process starts the zygote process:○ A nascent process which initializes a Dalvik VM instance○ Loads classes and listens on socket for requests to spawn VMs○ Forks on request to create VM instances for managed processes○ Copy-on-write to maximize re-use and minimize footprint
![Page 95: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/95.jpg)
Runtime Walkthrough
● Init starts runtime process:○ Initializes Service Manager – the context manager for Binder that
handles service registration and lookup○ Registers Service Manager as default context manager for Binder
services
![Page 96: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/96.jpg)
Runtime Walkthrough
● Runtime process sends request for Zygote to start System Service
![Page 97: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/97.jpg)
Runtime Walkthrough
● Runtime process sends request for Zygote to start System Server○ Zygote forks a new VM instance for the System Service process and
starts the service
![Page 98: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/98.jpg)
Runtime Walkthrough
● System Service starts the native system servers, including:○ Surface Flinger○ Audio Flinger
![Page 99: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/99.jpg)
Runtime Walkthrough
● Native system servers register with Service Manager as IPC service targets:
![Page 100: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/100.jpg)
Runtime Walkthrough
● System Service starts the Android managed services:
![Page 101: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/101.jpg)
Runtime Walkthrough
● Android managed Services register with Service Manager:
![Page 102: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/102.jpg)
Runtime Walkthrough
![Page 103: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/103.jpg)
Runtime Walkthrough
After system server loads all services, the system is ready…
![Page 104: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/104.jpg)
Runtime Walkthrough
After system server loads all services, the system is ready…
![Page 105: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/105.jpg)
Runtime Walkthrough
After system server loads all services, the system is ready…
![Page 106: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/106.jpg)
Runtime Walkthrough
Each subsequent application is launched in it's own process
![Page 107: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/107.jpg)
Agenda
● Linux Kernel● Native Libraries● Android Runtime● Application Framework● Inside The System
Connectivity(Bluetooth,WiFi...)Power ManagementDisplay & Multimedia (Surfaceflinger, Audioflinger,Camera/Video) Telephony (Radio Interface Layer)
● Android Boot sequence● Layer Interaction
![Page 108: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/108.jpg)
Layer Interaction
There are 3 main flavors of Android layer cake:○ App Runtime Service lib○ App Runtime Service Native Service lib○ App Runtime Service Native Daemon lib
![Page 109: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/109.jpg)
Layer Interaction
There are 3 main flavors of Android layer cake:○ App Runtime Service lib○ App Runtime Service Native Service lib○ App Runtime Service Native Daemon lib
![Page 110: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/110.jpg)
Android Runtime Services
![Page 111: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/111.jpg)
Android Runtime Services
![Page 112: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/112.jpg)
Android Runtime Services
![Page 113: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/113.jpg)
Android Runtime Services
![Page 114: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/114.jpg)
Example: Location Manager
![Page 115: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/115.jpg)
Layer Interaction
There are 3 main flavors of Android layer cake:○ App Runtime Service lib○ App Runtime Service Native Service lib○ App Runtime Service Native Daemon lib
![Page 116: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/116.jpg)
Android Native Services
![Page 117: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/117.jpg)
Android Native Services
![Page 118: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/118.jpg)
Android Native Services
![Page 119: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/119.jpg)
Android Native Services
![Page 120: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/120.jpg)
Android Native Services
![Page 121: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/121.jpg)
Android Native Services
![Page 122: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/122.jpg)
Android Native Services
![Page 123: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/123.jpg)
Layer Interaction
There are 3 main flavors of Android layer cake:○ App Runtime Service lib○ App Runtime Service Native Service lib○ App Runtime Service Native Daemon lib
![Page 124: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/124.jpg)
Daemon Connection
![Page 125: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/125.jpg)
Daemon Connection
![Page 126: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/126.jpg)
Daemon Connection
![Page 127: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/127.jpg)
Daemon Connection
![Page 128: Android presentation](https://reader034.vdocuments.mx/reader034/viewer/2022052618/554f661cb4c905bb178b4a81/html5/thumbnails/128.jpg)
Questions