Exemplo n.º 1
0
  void displayAlertDlg(GDAlertDialog dialog, int type) {

    Log.d(TAG, " ====  displayAlertDlg == " + type);

    switch (type) {
      case DLG_TYPE_SMARTCARD_INFO:
        {
          dialog.setTitle(R.string.smartcard_status_title);
          dialog.showSingleButton();

          if (mSmartcardState == SMARTCARD_STATE_INSERTED
              || mSmartcardState == SMARTCARD_STATE_INSERTING) {
            dialog.setMessage(R.string.smartcard_status_in);
          } else if (mSmartcardState == SMARTCARD_STATE_REMOVED
              || mSmartcardState == SMARTCARD_STATE_REMOVING) {
            dialog.setMessage(R.string.smartcard_status_out);
          } else {
            dialog.setMessage(R.string.smartcard_status_invlid);
          }
          break;
        }
    }

    if (dialog != null) {
      dialog.mOkButton.requestFocus();
    }
  }
Exemplo n.º 2
0
  protected Dialog onCreateDialog(int id) {
    Dialog dialog = null;
    switch (id) {
      case DLG_ID_SMARTCARD:
        {
          mSmartcardDlg = new GDAlertDialog(this, id);
          mSmartcardDlg.setOnShowListener(mOnShowListener);
          mSmartcardDlg.setOnDismissListener(mOnDismissListener);
          dialog = mSmartcardDlg;
          break;
        }
    }

    return dialog;
  }
Exemplo n.º 3
0
  protected void handSmartcardStateChange(int state) {
    mSmartcardState = state;
    mAlertType = DLG_TYPE_SMARTCARD_INFO;

    Log.d(TAG, " ======== display smartcard state ==== " + mSmartcardState);

    if (mSmartcardDlg == null || !mSmartcardDlg.isShowing()) {
      showDialog(DLG_ID_SMARTCARD);
    } else {
      displayAlertDlg(mSmartcardDlg, mAlertType);
    }

    if (mSmartcardState == SMARTCARD_STATE_INSERTED) {
      hideDlgDelay();
    } else {
      stopTimer();
    }
  }
Exemplo n.º 4
0
 void hideAlertDlg() {
   mSmartcardDlg.dismiss();
 }