SlideShare a Scribd company logo
Android Internals
RAJESH KHETAN
Co-founder @ Bangalore Tech Events
Agenda
 Android Boot Up Process
 How Package Manager Service works ?
A Typical Android Boot-Up
KERNEL
Installd,
adbd,
servicemanger...
System Server
Zygote
App 1 , App 2 …App N
INIT
A Typical Android Boot-Up
KERNEL
Installd,
adbd,
servicemanger...
System Server
Zygote
App 1 , App 2 …App N
INIT
Kernel
 Special forked version of Linux
 Features :
 Wake locks
 Low Memory Killer (OOM adjustment)
 Provides Binder driver
A Typical Android Boot-Up
KERNEL
Installd,
adbd,
servicemanger...
System Server
Zygote
App 1 , App 2 …App N
INIT
INIT
 Root / First User Space process
 Responsibilities :
 Set up file system permissions
 Start native daemons
A Typical Android Boot-Up
KERNEL
Installd,
adbd,
servicemanger...
System Server
Zygote
App 1 , App 2 …App N
INIT
A Typical Android Boot-Up
KERNEL
Installd,
adbd,
servicemanger...
System Server
Zygote
App 1 , App 2 …App N
INIT
Zygote
 Base of all other java processes
 The app_process command invokes Android Runtime to start the first DVM/ART
 The VM then invokes zygotes main method (ZygoteInit.java)
Zygote
Register Zygote Socket
fork systemserver
Preloads Classes And Resources
Wait for requests
fork()
Zygote
Register Zygote Socket
fork systemserver
Preloads Classes And Resources
Wait for requests
fork()
Zygote
Register Zygote Socket
fork systemserver
Preloads Classes And Resources
Wait for requests
fork()
Zygote
Register Zygote Socket
fork systemserver
Preloads Classes And Resources
Wait for requests
fork()
Zygote
Register Zygote Socket
fork systemserver
Preloads Classes And Resources
Wait for requests
fork()
A Typical Android Boot-Up
KERNEL
Installd,
adbd,
servicemanger...
System Server
Zygote
App 1 , App 2 …App N
INIT
A Typical Android Boot-Up
KERNEL
Installd,
adbd,
servicemanger...
System Server
Zygote
App 1 , App 2 …App N
INIT
System Server
 Heart of the Android System
 Start system services
 Register services with the service manager
System Server
Creates system context
Start bootstrap services
Start Other Services
Start core services
ActivityManagerService
PackageManagerService
WindowManagerService
Wifi/Bluetooth Service
SystemUI
Loads server library
System Server
Creates system context
Start bootstrap services
Start Other Services
Start core services
ActivityManagerService
PackageManagerService
WindowManagerService
Wifi/Bluetooth Service
SystemUI
Loads server library
System Server
Creates system context
Start bootstrap services
Start Other Services
Start core services
ActivityManagerService
PackageManagerService
WindowManagerService
Wifi/Bluetooth Service
SystemUI
Loads server library
System Server
Creates system context
Start bootstrap services
Start Other Services
Start core services
ActivityManagerService
PackageManagerService
WindowManagerService
Wifi/Bluetooth Service
SystemUI
Loads server library
System Server
Creates system context
Start bootstrap services
Start Other Services
Start core services
ActivityManagerService
PackageManagerService
WindowManagerService
Wifi/Bluetooth Service
SystemUI
Loads server library
System Server
Creates system context
Start bootstrap services
Start Other Services
Start core services
ActivityManagerService
PackageManagerService
WindowManagerService
Wifi/Bluetooth Service
SystemUI
Loads server library
System Server
Creates system context
Start bootstrap services
Start Other Services
Start core services
ActivityManagerService
PackageManagerService
WindowManagerService
Wifi/Bluetooth Service
SystemUI
Loads server library
System Server
Creates system context
Start bootstrap services
Start Other Services
Start core services
ActivityManagerService
PackageManagerService
WindowManagerService
Wifi/Bluetooth Service
SystemUI
Loads server library
System Server
Creates system context
Start bootstrap services
Start Other Services
Start core services
ActivityManagerService
PackageManagerService
WindowManagerService
Wifi/Bluetooth Service
SystemUI
Loads server library
Package Manager Service
 Responsibilties :
 Installation/Uninstallation of apps
 Managing Permissions & Certificate Handling
 Exposing APIs to 3rd party applications
Package Manager Service(Flow)
Scan Packages
Grant Permissions
Initialization
Manifest Parsing
Perform DexOpt
Collect Certificates
Generate Package Info
Asset Loading
Package Manager Service(Flow)
Scan Packages
Grant Permissions
Initialization
Manifest Parsing
Perform DexOpt
Collect Certificates
Generate Package Info
Asset Loading
Package Manager Service(Flow)
Scan Packages
Grant Permissions
Initialization
Manifest Parsing
Perform DexOpt
Collect Certificates
Generate Package Info
Asset Loading
Package Manager Service(Flow)
Scan Packages
Grant Permissions
Initialization
Manifest Parsing
Perform DexOpt
Collect Certificates
Generate Package Info
Asset Loading
Package Manager Service(Flow)
Scan Packages
Grant Permissions
Initialization
Manifest Parsing
Perform DexOpt
Collect Certificates
Generate Package Info
Asset Loading
Package Manager Service(Flow)
Scan Packages
Grant Permissions
Initialization
Manifest Parsing
Perform DexOpt
Collect Certificates
Generate Package Info
Asset Loading
Package Manager Service(Flow)
Scan Packages
Grant Permissions
Initialization
Manifest Parsing
Perform DexOpt
Collect Certificates
Generate Package Info
Asset Loading
Package Manager Service(Flow)
Scan Packages
Grant Permissions
Initialization
Manifest Parsing
Perform DexOpt
Collect Certificates
Generate Package Info
Asset Loading
Package Manager Service(Flow)
Scan Packages
Grant Permissions
Initialization
Manifest Parsing
Perform DexOpt
Collect Certificates
Generate Package Info
Asset Loading
Package Manager Service
 Package information is cached into /data/system/packages.xml
 Runtime permissions are cached into /data/system/0/runtime_packages.xml
PackageIntsaller
Offers the ability to install, upgrade, and
remove applications on the device.
PackageInstallerActivity
 Launched when a new application is installed via side loading
 Display parsing errors via a dialog.
 Enable unknown applications setting.
 Memory check
 Check for same existing package
 Install app
Installd
 PMS lacks root privileges
 Creating , deleting & changing the ownership of applications directories requires superuser capabilities .
 The PMS delegates these operations to the installd daemon
A Quick Recap
Native Daemons
Zygote
Launcher
System Server
Activity Manager
Android Runtime
Kernel Init
A Quick Recap
Native Daemons
Zygote
Launcher
System Server
Activity Manager
Android Runtime
Kernel
- Initialization
- Mount root FS
- Starts Init Process
Init
A Quick Recap
Native Daemons
Zygote
Launcher
System Server
Activity Manager
Android Runtime
Kernel
Init
- Set up env variables
- Mount FS
- Set UP FS perm
- Start native daemons
A Quick Recap
Native Daemons
- servicemanager
- app_process -X Zygote
- adbd
- installd
Zygote
Launcher
System Server
Activity Manager
Android Runtime
Kernel Init
A Quick Recap
Native Daemons
Zygote
Launcher
System Server
Activity Manager
Android Runtime
- Start first VM
- Call zygote’s main method
Kernel Init
A Quick Recap
Native Daemons
Zygote
- Register Zygote socket
- Preload classes & res.
- Start systemserver process
- Listen for connections
Launcher
System Server
Activity Manager
Android Runtime
Kernel Init
A Quick Recap
Native Daemons
Zygote
Launcher
System Server
- Start services
- Register with service manager
Activity Manager
Android Runtime
Kernel Init
A Quick Recap
Native Daemons
Zygote
Launcher
System Server
Activity Manager
- Init itself
- Send Intent.Category_HOME
- Send BOOT_COMPLETE
Android Runtime
Kernel Init
A Quick Recap
Native Daemons
Zygote
Launcher
- Init itself
- Register OnClick handlers
System Server
Activity Manager
Android Runtime
Kernel Init
A Quick Recap
Native Daemons
Zygote
Launcher
System Server
Activity Manager
Android Runtime
Kernel Init
Click
A Quick Recap
Native Daemons
Zygote
Launcher
System Server
Activity Manager
Android Runtime
Kernel Init
Click
A Quick Recap
Native Daemons
Zygote
Launcher
System Server
Activity Manager
Android Runtime
Kernel Init
Click
A Quick Recap
Native Daemons
Zygote
Launcher
System Server
Activity Manager
Android Runtime
Kernel Init
Click
A Quick Recap
Native Daemons
- servicemanager
- app_process -X Zygote
- adbd
- installd
Zygote
- Register Zygote socket
- Preload classes & resources
- Start systemserver process
- Listen for connections
Launcher
- Init itself
- Register OnClick handlers
Click
System Server
- Start services
- Register with servicemanager
Activity Manager
- Init itself
- Send Intent.Category_HOME
- Send BOOT_COMPLETE
broadcast
New app
Android Runtime
- Start first VM
- Call zygote’s main method
Kernel
- Initialization
- Mount root FS
- Starts Init Process
Init
- Set up env variables
- Mount FS
- Set UP FS perm
- Start native daemons
THANK YOU
 References :
 Embedded Android – Karim Yaghmour
 https://android.googlesource.com/
