Revert "Ignores protected broadcasts if not priv-app"

Revert of I5bd2bf3bd7c38fd9cc563a02b24bc569495d79ed

For now, allow all system apps to declare protected
broadcasts. This will be cleaned up in a future change.

Bug: 158570769

Merged-In: I54d236c0a6daaa934bd64a3bd05e2654e0e868fe
Change-Id: I54d236c0a6daaa934bd64a3bd05e2654e0e868fe
This commit is contained in:
Winson Chiu
2020-06-16 21:41:22 +00:00
parent 03f7e9d6fc
commit b5e3addc5f

View File

@@ -10837,6 +10837,8 @@ public class PackageManagerService extends IPackageManager.Stub
~ApplicationInfo.PRIVATE_FLAG_DEFAULT_TO_DEVICE_PROTECTED_STORAGE;
pkg.applicationInfo.privateFlags &=
~ApplicationInfo.PRIVATE_FLAG_DIRECT_BOOT_AWARE;
// clear protected broadcasts
pkg.protectedBroadcasts = null;
// cap permission priorities
if (pkg.permissionGroups != null && pkg.permissionGroups.size() > 0) {
for (int i = pkg.permissionGroups.size() - 1; i >= 0; --i) {
@@ -10845,8 +10847,6 @@ public class PackageManagerService extends IPackageManager.Stub
}
}
if ((scanFlags & SCAN_AS_PRIVILEGED) == 0) {
// clear protected broadcasts
pkg.protectedBroadcasts = null;
// ignore export request for single user receivers
if (pkg.receivers != null) {
for (int i = pkg.receivers.size() - 1; i >= 0; --i) {