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

Commit bf87c9e7 authored by Robert Greenwalt's avatar Robert Greenwalt
Browse files

Fix mncLength in cases with a malformed AD_DONE msg from SIM

Several cases error out and skip our guessing of the mcnLength.  This
results in no operator_numeric being set and no APN's matching.

bug: 2101770
parent 3c32474f
Loading
Loading
Loading
Loading
+41 −35
Original line number Diff line number Diff line
@@ -713,6 +713,7 @@ public final class SIMRecords extends IccRecords {


            case EVENT_GET_AD_DONE:
                try {
                    isRecordLoadResponse = true;

                    ar = (AsyncResult)msg.obj;
@@ -738,6 +739,10 @@ public final class SIMRecords extends IccRecords {
                    mncLength = (int)data[3] & 0xf;

                    if (mncLength == 0xf) {
                        mncLength = UNKNOWN;
                    }
                } finally {
                    if (mncLength == UNKNOWN || mncLength == UNINITIALIZED) {
                        if (imsi != null) {
                            try {
                                int mcc = Integer.parseInt(imsi.substring(0,3));
@@ -755,10 +760,11 @@ public final class SIMRecords extends IccRecords {
                        }
                    }
                    if (imsi != null && mncLength != UNKNOWN) {
                    // finally have both imsi and the length of the mnc and can parse it properly
                        // finally have both imsi and the length of the mnc and can parse
                        // the imsi properly
                        MccTable.updateMccMncConfiguration(phone, imsi.substring(0, 3 + mncLength));
                    }

                }
            break;

            case EVENT_GET_SPN_DONE: