Skip to content
Snippets Groups Projects
Commit cb711681 authored by William Loh's avatar William Loh
Browse files

Send explicit broadcast to PC on package installs

Send ACTION_PACKAGE_ADDED broadcasts to PermissionController for all
users to support tracking safety label changes.

Bug: 261661975
Test: manually install test package and check logs for broadcasts
Change-Id: I180885c9a95e7bdeb1a7f25d565dea5aa180f53a
parent 28a98ce9
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,6 @@ import android.util.SparseArray;
import com.android.internal.util.ArrayUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.function.BiFunction;
import java.util.function.Supplier;
......@@ -334,6 +333,13 @@ public final class BroadcastHelper {
sendPackageBroadcast(Intent.ACTION_PACKAGE_ADDED,
packageName, extras, 0, null, null, userIds, instantUserIds,
broadcastAllowlist, null /* filterExtrasForReceiver */, null);
// Send to PermissionController for all new users, even if it may not be running for some
// users
sendPackageBroadcast(Intent.ACTION_PACKAGE_ADDED,
packageName, extras, 0,
mContext.getPackageManager().getPermissionControllerPackageName(),
null, userIds, instantUserIds,
broadcastAllowlist, null /* filterExtrasForReceiver */, null);
}
public void sendFirstLaunchBroadcast(String pkgName, String installerPkg,
......
......@@ -2731,6 +2731,12 @@ final class InstallPackageHelper {
installerPackageName, null /*finishedReceiver*/,
updateUserIds, instantUserIds, null /* broadcastAllowList */, null);
}
// Send to PermissionController for all update users, even if it may not be running
// for some users
mPm.sendPackageBroadcast(Intent.ACTION_PACKAGE_ADDED, packageName,
extras, 0 /*flags*/,
mPm.mRequiredPermissionControllerPackage, null /*finishedReceiver*/,
updateUserIds, instantUserIds, null /* broadcastAllowList */, null);
// Notify required verifier(s) that are not the installer of record for the package.
for (String verifierPackageName : mPm.mRequiredVerifierPackages) {
if (verifierPackageName != null && !verifierPackageName.equals(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment