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

Commit 2b3af802 authored by Nathan Harold's avatar Nathan Harold Committed by Android (Google) Code Review
Browse files

Merge "Allow canPackageManageGroup for new groups" into qt-dev

parents 70fc386e 24e64372
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -2934,8 +2934,10 @@ public class SubscriptionController extends ISub.Stub {
            Binder.restoreCallingIdentity(identity);
        }

        // If the group does not exist, then by default the UUID is up for grabs so no need to
        // restrict management of a group (that someone may be attempting to create).
        if (ArrayUtils.isEmpty(infoList)) {
            throw new IllegalArgumentException("No subscription in group " + groupUuid);
            return true;
        }

        // If the calling package is the group owner, skip carrier permission check and return
@@ -2977,6 +2979,12 @@ public class SubscriptionController extends ISub.Stub {
            throw new IllegalArgumentException("Invalid groupUuid");
        }

        // TODO: Revisit whether we need this restriction in R. There's no technical need for it,
        // but we don't want to change the API behavior at this time.
        if (getSubscriptionsInGroup(groupUuid, callingPackage).isEmpty()) {
            throw new IllegalArgumentException("Cannot add subscriptions to a non-existent group!");
        }

        // Makes sure calling package matches caller UID.
        mAppOps.checkPackage(Binder.getCallingUid(), callingPackage);
        // If it doesn't have modify phone state permission, or carrier privilege permission,