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

Commit 9342ce8f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add work profile support for registering phone accounts with Telecom"

parents b6ac35c9 88253621
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -2527,7 +2527,9 @@ public class TelecomServiceImpl {

    private void enforceUserHandleMatchesCaller(PhoneAccountHandle accountHandle) {
        if (!Binder.getCallingUserHandle().equals(accountHandle.getUserHandle())) {
            throw new SecurityException("Calling UserHandle does not match PhoneAccountHandle's");
            // Enforce INTERACT_ACROSS_USERS if the calling user handle does not match
            // phone account's user handle
            enforceInAppCrossUserPermission();
        }
    }

@@ -2546,6 +2548,12 @@ public class TelecomServiceImpl {
        }
    }

    private void enforceInAppCrossUserPermission() {
        mContext.enforceCallingOrSelfPermission(
                android.Manifest.permission.INTERACT_ACROSS_USERS, "Must be system or have"
                        + " INTERACT_ACROSS_USERS permission");
    }

    // to be used for TestApi methods that can only be called with SHELL UID.
    private void enforceShellOnly(int callingUid, String message) {
        if (callingUid == Process.SHELL_UID || callingUid == Process.ROOT_UID) {