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:
Provides methods to retrieve and interact with the installed package list and associated data.
It holds information about a particular package currently installed on the device.
It holds information about an application that is currently installed on the device.
It contains information needed to decide how to implement the functionality of a particular Intent.
Holds information about a particular system permission.
Holds information about a particular system permission group.
Holds information about a specific service that is part of an application.
Holds information about a specific activity that is part of an application.
Holds information about a specific content provider that is part of an application.
Represents a particular feature of the device’s software or hardware.
Represents the digital signature of an application.
Description of permissions needed to access a particular path in a ProviderInfo.
Base class containing common data for ActivityInfo, ServiceInfo, and ProviderInfo.
Base class containing common data for ComponentInfo, PermissionInfo, PermissionGroupInfo, and PackageInfo.
Specialization of Intent that can hold label and icon information.
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
To reduce the complexity of the diagram only the essential information is added.
Hope nothing has been missed 🙂