Pms start process and pms Start Process
1. Start PackageManagerService. main in SystemServer
2. newPackageManagerService () and add it to ServiceManager
3. newinstaller (establish a socket connection between installer and installd, and finally implement install, remove, dexopt, and other functions at the underlying layer)
4. Get information in the xml file through systemConfig
5. Create PackageHandler Message logoff (installation/uninstall request)
6. readPLW () (read data/system/packages. xml)
7.
Check whether the customized library in/system/etc/permissions/platform. xml and jar files under/system/framework need dex extraction for optimization.
If optimization is required, the installer. dexopt is called to extract dex to/data/dalvik-cache.
8. Call scanDirLI to scan the directories where the apk is stored.
9. Install the system application-use scanPackageLI to parse the AndroidManifest. xml file one by one, create the configuration structure of each apk, and add the apk configuration information to the global list for management.
10. Call writeLPr () to write the apk information from the global list to packages. xml and packages. list.