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

Commit bd7c5f2f 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

Change-Id: I2d05c0d86b9aaf148941665d4fa4bf06ba5fb128
parents 8b69e60c 1c8d32b3
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -1954,6 +1954,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);