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

Commit 2b545aa5 authored by Amit Mahajan's avatar Amit Mahajan
Browse files

SIM refresh of type init should not dispose CatService.

Test: Basic telephony sanity
Bug: 78240540

Change-Id: Ied9230646c1e722ae33f50f4dfdacae77cb921c1
parent a8a81ecf
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -230,13 +230,13 @@ public class UiccCard {
     *
     * A null aid implies a card level reset - all applications must be reset.
     *
     * @deprecated Please use {@link UiccProfile#resetAppWithAid(String)} instead.
     * @deprecated Please use {@link UiccProfile#resetAppWithAid(String, boolean)} instead.
     */
    @Deprecated
    public boolean resetAppWithAid(String aid) {
    public boolean resetAppWithAid(String aid, boolean disposeCatService) {
        synchronized (mLock) {
            if (mUiccProfile != null) {
                return mUiccProfile.resetAppWithAid(aid);
                return mUiccProfile.resetAppWithAid(aid, disposeCatService);
            } else {
                return false;
            }
+8 −5
Original line number Diff line number Diff line
@@ -642,11 +642,14 @@ public class UiccController extends Handler {

        boolean changed = false;
        switch(resp.refreshResult) {
            case IccRefreshResponse.REFRESH_RESULT_RESET:
            case IccRefreshResponse.REFRESH_RESULT_INIT:
            // Reset the required apps when we know about the refresh so that
            // anyone interested does not get stale state.
                 changed = uiccCard.resetAppWithAid(resp.aid);
            case IccRefreshResponse.REFRESH_RESULT_RESET:
                changed = uiccCard.resetAppWithAid(resp.aid, true /* disposeCatService */);
                break;
            case IccRefreshResponse.REFRESH_RESULT_INIT:
                // don't dispose CatService on SIM REFRESH of type INIT
                changed = uiccCard.resetAppWithAid(resp.aid, false /* disposeCatService */);
                break;
            default:
                return;
+7 −2
Original line number Diff line number Diff line
@@ -1275,8 +1275,13 @@ public class UiccProfile extends IccCard {
     * Resets the application with the input AID. Returns true if any changes were made.
     *
     * 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
     * @return boolean indicating if there was any change made as part of the reset
     */
    public boolean resetAppWithAid(String aid) {
    public boolean resetAppWithAid(String aid, boolean disposeCatService) {
        synchronized (mLock) {
            boolean changed = false;
            for (int i = 0; i < mUiccApplications.length; i++) {
@@ -1293,7 +1298,7 @@ public class UiccProfile extends IccCard {
                    mCarrierPrivilegeRules = null;
                    changed = true;
                }
                if (mCatService != null) {
                if (disposeCatService && mCatService != null) {
                    mCatService.dispose();
                    mCatService = null;
                    changed = true;