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

Commit 814bf472 authored by Shuo Qian's avatar Shuo Qian
Browse files

Check calling identify for TelephonyPermission

Test: Treehugger; Request App compat testing run
Bug: 145688189
Bug: 146213832

Change-Id: If3adcd17916be2e81497061120d1f350bfb8026d
parent ab837049
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);
        }
    }

    /**