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

Commit 173376df authored by Songchun Fan's avatar Songchun Fan
Browse files

[pm] fix broadcast permission check for instant apps

ACCESS_INSTANT_APPS permission check was ignored by mistake.

BUG: 224547584
Test: manual (will try to reproduce on T)
Change-Id: Ibd0d3da78f0a32c85d2aad7de83cb91e1453b6a2
parent 3057f825
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import static android.os.PowerExemptionManager.REASON_LOCKED_BOOT_COMPLETED;
import static android.os.PowerExemptionManager.TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_ALLOWED;

import static com.android.server.pm.PackageManagerService.DEBUG_INSTALL;
import static com.android.server.pm.PackageManagerService.EMPTY_INT_ARRAY;
import static com.android.server.pm.PackageManagerService.PACKAGE_SCHEME;
import static com.android.server.pm.PackageManagerService.PLATFORM_PACKAGE_NAME;
import static com.android.server.pm.PackageManagerService.TAG;
@@ -86,11 +85,14 @@ public final class BroadcastHelper {
            } else {
                resolvedUserIds = userIds;
            }

            if (ArrayUtils.isEmpty(instantUserIds)) {
                doSendBroadcast(action, pkg, extras, flags, targetPkg, finishedReceiver,
                    resolvedUserIds, false, broadcastAllowList, bOptions);
            if (instantUserIds != null && instantUserIds != EMPTY_INT_ARRAY) {
                        resolvedUserIds, false /* isInstantApp */, broadcastAllowList, bOptions);
            } else {
                // send restricted broadcasts for instant apps
                doSendBroadcast(action, pkg, extras, flags, targetPkg, finishedReceiver,
                        instantUserIds, true, null, bOptions);
                        instantUserIds, true /* isInstantApp */, null, bOptions);
            }
        } catch (RemoteException ex) {
        }