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

Commit 47e8d3a7 authored by Steven Liu's avatar Steven Liu Committed by Android (Google) Code Review
Browse files

Merge "Decouple the carrier key with data SIM"

parents c3b96dc0 f4f8b78a
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -57,18 +57,16 @@ public class CarrierInfoManager {
     *         used for encryption.
     */
    public static ImsiEncryptionInfo getCarrierInfoForImsiEncryption(int keyType,
                                                                     Context context) {
                                                                     Context context,
                                                                     String operatorNumeric) {
        String mcc = "";
        String mnc = "";
        final TelephonyManager telephonyManager =
                (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
        String simOperator = telephonyManager.getSimOperator();
        if (!TextUtils.isEmpty(simOperator)) {
            mcc = simOperator.substring(0, 3);
            mnc = simOperator.substring(3);
        if (!TextUtils.isEmpty(operatorNumeric)) {
            mcc = operatorNumeric.substring(0, 3);
            mnc = operatorNumeric.substring(3);
            Log.i(LOG_TAG, "using values for mnc, mcc: " + mnc + "," + mcc);
        } else {
            Log.e(LOG_TAG, "Invalid networkOperator: " + simOperator);
            Log.e(LOG_TAG, "Invalid networkOperator: " + operatorNumeric);
            return null;
        }
        Cursor findCursor = null;
+4 −1
Original line number Diff line number Diff line
@@ -1688,7 +1688,10 @@ public class GsmCdmaPhone extends Phone {

    @Override
    public ImsiEncryptionInfo getCarrierInfoForImsiEncryption(int keyType) {
        return CarrierInfoManager.getCarrierInfoForImsiEncryption(keyType, mContext);
        String operatorNumeric = TelephonyManager.from(mContext)
                .getSimOperatorNumericForPhone(mPhoneId);
        return CarrierInfoManager.getCarrierInfoForImsiEncryption(keyType,
                mContext, operatorNumeric);
    }

    @Override