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

Commit 4c8de7a6 authored by Todd Kennedy's avatar Todd Kennedy
Browse files

Send broadcast to verifier

If the installer-of-record isn't the verifier, send package added
broadcasts to the verifier

Bug: 80099235
Test: Manual; install an application from 'adb' with an installer-of-record that's the verifier, see that only one broadcast is sent to the installer
Test: Manual; install an application from 'adb' with an installer-of-record that's not the verifier. see that two broadcasts are sent -- one to the installer-of-record and one to the verifier
Change-Id: I2a0ce35b5b1c21fe3f735cbb3cdbd9d42b596523
parent 98c2f7f9
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -2072,6 +2072,16 @@ public class PackageManagerService extends IPackageManager.Stub
                            installerPackageName, null /*finishedReceiver*/,
                            updateUserIds, instantUserIds);
                }
                // if the required verifier is defined, but, is not the installer of record
                // for the package, it gets notified
                final boolean notifyVerifier = mRequiredVerifierPackage != null
                        && !mRequiredVerifierPackage.equals(installerPackageName);
                if (notifyVerifier) {
                    sendPackageBroadcast(Intent.ACTION_PACKAGE_ADDED, packageName,
                            extras, 0 /*flags*/,
                            mRequiredVerifierPackage, null /*finishedReceiver*/,
                            updateUserIds, instantUserIds);
                }
                // Send replaced for users that don't see the package for the first time
                if (update) {
@@ -2085,6 +2095,12 @@ public class PackageManagerService extends IPackageManager.Stub
                                installerPackageName, null /*finishedReceiver*/,
                                updateUserIds, instantUserIds);
                    }
                    if (notifyVerifier) {
                        sendPackageBroadcast(Intent.ACTION_PACKAGE_REPLACED, packageName,
                                extras, 0 /*flags*/,
                                mRequiredVerifierPackage, null /*finishedReceiver*/,
                                updateUserIds, instantUserIds);
                    }
                    sendPackageBroadcast(Intent.ACTION_MY_PACKAGE_REPLACED,
                            null /*package*/, null /*extras*/, 0 /*flags*/,
                            packageName /*targetPackage*/,