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

Commit 26894da4 authored by Nathan Harold's avatar Nathan Harold Committed by Gerrit Code Review
Browse files

Merge "Allow canPackageManageGroup for new groups"

parents 69715225 c7a7913a
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -2920,8 +2920,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
@@ -2963,6 +2965,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,