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

Commit 629b238f authored by Rakesh Pallerla's avatar Rakesh Pallerla Committed by Linux Build Service Account
Browse files

MSIM: Add support for Manage SIM Contacts for MultiSim.

1. Make changes to inform modules who are observing changes in
Content Resolver for ADN.
2. Add null pointer checks in normalizeValue and while parsing PBR
to avoid exceptions.

Change-Id: Ifb59bf8fb95defa76e103112c2dba3666f1a0120
(cherry picked from commit 1686c3c37d8b0c69050c320dca2c145bcb30c1ba)
(cherry picked from commit f7e220049373fce81cbb7efadccd5dd0ace409a8)
parent fa37fa34
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -159,6 +159,7 @@ public class IccProvider extends ContentProvider {

        resultUri = Uri.parse(buf.toString());

        getContext().getContentResolver().notifyChange(url, null);
        /*
        // notify interested parties that an insertion happened
        getContext().getContentResolver().notifyInsert(
@@ -170,6 +171,11 @@ public class IccProvider extends ContentProvider {

    private String normalizeValue(String inVal) {
        int len = inVal.length();
        // If name is empty in contact return null to avoid crash.
        if (len == 0) {
            if (DBG) log("len of input String is 0");
            return inVal;
        }
        String retVal = inVal;

        if (inVal.charAt(0) == '\'' && inVal.charAt(len-1) == '\'') {
@@ -239,6 +245,7 @@ public class IccProvider extends ContentProvider {
            return 0;
        }

        getContext().getContentResolver().notifyChange(url, null);
        return 1;
    }

@@ -279,6 +286,7 @@ public class IccProvider extends ContentProvider {
            return 0;
        }

        getContext().getContentResolver().notifyChange(url, null);
        return 1;
    }

+12 −2
Original line number Diff line number Diff line
@@ -148,7 +148,12 @@ public class UsimPhoneBookManager extends Handler implements IccConstants {

    private void readEmailFileAndWait(int recNum) {
        Map <Integer,Integer> fileIds;
        if (mPbrFile == null) {
            Rlog.e(LOG_TAG, "mPbrFile is NULL, exiting from readEmailFileAndWait");
            return;
        } else {
            fileIds = mPbrFile.mFileIds.get(recNum);
        }
        if (fileIds == null) return;

        if (fileIds.containsKey(USIM_EFEMAIL_TAG)) {
@@ -302,7 +307,12 @@ public class UsimPhoneBookManager extends Handler implements IccConstants {

    private void readAdnFileAndWait(int recNum) {
        Map <Integer,Integer> fileIds;
        if (mPbrFile == null) {
            Rlog.e(LOG_TAG, "mPbrFile is NULL, exiting from readAdnFileAndWait");
            return;
        } else {
            fileIds = mPbrFile.mFileIds.get(recNum);
        }
        if (fileIds == null || fileIds.isEmpty()) return;