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

Commit 42fae81a authored by Taesu Lee's avatar Taesu Lee Committed by Amit Mahajan
Browse files

Require READ_PHONE_STATE for getSmsCapacityOnIcc() instead



Check whether the caller can read phone state for getSmsCapacityOnIcc().

Bug: 154878196
Test: Manual

Signed-off-by: default avatarTaesu Lee <taesu82.lee@samsung.com>
Merged-in: If403a4ba557e4322b25607c478b109e58a0e3ae9
Change-Id: If403a4ba557e4322b25607c478b109e58a0e3ae9
parent 3a91416e
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1402,10 +1402,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;