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

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
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -14613,6 +14613,13 @@ public class PackageManagerService extends IPackageManager.Stub
                            PACKAGE_MIME_TYPE);
                    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(),
                            android.Manifest.permission.PACKAGE_ROLLBACK_AGENT,
                            new BroadcastReceiver() {