www.bangaloretechevents.com
rajeshkhetan.rk@gmail.com
Contact :
Ad

More Related Content

What's hot (20)

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
Opersys inc.
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
Utkarsh Mankad
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
Emertxe Information Technologies Pvt Ltd
 
Low Level View of Android System Architecture
Low Level View of Android System ArchitectureLow Level View of Android System Architecture
Low Level View of Android System Architecture
National Cheng Kung University
 
Building aosp
Building aospBuilding aosp
Building aosp
gvercoutere
 
Booting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesBooting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot images
Chris Simmonds
 
Design and Concepts of Android Graphics
Design and Concepts of Android GraphicsDesign and Concepts of Android Graphics
Design and Concepts of Android Graphics
National Cheng Kung University
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting Process
Nanik Tolaram
 
Android's Multimedia Framework
Android's Multimedia FrameworkAndroid's Multimedia Framework
Android's Multimedia Framework
Opersys inc.
 
Android IPC Mechanism
Android IPC MechanismAndroid IPC Mechanism
Android IPC Mechanism
National Cheng Kung University
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
Linaro
 
Android Things : Building Embedded Devices
Android Things : Building Embedded DevicesAndroid Things : Building Embedded Devices
Android Things : Building Embedded Devices
Emertxe Information Technologies Pvt Ltd
 
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updates
Gary Bisson
 
Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)
Emertxe Information Technologies Pvt Ltd
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?
Opersys inc.
 
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
Nanik Tolaram
 
Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)
Emertxe Information Technologies Pvt Ltd
 
Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)
Emertxe Information Technologies Pvt Ltd
 
Accessing Hardware on Android
Accessing Hardware on AndroidAccessing Hardware on Android
Accessing Hardware on Android
Gary Bisson
 
Android AIDL Concept
Android AIDL ConceptAndroid AIDL Concept
Android AIDL Concept
Charile Tsai
 
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
Opersys inc.
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
Utkarsh Mankad
 
Booting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesBooting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot images
Chris Simmonds
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting Process
Nanik Tolaram
 
Android's Multimedia Framework
Android's Multimedia FrameworkAndroid's Multimedia Framework
Android's Multimedia Framework
Opersys inc.
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
Linaro
 
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updates
Gary Bisson
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?
Opersys inc.
 
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
Nanik Tolaram
 
Accessing Hardware on Android
Accessing Hardware on AndroidAccessing Hardware on Android
Accessing Hardware on Android
Gary Bisson
 
Android AIDL Concept
Android AIDL ConceptAndroid AIDL Concept
Android AIDL Concept
Charile Tsai
 

Similar to Android internals By Rajesh Khetan (20)

Installation
InstallationInstallation
Installation
rumoorthyit
 
Install VMWare Tools CentOS 7
Install VMWare Tools CentOS 7Install VMWare Tools CentOS 7
Install VMWare Tools CentOS 7
VCP Muthukrishna
 
Interview questions
Interview questionsInterview questions
Interview questions
xavier john
 
Protractor Testing Automation Tool Framework / Jasmine Reporters
Protractor Testing Automation Tool Framework / Jasmine ReportersProtractor Testing Automation Tool Framework / Jasmine Reporters
Protractor Testing Automation Tool Framework / Jasmine Reporters
Haitham Refaat
 
Word press, the automated way
Word press, the automated wayWord press, the automated way
Word press, the automated way
Michaël Perrin
 
Front end workflow with yeoman
Front end workflow with yeomanFront end workflow with yeoman
Front end workflow with yeoman
hassan hafez
 
OpenStack Murano introduction
OpenStack Murano introductionOpenStack Murano introduction
OpenStack Murano introduction
Victor Zhang
 
