Revert "Applying package visibility rules to the broadcast of overlay changed"

This reverts commit 91a53a8910.

Reason for revert: b/243114298, regression of BootTimeTest

Change-Id: I7966bc32b23fa12072500f4d62c606bf9e2433ae
This commit is contained in:
Rhed Jao
2022-08-23 03:47:09 +00:00
parent 91a53a8910
commit ae978dfc1c

View File

@@ -39,7 +39,6 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.UserIdInt;
import android.app.ActivityManager;
import android.app.ActivityManagerInternal;
import android.app.IActivityManager;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -1417,18 +1416,16 @@ public final class OverlayManagerService extends SystemService {
private static void broadcastActionOverlayChanged(@NonNull final Set<String> targetPackages,
final int userId) {
final PackageManagerInternal pmInternal =
LocalServices.getService(PackageManagerInternal.class);
final ActivityManagerInternal amInternal =
LocalServices.getService(ActivityManagerInternal.class);
CollectionUtils.forEach(targetPackages, target -> {
final Intent intent = new Intent(ACTION_OVERLAY_CHANGED,
Uri.fromParts("package", target, null));
intent.setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
final int[] allowList = pmInternal.getVisibilityAllowList(target, userId);
amInternal.broadcastIntent(intent, null /* resultTo */, null /* requiredPermissions */,
false /* serialized */, userId, allowList, null /* filterExtrasForReceiver */,
null /* bOptions */);
try {
ActivityManager.getService().broadcastIntent(null, intent, null, null, 0, null,
null, null, android.app.AppOpsManager.OP_NONE, null, false, false, userId);
} catch (RemoteException e) {
Slog.e(TAG, "broadcastActionOverlayChanged remote exception", e);
}
});
}