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

Commit 2cf1bf86 authored by Yoshiaki Naka's avatar Yoshiaki Naka
Browse files

Treat 2G SIM and 3G SIM equally when releasing the access rules cache

The condition to release the cache of the carrier privilege rules should
be same between 2G SIM card and 3G SIM card.

Bug: 111079091
Test: Confirmed that the cache is not released with both 2G/3G cards.

Change-Id: I8b840a923d3ede9d50c4fa6fb7e2bda73e70e132
parent 1c31297b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -233,10 +233,10 @@ public class UiccCard {
     * @deprecated Please use {@link UiccProfile#resetAppWithAid(String, boolean)} instead.
     */
    @Deprecated
    public boolean resetAppWithAid(String aid, boolean disposeCatService) {
    public boolean resetAppWithAid(String aid, boolean reset) {
        synchronized (mLock) {
            if (mUiccProfile != null) {
                return mUiccProfile.resetAppWithAid(aid, disposeCatService);
                return mUiccProfile.resetAppWithAid(aid, reset);
            } else {
                return false;
            }
+2 −2
Original line number Diff line number Diff line
@@ -645,11 +645,11 @@ public class UiccController extends Handler {
            // Reset the required apps when we know about the refresh so that
            // anyone interested does not get stale state.
            case IccRefreshResponse.REFRESH_RESULT_RESET:
                changed = uiccCard.resetAppWithAid(resp.aid, true /* disposeCatService */);
                changed = uiccCard.resetAppWithAid(resp.aid, true /* reset */);
                break;
            case IccRefreshResponse.REFRESH_RESULT_INIT:
                // don't dispose CatService on SIM REFRESH of type INIT
                changed = uiccCard.resetAppWithAid(resp.aid, false /* disposeCatService */);
                changed = uiccCard.resetAppWithAid(resp.aid, false /* initialize */);
                break;
            default:
                return;
+5 −5
Original line number Diff line number Diff line
@@ -1242,11 +1242,10 @@ public class UiccProfile extends IccCard {
     * 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 disposeCatService flag indicating if CatService should be disposed as part of
     *                          this reset
     * @param reset true if reset is required. false for initialization.
     * @return boolean indicating if there was any change made as part of the reset
     */
    public boolean resetAppWithAid(String aid, boolean disposeCatService) {
    public boolean resetAppWithAid(String aid, boolean reset) {
        synchronized (mLock) {
            boolean changed = false;
            for (int i = 0; i < mUiccApplications.length; i++) {
@@ -1258,12 +1257,13 @@ public class UiccProfile extends IccCard {
                    changed = true;
                }
            }
            if (TextUtils.isEmpty(aid)) {
            if (reset && TextUtils.isEmpty(aid)) {
                if (mCarrierPrivilegeRules != null) {
                    mCarrierPrivilegeRules = null;
                    changed = true;
                }
                if (disposeCatService && mCatService != null) {
                // CatService shall be disposed only when a card level reset happens.
                if (mCatService != null) {
                    mCatService.dispose();
                    mCatService = null;
                    changed = true;