The functions of the PackageManager and PackageManagerSrvice were discussed in section I. Additionally highlighted was the significance of starting PackageManagerService as a critical system service during boot. We’ll now review their internal structure and communication methods.
The Package Manager internals:
- PackageManager:
Provides methods to retrieve and interact with the installed package list and associated data. - PackageInfo:
It holds information about a particular package currently installed on the device. - ApplicationInfo:
It holds information about an application that is currently installed on the device. - ResolveInfo:
It contains information needed to decide how to implement the functionality of a particular Intent. - PermissionInfo:
Holds information about a particular system permission. - PermissionGroupInfo:
Holds information about a particular system permission group. - ServiceInfo:
Holds information about a specific service that is part of an application. - ActivityInfo:
Holds information about a specific activity that is part of an application. - ProviderInfo:
Holds information about a specific content provider that is part of an application. - FeatureInfo:
Represents a particular feature of the device’s software or hardware. - Signature:
Represents the digital signature of an application. - PathPermission:
Description of permissions needed to access a particular path in a ProviderInfo. - ComponentInfo:
Base class containing common data for ActivityInfo, ServiceInfo, and ProviderInfo. - PackageItemInfo:
Base class containing common data for ComponentInfo, PermissionInfo, PermissionGroupInfo, and PackageInfo. - LabeledIntent:
Specialization of Intent that can hold label and icon information. - InstrumentationInfo:
Holds information about a specific instrumentation that is part of an application.
Some Notes on PackageManager
- Manages Installation, Uninstallation, And Updates Of Applications. PackageManager Is The Primary Class Responsible For These Tasks.
- Retrieves Information About Installed Packages And Applications. PackageManager, PackageInfo, And ApplicationInfo Classes Are Involved In Retrieving This Information.
- Verifies Permissions And Shares Permissions Across Apps. PackageManager Checks Permissions When Required. PermissionInfo And PermissionGroupInfo Classes Are Used To Store Information About Permissions.
- Manages Application Signing Certificates. PackageManager And Signature Classes Handle The Signing Certificates Of Applications.
- Manages Application Components. ActivityInfo, ServiceInfo, And ProviderInfo Classes Hold Information About Application Components. They Are Managed By The PackageManager Class.
- Manages Features Of The Device That Affect Compatibility With Applications. FeatureInfo Class Holds Information About The Device’s Software Or Hardware Features, And PackageManager Class Provides Methods To Retrieve This Information.
- Provides Querying Capabilities For Installed Apps, Services, Activities, Etc. PackageManager Class Provides Methods For Querying This Information.
- Resolves Intent Filters To Find The Component That Should Handle An Intent. PackageManager And ResolveInfo Classes Are Used To Resolve Intents To Appropriate Components.
- Handles Shared Libraries And Shared User IDs Between Apps. PackageManager And ApplicationInfo Classes Manage Shared Libraries And User IDs
![](https://aospinsight.com/wp-content/uploads/2023/07/PackageManager-Diagram-1024x464.png)
To reduce the complexity of the diagram only the essential information is added.
Hope nothing has been missed 🙂