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

Commit a5660a9f authored by Shuo Qian's avatar Shuo Qian Committed by Android (Google) Code Review
Browse files

Merge "Check calling identify for TelephonyPermission"

parents 96e92dbb 814bf472
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -604,9 +604,14 @@ public final class TelephonyPermissions {
    }

    private static int getCarrierPrivilegeStatus(Context context, int subId, int uid) {
        final long identity = Binder.clearCallingIdentity();
        try {
            TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(
                Context.TELEPHONY_SERVICE);
            return telephonyManager.createForSubscriptionId(subId).getCarrierPrivilegeStatus(uid);
        } finally {
            Binder.restoreCallingIdentity(identity);
        }
    }

    /**