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

Commit b6423d9d authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Require READ_PHONE_STATE for getSmsCapacityOnIcc() instead" am: 9780be3d

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1293936

Change-Id: I17b8a8d29dd3492ed448ae039bf022374f92ab11
parents c4aa34d7 9780be3d
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1365,10 +1365,12 @@ public class IccSmsInterfaceManager {
                0L /* messageId */);
    }

    public int getSmsCapacityOnIcc() {
        mContext.enforceCallingOrSelfPermission(
                android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
                "getSmsCapacityOnIcc");
    public int getSmsCapacityOnIcc(String callingPackage, String callingFeatureId) {
        if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
                mContext, mPhone.getSubId(), callingPackage, callingFeatureId,
                "getSmsCapacityOnIcc")) {
            return 0;
        }

        int numberOnIcc = 0;
        if (mPhone.getIccRecordsLoaded()) {
+1 −1
Original line number Diff line number Diff line
@@ -816,7 +816,7 @@ public class SmsController extends ISmsImplBase {
        IccSmsInterfaceManager iccSmsIntMgr = getIccSmsInterfaceManager(subId);

        if (iccSmsIntMgr != null ) {
            return iccSmsIntMgr.getSmsCapacityOnIcc();
            return iccSmsIntMgr.getSmsCapacityOnIcc(getCallingPackage(), null);
        } else {
            Rlog.e(LOG_TAG, "iccSmsIntMgr is null for " + " subId: " + subId);
            return 0;