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

Commit b096d24a authored by Shishir Agrawal's avatar Shishir Agrawal Committed by Android Git Automerger
Browse files

am 626e1203: UICC: Handle card level REFRESH RESET events.

* commit '626e1203':
  UICC: Handle card level REFRESH RESET events.
parents 1e79fea3 626e1203
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -458,19 +458,25 @@ public class UiccCard {

    /**
     * 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.
     */
    public boolean resetAppWithAid(String aid) {
        synchronized (mLock) {
            boolean changed = false;
            for (int i = 0; i < mUiccApplications.length; i++) {
                if (mUiccApplications[i] != null && aid.equals(mUiccApplications[i].getAid())) {
                if (mUiccApplications[i] != null &&
                    (aid == null || aid.equals(mUiccApplications[i].getAid()))) {
                    // Delete removed applications
                    mUiccApplications[i].dispose();
                    mUiccApplications[i] = null;
                    return true;
                    changed = true;
                }
            }
            return false;
            return changed;
        }
        // TODO: For a card level notification, we should delete the CarrierPrivilegeRules and the
        // CAT service.
    }

    /**
+5 −6
Original line number Diff line number Diff line
@@ -312,12 +312,13 @@ public class UiccController extends Handler {
            return;
        }

        if (resp.refreshResult != IccRefreshResponse.REFRESH_RESULT_RESET ||
            resp.aid == null) {
            Rlog.d(LOG_TAG, "Ignoring reset: " + resp);
        if (resp.refreshResult != IccRefreshResponse.REFRESH_RESULT_RESET) {
          Rlog.d(LOG_TAG, "Ignoring non reset refresh: " + resp);
          return;
        }

        Rlog.d(LOG_TAG, "Handling refresh reset: " + resp);

        boolean changed = mUiccCards[index].resetAppWithAid(resp.aid);
        if (changed) {
            boolean requirePowerOffOnSimRefreshReset = mContext.getResources().getBoolean(
@@ -329,8 +330,6 @@ public class UiccController extends Handler {
            }
            mIccChangedRegistrants.notifyRegistrants(new AsyncResult(null, index, null));
        }
        // TODO: For a card level notification, we should delete the CarrierPrivilegeRules and the
        // CAT service.
    }

    private boolean isValidCardIndex(int index) {