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

Commit e036ac95 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Carrier config's SIM state is wrong after Modem do sim refresh with...

Merge "Carrier config's SIM state is wrong after Modem do sim refresh with ISIM aid." am: 14a93f11

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1473601

Change-Id: Id751f9e98271a2d381c1fcb1bb32849b75cb1313
parents 6260f5e8 14a93f11
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -1490,20 +1490,32 @@ public class UiccProfile extends IccCard {
    }

    /**
     * Resets the application with the input AID. Returns true if any changes were made.
     * Resets the application with the input AID.
     *
     * A null aid implies a card level reset - all applications must be reset.
     *
     * @param aid aid of the application which should be reset; null imples all applications
     * @param reset true if reset is required. false for initialization.
     * @return boolean indicating if there was any change made as part of the reset
     * @return boolean indicating if there was any change made as part of the reset which
     * requires carrier config to be reset too (for e.g. if only ISIM app is refreshed carrier
     * config should not be reset)
     */
    @VisibleForTesting
    public boolean resetAppWithAid(String aid, boolean reset) {
        synchronized (mLock) {
            boolean changed = false;
            boolean isIsimRefresh = false;
            for (int i = 0; i < mUiccApplications.length; i++) {
                if (mUiccApplications[i] != null
                        && (TextUtils.isEmpty(aid) || aid.equals(mUiccApplications[i].getAid()))) {
                    // Resetting only ISIM does not need to be treated as a change from caller
                    // perspective, as it does not affect SIM state now or even later when ISIM
                    // is re-loaded, hence return false.
                    if (!TextUtils.isEmpty(aid)
                            && mUiccApplications[i].getType() == AppType.APPTYPE_ISIM) {
                        isIsimRefresh = true;
                    }

                    // Delete removed applications
                    mUiccApplications[i].dispose();
                    mUiccApplications[i] = null;
@@ -1524,7 +1536,7 @@ public class UiccProfile extends IccCard {
                    changed = true;
                }
            }
            return changed;
            return changed && !isIsimRefresh;
        }
    }