Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Snippets Groups Projects
Commit ccf4759c authored by Richard Uhler's avatar Richard Uhler
Browse files

Allow ENABLE_ROLLBACK broadcast to be sent before boot complete.

This is needed in the case when we commit the apk session for a staged
session post reboot. The rollback manager registers its receiver early
enough that it will not miss the broadcast.

Bug: 112431924
Test: adb install-multi-package --staged --enable-rollback \
        com.android.tests.rollback.testapex.RollbackTestApexV2.apex \
        RollbackTestAppAv2.apk ; adb reboot

Change-Id: If070633d761ec673f1dd2753cbb359ca31e53b9c
parent 8e6dc3b7
Branches
No related tags found
No related merge requests found
...@@ -14613,6 +14613,13 @@ public class PackageManagerService extends IPackageManager.Stub ...@@ -14613,6 +14613,13 @@ public class PackageManagerService extends IPackageManager.Stub
PACKAGE_MIME_TYPE); PACKAGE_MIME_TYPE);
enableRollbackIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); enableRollbackIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
   
// Allow the broadcast to be sent before boot complete.
// This is needed when committing the apk part of a staged
// session in early boot. The rollback manager registers
// its receiver early enough during the boot process that
// it will not miss the broadcast.
enableRollbackIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
mContext.sendOrderedBroadcastAsUser(enableRollbackIntent, getUser(), mContext.sendOrderedBroadcastAsUser(enableRollbackIntent, getUser(),
android.Manifest.permission.PACKAGE_ROLLBACK_AGENT, android.Manifest.permission.PACKAGE_ROLLBACK_AGENT,
new BroadcastReceiver() { new BroadcastReceiver() {
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment