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

Commit c2042f5e authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 24029 into eclair

* changes:
  Fix mncLength in cases with a malformed AD_DONE msg from SIM
parents 6e4b7d66 bf87c9e7
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: