Пример #1
0
        @Override
        public void onReceive(Context context, Intent intent) {
          if (TelephonyIntents.ACTION_SIM_STATE_CHANGED.equals(intent.getAction())) {
            String simState = intent.getStringExtra(IccCardConstants.INTENT_KEY_ICC_STATE);
            int simId =
                intent.getIntExtra(
                    com.android.internal.telephony.PhoneConstants.GEMINI_SIM_ID_KEY, -1);

            CatLog.d(
                LOGTAG,
                "mSIMStateChangeReceiver() - simId["
                    + simId
                    + "]  state["
                    + simState
                    + "], mSimId: "
                    + mDialogInstance.mSimId);

            if ((simId == mDialogInstance.mSimId)
                && (IccCardConstants.INTENT_VALUE_ICC_NOT_READY.equals(simState)
                    || IccCardConstants.INTENT_VALUE_ICC_ABSENT.equals(simState))) {
              mDialogInstance.cancelTimeOut();
              mDialogInstance.sendResponse(StkAppService.RES_ID_CONFIRM, false);
              finish();
            }
          }
        }
Пример #2
0
        @Override
        public void onReceive(Context context, Intent intent) {
          if (TelephonyIntents.ACTION_SIM_STATE_CHANGED.equals(intent.getAction())) {
            String simState = intent.getStringExtra(IccCardConstants.INTENT_KEY_ICC_STATE);
            int simId =
                intent.getIntExtra(
                    com.android.internal.telephony.PhoneConstants.GEMINI_SIM_ID_KEY, -1);

            CatLog.d(
                LOGTAG,
                "mSIMStateChangeReceiver() - simId[" + simId + "]  state[" + simState + "]");
            /* TODO: GEMINI+ */
            if ((simId == com.android.internal.telephony.PhoneConstants.GEMINI_SIM_1)
                && (IccCardConstants.INTENT_VALUE_ICC_NOT_READY.equals(simState)
                    || IccCardConstants.INTENT_VALUE_ICC_ABSENT.equals(simState))) {
              CatLog.d(LOGTAG, "mSendResp: " + mMenuInstance.mSendResp);
              if (!mMenuInstance.mSendResp) {
                StkMenuActivity.this.mMenuInstance.sendResponse(StkAppService.RES_ID_END_SESSION);
              }
              StkMenuActivity.this.mMenuInstance.cancelTimeOut();
              StkMenuActivity.this.finish();
            }
          }
        }