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

Commit 37ba812b authored by SongFerngWang's avatar SongFerngWang
Browse files

Carrier config's SIM state is wrong after Modem do sim refresh with ISIM aid.

Because the UiccProfile doesn't consider ISIM when it does updateExternalState
It causes Carrier config's SIM state to be kept UNKNOWN after Modem do
sim refresh with ISIM aid.
UiccController shouldn't change the carrier config's sim state when ISIM refresh.

Bug: 167240793
Test: manual test
Change-Id: I4fdf8111629424653968481c602570dd0e85c087
parent d4a664ac
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;
        }
    }