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

Commit 8b0bdf58 authored by Shuo Qian's avatar Shuo Qian Committed by android-build-merger
Browse files

Merge "Check permission for SubscriptionController.isActiveSubId" am: bd394035 am: 1c8d32b3

am: bd7c5f2f

Change-Id: Ifb08af4dc726a71f25a5d246df828ff1d7cb4937
parents 49bb90b4 bd7c5f2f
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -1939,6 +1939,20 @@ public class SubscriptionController extends ISub.Stub {
    }

    @Override
    public boolean isActiveSubId(int subId, String callingPackage) {
        if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mContext, subId, callingPackage,
              "isActiveSubId")) {
            throw new SecurityException("Requires READ_PHONE_STATE permission.");
        }
        final long identity = Binder.clearCallingIdentity();
        try {
            return isActiveSubId(subId);
        } finally {
            Binder.restoreCallingIdentity(identity);
        }
    }

    @Deprecated // This should be moved into isActiveSubId(int, String)
    public boolean isActiveSubId(int subId) {
        boolean retVal = SubscriptionManager.isValidSubscriptionId(subId)
                && getActiveSubIdArrayList().contains(subId);