Continuous Integration using Cruise Control
Continuous Integration using Cruise ControlContinuous Integration using Cruise Control
Continuous Integration using Cruise Control
elliando dias
 
CLUG 2010 09 - systemd - the new init system
CLUG 2010 09 - systemd - the new init systemCLUG 2010 09 - systemd - the new init system
CLUG 2010 09 - systemd - the new init system
PaulWay
 
Systemd for administrators
Systemd for administratorsSystemd for administrators
Systemd for administrators
Susant Sahani
 
Systemd for administrators
Systemd for administratorsSystemd for administrators
Systemd for administrators
Susant Sahani
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
kuldeepakgautam
 
Rock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment WorkflowsRock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment Workflows
AOE
 
Timings of Init : Android Ramdisks for the Practical Hacker
Timings of Init : Android Ramdisks for the Practical HackerTimings of Init : Android Ramdisks for the Practical Hacker
Timings of Init : Android Ramdisks for the Practical Hacker
Stacy Devino
 
How to use Jmeter for performance testing
How to use Jmeter for performance testingHow to use Jmeter for performance testing
How to use Jmeter for performance testing
chiragppatel0111
 
3 App Compat Win7
3 App Compat Win73 App Compat Win7
3 App Compat Win7
llangit
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
adrian_nye
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011
pundiramit
 
Android. behind the scenes_programatica 2012
Android. behind the scenes_programatica 2012Android. behind the scenes_programatica 2012
Android. behind the scenes_programatica 2012
Agora Group
 
Explore Android Internals
Explore Android InternalsExplore Android Internals
Explore Android Internals
National Cheng Kung University
 
Install VMWare Tools CentOS 7
Install VMWare Tools CentOS 7Install VMWare Tools CentOS 7
Install VMWare Tools CentOS 7
VCP Muthukrishna
 
Interview questions
Interview questionsInterview questions
Interview questions
xavier john
 
Protractor Testing Automation Tool Framework / Jasmine Reporters
Protractor Testing Automation Tool Framework / Jasmine ReportersProtractor Testing Automation Tool Framework / Jasmine Reporters
Protractor Testing Automation Tool Framework / Jasmine Reporters
Haitham Refaat
 
Word press, the automated way
Word press, the automated wayWord press, the automated way
Word press, the automated way
Michaël Perrin
 
Front end workflow with yeoman
Front end workflow with yeomanFront end workflow with yeoman
Front end workflow with yeoman
hassan hafez
 
OpenStack Murano introduction
OpenStack Murano introductionOpenStack Murano introduction
OpenStack Murano introduction
Victor Zhang
 
Continuous Integration using Cruise Control
Continuous Integration using Cruise ControlContinuous Integration using Cruise Control
Continuous Integration using Cruise Control
elliando dias
 
CLUG 2010 09 - systemd - the new init system
CLUG 2010 09 - systemd - the new init systemCLUG 2010 09 - systemd - the new init system
CLUG 2010 09 - systemd - the new init system
PaulWay
 
Systemd for administrators
Systemd for administratorsSystemd for administrators
Systemd for administrators
Susant Sahani
 
Systemd for administrators
Systemd for administratorsSystemd for administrators
Systemd for administrators
Susant Sahani
 
Rock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment WorkflowsRock-solid Magento Development and Deployment Workflows
Rock-solid Magento Development and Deployment Workflows
AOE
 
Timings of Init : Android Ramdisks for the Practical Hacker
Timings of Init : Android Ramdisks for the Practical HackerTimings of Init : Android Ramdisks for the Practical Hacker
Timings of Init : Android Ramdisks for the Practical Hacker
Stacy Devino
 
How to use Jmeter for performance testing
How to use Jmeter for performance testingHow to use Jmeter for performance testing
How to use Jmeter for performance testing
chiragppatel0111
 
3 App Compat Win7
3 App Compat Win73 App Compat Win7
3 App Compat Win7
llangit
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
adrian_nye
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011
pundiramit
 
Android. behind the scenes_programatica 2012
Android. behind the scenes_programatica 2012Android. behind the scenes_programatica 2012
Android. behind the scenes_programatica 2012
Agora Group
 
Ad

