SlideShare a Scribd company logo
1 of 56
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 :

More Related Content

What's hot

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 debuggingUtkarsh Mankad
 
Android graphic system (SurfaceFlinger) : Design Pattern's perspective
Android graphic system (SurfaceFlinger) : Design Pattern's perspectiveAndroid graphic system (SurfaceFlinger) : Design Pattern's perspective
Android graphic system (SurfaceFlinger) : Design Pattern's perspectiveBin Chen
 
Overview of Android binder IPC implementation
Overview of Android binder IPC implementationOverview of Android binder IPC implementation
Overview of Android binder IPC implementationChethan Pchethan
 
Android Binder IPC for Linux
Android Binder IPC for LinuxAndroid Binder IPC for Linux
Android Binder IPC for LinuxYu-Hsin Hung
 
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.
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverNanik Tolaram
 
Understaing Android EGL
Understaing Android EGLUnderstaing Android EGL
Understaing Android EGLSuhan Lee
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting SequenceJayanta Ghoshal
 
Android Storage - Vold
Android Storage - VoldAndroid Storage - Vold
Android Storage - VoldWilliam Lee
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux DevelopersOpersys inc.
 

What's hot (20)

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
 
Init of Android
Init of AndroidInit of Android
Init of Android
 
Android graphic system (SurfaceFlinger) : Design Pattern's perspective
Android graphic system (SurfaceFlinger) : Design Pattern's perspectiveAndroid graphic system (SurfaceFlinger) : Design Pattern's perspective
Android graphic system (SurfaceFlinger) : Design Pattern's perspective
 
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
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
 
Overview of Android binder IPC implementation
Overview of Android binder IPC implementationOverview of Android binder IPC implementation
Overview of Android binder IPC implementation
 
Explore Android Internals
Explore Android InternalsExplore Android Internals
Explore Android Internals
 
Android Binder IPC for Linux
Android Binder IPC for LinuxAndroid Binder IPC for Linux
Android Binder IPC for Linux
 
Deep Dive into the AOSP
Deep Dive into the AOSPDeep Dive into the AOSP
Deep Dive into the AOSP
 
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)
 
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...
 
Binder: Android IPC
Binder: Android IPCBinder: Android IPC
Binder: Android IPC
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
 
Understaing Android EGL
Understaing Android EGLUnderstaing Android EGL
Understaing Android EGL
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting Sequence
 
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)
 
Android 10
Android 10Android 10
Android 10
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Android Storage - Vold
Android Storage - VoldAndroid Storage - Vold
Android Storage - Vold
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 

Similar to Android internals By Rajesh Khetan

Install VMWare Tools CentOS 7
Install VMWare Tools CentOS 7Install VMWare Tools CentOS 7
Install VMWare Tools CentOS 7VCP Muthukrishna
 
Interview questions
Interview questionsInterview questions
Interview questionsxavier 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 ReportersHaitham Refaat
 
Word press, the automated way
Word press, the automated wayWord press, the automated way
Word press, the automated wayMichaël Perrin
 
Front end workflow with yeoman
Front end workflow with yeomanFront end workflow with yeoman
Front end workflow with yeomanhassan hafez
 
OpenStack Murano introduction
OpenStack Murano introductionOpenStack Murano introduction
OpenStack Murano introductionVictor Zhang
 
Continuous Integration using Cruise Control
Continuous Integration using Cruise ControlContinuous Integration using Cruise Control
Continuous Integration using Cruise Controlelliando 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 systemPaulWay
 
Systemd for administrators
Systemd for administratorsSystemd for administrators
Systemd for administratorsSusant Sahani
 
Systemd for administrators
Systemd for administratorsSystemd for administrators
Systemd for administratorsSusant 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 WorkflowsAOE
 
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 HackerStacy Devino
 
3 App Compat Win7
3 App Compat Win73 App Compat Win7
3 App Compat Win7llangit
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy Systemadrian_nye
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011pundiramit
 
Android. behind the scenes_programatica 2012
Android. behind the scenes_programatica 2012Android. behind the scenes_programatica 2012
Android. behind the scenes_programatica 2012Agora Group
 
Getting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated VersionGetting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated VersionCFEngine
 
Automação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOpsAutomação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOpsRaul Leite
 

Similar to Android internals By Rajesh Khetan (20)

Installation
InstallationInstallation
Installation
 
Install VMWare Tools CentOS 7
Install VMWare Tools CentOS 7Install VMWare Tools CentOS 7
Install VMWare Tools CentOS 7
 
Interview questions
Interview questionsInterview questions
Interview questions
 
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
 
Word press, the automated way
Word press, the automated wayWord press, the automated way
Word press, the automated way
 
Front end workflow with yeoman
Front end workflow with yeomanFront end workflow with yeoman
Front end workflow with yeoman
 
OpenStack Murano introduction
OpenStack Murano introductionOpenStack Murano introduction
OpenStack Murano introduction
 
Continuous Integration using Cruise Control
Continuous Integration using Cruise ControlContinuous Integration using Cruise Control
Continuous Integration using Cruise Control
 
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
 
Systemd for administrators
Systemd for administratorsSystemd for administrators
Systemd for administrators
 
Systemd for administrators
Systemd for administratorsSystemd for administrators
Systemd for administrators
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
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
 
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
 
3 App Compat Win7
3 App Compat Win73 App Compat Win7
3 App Compat Win7
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011
 
Android. behind the scenes_programatica 2012
Android. behind the scenes_programatica 2012Android. behind the scenes_programatica 2012
Android. behind the scenes_programatica 2012
 
Getting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated VersionGetting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated Version
 
Automação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOpsAutomação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOps
 

Recently uploaded

CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceanilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceanilsa9823
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7Pooja Nehwal
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...wyqazy
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Pooja Nehwal
 
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Niamh verma
 

Recently uploaded (7)

CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
 
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
 

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 rajeshkhetan.rk@gmail.com Contact :