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

Commit f4d8c9f0 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Decouple the carrier key with data SIM" am: 43fd895d am: f3aa980e

Change-Id: I7f8c537512a26ffeb9436f104e4073c504a5e363
parents 68802fa8 f3aa980e
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
@@ -1694,7 +1694,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