Android internals By Rajesh Khetan

  • 2. Agenda  Android Boot Up Process  How Package Manager Service works ?
  • 3. A Typical Android Boot-Up KERNEL Installd, adbd, servicemanger... System Server Zygote App 1 , App 2 …App N INIT
  • 4. A Typical Android Boot-Up KERNEL Installd, adbd, servicemanger... System Server Zygote App 1 , App 2 …App N INIT
  • 5. Kernel  Special forked version of Linux  Features :  Wake locks  Low Memory Killer (OOM adjustment)  Provides Binder driver
  • 6. A Typical Android Boot-Up KERNEL Installd, adbd, servicemanger... System Server Zygote App 1 , App 2 …App N INIT
  • 7. INIT  Root / First User Space process  Responsibilities :  Set up file system permissions  Start native daemons
  • 8. A Typical Android Boot-Up KERNEL Installd, adbd, servicemanger... System Server Zygote App 1 , App 2 …App N INIT
  • 9. A Typical Android Boot-Up KERNEL Installd, adbd, servicemanger... System Server Zygote App 1 , App 2 …App N INIT
  • 10. Zygote  Base of all other java processes  The app_process command invokes Android Runtime to start the first DVM/ART  The VM then invokes zygotes main method (ZygoteInit.java)
  • 11. Zygote Register Zygote Socket fork systemserver Preloads Classes And Resources Wait for requests fork()
  • 12. Zygote Register Zygote Socket fork systemserver Preloads Classes And Resources Wait for requests fork()
  • 13. Zygote Register Zygote Socket fork systemserver Preloads Classes And Resources Wait for requests fork()
  • 14. Zygote Register Zygote Socket fork systemserver Preloads Classes And Resources Wait for requests fork()
  • 15. Zygote Register Zygote Socket fork systemserver Preloads Classes And Resources Wait for requests fork()
  • 16. A Typical Android Boot-Up KERNEL Installd, adbd, servicemanger... System Server Zygote App 1 , App 2 …App N INIT
  • 17. A Typical Android Boot-Up KERNEL Installd, adbd, servicemanger... System Server Zygote App 1 , App 2 …App N INIT
  • 18. System Server  Heart of the Android System  Start system services  Register services with the service manager
  • 19. System Server Creates system context Start bootstrap services Start Other Services Start core services ActivityManagerService PackageManagerService WindowManagerService Wifi/Bluetooth Service SystemUI Loads server library
  • 20. System Server Creates system context Start bootstrap services Start Other Services Start core services ActivityManagerService PackageManagerService WindowManagerService Wifi/Bluetooth Service SystemUI Loads server library
  • 21. System Server Creates system context Start bootstrap services Start Other Services Start core services ActivityManagerService PackageManagerService WindowManagerService Wifi/Bluetooth Service SystemUI Loads server library
  • 22. System Server Creates system context Start bootstrap services Start Other Services Start core services ActivityManagerService PackageManagerService WindowManagerService Wifi/Bluetooth Service SystemUI Loads server library
  • 23. System Server Creates system context Start bootstrap services Start Other Services Start core services ActivityManagerService PackageManagerService WindowManagerService Wifi/Bluetooth Service SystemUI Loads server library
  • 24. System Server Creates system context Start bootstrap services Start Other Services Start core services ActivityManagerService PackageManagerService WindowManagerService Wifi/Bluetooth Service SystemUI Loads server library
  • 25. System Server Creates system context Start bootstrap services Start Other Services Start core services ActivityManagerService PackageManagerService WindowManagerService Wifi/Bluetooth Service SystemUI Loads server library
  • 26. System Server Creates system context Start bootstrap services Start Other Services Start core services ActivityManagerService PackageManagerService WindowManagerService Wifi/Bluetooth Service SystemUI Loads server library
  • 27. System Server Creates system context Start bootstrap services Start Other Services Start core services ActivityManagerService PackageManagerService WindowManagerService Wifi/Bluetooth Service SystemUI Loads server library
  • 28. Package Manager Service  Responsibilties :  Installation/Uninstallation of apps  Managing Permissions & Certificate Handling  Exposing APIs to 3rd party applications
  • 29. Package Manager Service(Flow) Scan Packages Grant Permissions Initialization Manifest Parsing Perform DexOpt Collect Certificates Generate Package Info Asset Loading
  • 30. Package Manager Service(Flow) Scan Packages Grant Permissions Initialization Manifest Parsing Perform DexOpt Collect Certificates Generate Package Info Asset Loading
  • 31. Package Manager Service(Flow) Scan Packages Grant Permissions Initialization Manifest Parsing Perform DexOpt Collect Certificates Generate Package Info Asset Loading
  • 32. Package Manager Service(Flow) Scan Packages Grant Permissions Initialization Manifest Parsing Perform DexOpt Collect Certificates Generate Package Info Asset Loading
  • 33. Package Manager Service(Flow) Scan Packages Grant Permissions Initialization Manifest Parsing Perform DexOpt Collect Certificates Generate Package Info Asset Loading
  • 34. Package Manager Service(Flow) Scan Packages Grant Permissions Initialization Manifest Parsing Perform DexOpt Collect Certificates Generate Package Info Asset Loading
  • 35. Package Manager Service(Flow) Scan Packages Grant Permissions Initialization Manifest Parsing Perform DexOpt Collect Certificates Generate Package Info Asset Loading
  • 36. Package Manager Service(Flow) Scan Packages Grant Permissions Initialization Manifest Parsing Perform DexOpt Collect Certificates Generate Package Info Asset Loading
  • 37. Package Manager Service(Flow) Scan Packages Grant Permissions Initialization Manifest Parsing Perform DexOpt Collect Certificates Generate Package Info Asset Loading
  • 38. Package Manager Service  Package information is cached into /data/system/packages.xml  Runtime permissions are cached into /data/system/0/runtime_packages.xml
  • 39. PackageIntsaller Offers the ability to install, upgrade, and remove applications on the device.
  • 40. PackageInstallerActivity  Launched when a new application is installed via side loading  Display parsing errors via a dialog.  Enable unknown applications setting.  Memory check  Check for same existing package  Install app
  • 41. Installd  PMS lacks root privileges  Creating , deleting & changing the ownership of applications directories requires superuser capabilities .  The PMS delegates these operations to the installd daemon
  • 42. A Quick Recap Native Daemons Zygote Launcher System Server Activity Manager Android Runtime Kernel Init
  • 43. A Quick Recap Native Daemons Zygote Launcher System Server Activity Manager Android Runtime Kernel - Initialization - Mount root FS - Starts Init Process Init
  • 44. A Quick Recap Native Daemons Zygote Launcher System Server Activity Manager Android Runtime Kernel Init - Set up env variables - Mount FS - Set UP FS perm - Start native daemons
  • 45. A Quick Recap Native Daemons - servicemanager - app_process -X Zygote - adbd - installd Zygote Launcher System Server Activity Manager Android Runtime Kernel Init
  • 46. A Quick Recap Native Daemons Zygote Launcher System Server Activity Manager Android Runtime - Start first VM - Call zygote’s main method Kernel Init
  • 47. A Quick Recap Native Daemons Zygote - Register Zygote socket - Preload classes & res. - Start systemserver process - Listen for connections Launcher System Server Activity Manager Android Runtime Kernel Init
  • 48. A Quick Recap Native Daemons Zygote Launcher System Server - Start services - Register with service manager Activity Manager Android Runtime Kernel Init
  • 49. A Quick Recap Native Daemons Zygote Launcher System Server Activity Manager - Init itself - Send Intent.Category_HOME - Send BOOT_COMPLETE Android Runtime Kernel Init
  • 50. A Quick Recap Native Daemons Zygote Launcher - Init itself - Register OnClick handlers System Server Activity Manager Android Runtime Kernel Init
  • 51. A Quick Recap Native Daemons Zygote Launcher System Server Activity Manager Android Runtime Kernel Init Click
  • 52. A Quick Recap Native Daemons Zygote Launcher System Server Activity Manager Android Runtime Kernel Init Click
  • 53. A Quick Recap Native Daemons Zygote Launcher System Server Activity Manager Android Runtime Kernel Init Click
  • 54. A Quick Recap Native Daemons Zygote Launcher System Server Activity Manager Android Runtime Kernel Init Click
  • 55. A Quick Recap Native Daemons - servicemanager - app_process -X Zygote - adbd - installd Zygote - Register Zygote socket - Preload classes & resources - Start systemserver process - Listen for connections Launcher - Init itself - Register OnClick handlers Click System Server - Start services - Register with servicemanager Activity Manager - Init itself - Send Intent.Category_HOME - Send BOOT_COMPLETE broadcast New app Android Runtime - Start first VM - Call zygote’s main method Kernel - Initialization - Mount root FS - Starts Init Process Init - Set up env variables - Mount FS - Set UP FS perm - Start native daemons
  • 56. THANK YOU  References :  Embedded Android – Karim Yaghmour  https://android.googlesource.com/ www.bangaloretechevents.com [email protected] Contact :