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

Commit b08c2ea8 authored by Gavin Corkery's avatar Gavin Corkery Committed by android-build-merger
Browse files

Merge "Don't send session committed broadcast for dry runs" into qt-qpr1-dev am: 15040587

am: 86ff03b8

Change-Id: I71fa540e28fc8cf4491c640ab57edcc0f5e1eb46
parents abc5716a 86ff03b8
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -2213,8 +2213,10 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
        final boolean success = (returnCode == PackageManager.INSTALL_SUCCEEDED);
        final boolean success = (returnCode == PackageManager.INSTALL_SUCCEEDED);


        // Send broadcast to default launcher only if it's a new install
        // Send broadcast to default launcher only if it's a new install
        // TODO(b/144270665): Secure the usage of this broadcast.
        final boolean isNewInstall = extras == null || !extras.getBoolean(Intent.EXTRA_REPLACING);
        final boolean isNewInstall = extras == null || !extras.getBoolean(Intent.EXTRA_REPLACING);
        if (success && isNewInstall && mPm.mInstallerService.okToSendBroadcasts()) {
        if (success && isNewInstall && mPm.mInstallerService.okToSendBroadcasts()
                && (params.installFlags & PackageManager.INSTALL_DRY_RUN) == 0) {
            mPm.sendSessionCommitBroadcast(generateInfo(), userId);
            mPm.sendSessionCommitBroadcast(generateInfo(), userId);
        }
        }