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

Commit e848012c authored by Meng Wang's avatar Meng Wang Committed by Gerrit Code Review
Browse files

Merge "getCarrierInfoForImsiEncryption requires READ_PRIVILEGED_PHONE_STATE permission"

parents 7c03f28f 9287785e
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub {

    public ImsiEncryptionInfo getCarrierInfoForImsiEncryption(int subId, int keyType,
                                                              String callingPackage) {
        return callPhoneMethodForSubIdWithReadCheck(subId, callingPackage,
        return callPhoneMethodForSubIdWithPrivilegedCheck(subId,
                "getCarrierInfoForImsiEncryption",
                (phone)-> phone.getCarrierInfoForImsiEncryption(keyType));
    }
@@ -103,14 +103,13 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub {
     */
    public void resetCarrierKeysForImsiEncryption(int subId, String callingPackage) {
        callPhoneMethodForSubIdWithModifyCheck(subId, callingPackage,
                "setCarrierInfoForImsiEncryption",
                "resetCarrierKeysForImsiEncryption",
                (phone)-> {
                    phone.resetCarrierKeysForImsiEncryption();
                    return null;
                });
    }


    public String getDeviceSvn(String callingPackage) {
        return getDeviceSvnUsingSubId(getDefaultSubscription(), callingPackage);
    }
@@ -434,7 +433,6 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub {
                                aContext, aSubId, aCallingPackage, aMessage));
    }


    private <T> T callPhoneMethodForSubIdWithPrivilegedCheck(
            int subId, String message, CallPhoneMethodHelper<T> callMethodHelper) {
        return callPhoneMethodWithPermissionCheck(subId, null, message, callMethodHelper,