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

Commit 5f91f203 authored by arunvoddu's avatar arunvoddu
Browse files

Fixed ConcurrentModificationException in UiccSlot component.

Exception while reading Iccid details in UiccSlot.

Bug: 386068829
Flag: EXEMPT UX bug fix
Test: Manual Sim add/remove and atest verified
Change-Id: I52954ea8a1cc9edce252ddb97f261626adfa004b
parent fdd73e05
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import android.util.Log;
import android.view.WindowManager;

import com.android.internal.R;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.IccCardConstants;
import com.android.internal.telephony.Phone;
@@ -495,8 +496,10 @@ public class UiccSlot extends Handler {
     *  Use this API to get the iccId of the inactive port only.
     */
    public String getIccId(int portIdx) {
        synchronized (mLock) {
            return mIccIds.get(portIdx);
        }
    }

    public String getEid() {
        return mEid;
@@ -660,10 +663,13 @@ public class UiccSlot extends Handler {
    }

    private Map<Integer, String> getPrintableIccIds() {
        Map<Integer, String> printableIccIds = mIccIds.entrySet().stream()
        Map<Integer, String> copyOfIccIdMap;
        synchronized (mLock) {
            copyOfIccIdMap = new HashMap<>(mIccIds);
        }
        return copyOfIccIdMap.entrySet().stream()
                .collect(Collectors.toMap(Map.Entry::getKey,
                        e -> SubscriptionInfo.getPrintableId(e.getValue())));
        return printableIccIds;
    }

    /**