Loading services/core/java/com/android/server/pm/BroadcastHelper.java +17 −5 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.server.pm; import static android.os.PowerExemptionManager.REASON_LOCKED_BOOT_COMPLETED; import static android.os.PowerExemptionManager.TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_ALLOWED; import static android.safetylabel.SafetyLabelConstants.PERMISSION_RATIONALE_ENABLED; import static android.safetylabel.SafetyLabelConstants.SAFETY_LABEL_CHANGE_NOTIFICATIONS_ENABLED; import static com.android.server.pm.PackageManagerService.DEBUG_INSTALL; import static com.android.server.pm.PackageManagerService.PACKAGE_SCHEME; Loading @@ -42,6 +44,7 @@ import android.os.Bundle; import android.os.PowerExemptionManager; import android.os.RemoteException; import android.os.UserHandle; import android.provider.DeviceConfig; import android.util.IntArray; import android.util.Log; import android.util.Pair; Loading Loading @@ -335,12 +338,14 @@ public final class BroadcastHelper { broadcastAllowlist, null /* filterExtrasForReceiver */, null); // Send to PermissionController for all new users, even if it may not be running for some // users if (isPrivacySafetyLabelChangeNotificationsEnabled()) { 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, int[] userIds, int[] instantUserIds) { Loading Loading @@ -384,6 +389,13 @@ public final class BroadcastHelper { return filteredExtras; } /** Returns whether the Safety Label Change notification, a privacy feature, is enabled. */ public static boolean isPrivacySafetyLabelChangeNotificationsEnabled() { return DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_PRIVACY, SAFETY_LABEL_CHANGE_NOTIFICATIONS_ENABLED, false) && DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_PRIVACY, PERMISSION_RATIONALE_ENABLED, false); } @NonNull private static Pair<String[], int[]> filterPackages(@NonNull Computer snapshot, @NonNull String[] pkgs, @Nullable int[] uids, int callingUid, int userId) { Loading services/core/java/com/android/server/pm/InstallPackageHelper.java +6 −4 Original line number Diff line number Diff line Loading @@ -2857,10 +2857,12 @@ final class InstallPackageHelper { } // Send to PermissionController for all update users, even if it may not be running // for some users if (BroadcastHelper.isPrivacySafetyLabelChangeNotificationsEnabled()) { 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( Loading Loading
services/core/java/com/android/server/pm/BroadcastHelper.java +17 −5 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.server.pm; import static android.os.PowerExemptionManager.REASON_LOCKED_BOOT_COMPLETED; import static android.os.PowerExemptionManager.TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_ALLOWED; import static android.safetylabel.SafetyLabelConstants.PERMISSION_RATIONALE_ENABLED; import static android.safetylabel.SafetyLabelConstants.SAFETY_LABEL_CHANGE_NOTIFICATIONS_ENABLED; import static com.android.server.pm.PackageManagerService.DEBUG_INSTALL; import static com.android.server.pm.PackageManagerService.PACKAGE_SCHEME; Loading @@ -42,6 +44,7 @@ import android.os.Bundle; import android.os.PowerExemptionManager; import android.os.RemoteException; import android.os.UserHandle; import android.provider.DeviceConfig; import android.util.IntArray; import android.util.Log; import android.util.Pair; Loading Loading @@ -335,12 +338,14 @@ public final class BroadcastHelper { broadcastAllowlist, null /* filterExtrasForReceiver */, null); // Send to PermissionController for all new users, even if it may not be running for some // users if (isPrivacySafetyLabelChangeNotificationsEnabled()) { 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, int[] userIds, int[] instantUserIds) { Loading Loading @@ -384,6 +389,13 @@ public final class BroadcastHelper { return filteredExtras; } /** Returns whether the Safety Label Change notification, a privacy feature, is enabled. */ public static boolean isPrivacySafetyLabelChangeNotificationsEnabled() { return DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_PRIVACY, SAFETY_LABEL_CHANGE_NOTIFICATIONS_ENABLED, false) && DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_PRIVACY, PERMISSION_RATIONALE_ENABLED, false); } @NonNull private static Pair<String[], int[]> filterPackages(@NonNull Computer snapshot, @NonNull String[] pkgs, @Nullable int[] uids, int callingUid, int userId) { Loading
services/core/java/com/android/server/pm/InstallPackageHelper.java +6 −4 Original line number Diff line number Diff line Loading @@ -2857,10 +2857,12 @@ final class InstallPackageHelper { } // Send to PermissionController for all update users, even if it may not be running // for some users if (BroadcastHelper.isPrivacySafetyLabelChangeNotificationsEnabled()) { 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( Loading