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

Commit 41dbb357 authored by Jack Yu's avatar Jack Yu
Browse files

Fixed that bad ADN record loading caused all other good records dropped.

Fixed the issue that while loading all ADN records from EF_ADN, if
one of the record is bad, for example, it points to an EF_EXT1 for the
rest of the phone number, but EF_EXT1 does not exist, we will skip that
bad record but still keep the rest of the good records from EF_ADN.

bug: 23163512
Change-Id: I4828f346769640f1fbc95d49849c61b52d043846
parent e110a72c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -142,6 +142,10 @@ public class AdnRecord implements Parcelable {
        return mNumber;
    }

    public void setNumber(String number) {
        mNumber = number;
    }

    public String[] getEmails() {
        return mEmails;
    }
+16 −9
Original line number Diff line number Diff line
@@ -214,16 +214,23 @@ public class AdnRecordLoader extends Handler {
                    data = (byte[])(ar.result);
                    adn = (AdnRecord)(ar.userObj);

                    if (ar.exception != null) {
                        throw new RuntimeException("load failed", ar.exception);
                    }

                    if (ar.exception == null) {
                        Rlog.d(LOG_TAG,"ADN extension EF: 0x"
                                + Integer.toHexString(mExtensionEF)
                                + ":" + adn.mExtRecord
                                + "\n" + IccUtils.bytesToHexString(data));

                        adn.appendExtRecord(data);
                    }
                    else {
                        // If we can't get the rest of the number from EF_EXT1, rather than
                        // providing the partial number, we clear the number since it's not
                        // dialable anyway. Do not throw exception here otherwise the rest
                        // of the good records will be dropped.

                        Rlog.e(LOG_TAG, "Failed to read ext record. Clear the number now.");
                        adn.setNumber("");
                    }

                    mPendingExtLoads--;
                    // result should have been set in