InstallerService
This merge request mainly introduces the InstallerService. Many files have been touched and reworked in this merge request, due to the following changes:
- After download of an apk in
InstallManagerService, theInstallerServiceis started an kicks off the installation process. For unattended installers this directly runs through without any user interaction, for the default installer a new PendingIntent containingDefaultActivityInstalleris returned that is either stuffed into the notification or directly started fromAppDetails - Using local broadcasts,
InstallManagerServiceandAppDetailsare informed of state changes in the installation process -
DefaultActivityInstalleris a wrapper around the default installation APIs of Android - If the unattended
PrivilegedInstalleris available, a permission screen is shown before download - Actual error codes and messages are displayed in notification or dialog on fail, especially interesting when using the
PrivilegedInstaller - The process for installing the Privileged Extension has been moved into an own installer for logic seperation, called
ExtensionInstaller
Some design considerations:
- I try to use Uris where ever possible. At some points this clashes with the usage of
urlStringinInstallManagerService. This could be fixed in a later merge request
Some other TODOs are left, but I would like to do them after this merge request has been merged if it's okay, as this one is already too huge:
- Check if apk permissions are the same as announced in the permission screen for
PrivilegedInstaller - In
Installer.newPermissionCount(), I need the target SDK before download to check if it's targetting Android M, which does not require the permission screen - Introduce FileProvider for Android N
- Redesign layout of
InstallConfirmActivity - Remove "cancel" icon for installing progress in AppDetails