Methods Summary |
---|
private void | enableFdn()
Message callback = Message.obtain(mHandler, ENABLE_FDN_COMPLETE);
mPhone.getSimCard().setSimFdnEnabled(mEnable, getPin2(), callback);
if (DBG) log("enableFdn: please wait...");
|
private java.lang.String | getPin2()
return mPin2Field.getText().toString();
|
private void | handleResult(android.os.AsyncResult ar)
if (ar.exception == null) {
if (DBG) log("handleResult: success!");
showStatus(getResources().getText(mEnable ?
R.string.enable_fdn_ok : R.string.disable_fdn_ok));
} else if (ar.exception instanceof CommandException
/* && ((CommandException)ar.exception).getCommandError() ==
CommandException.Error.GENERIC_FAILURE */ ) {
if (DBG) log("handleResult: failed!");
showStatus(getResources().getText(
R.string.pin_failed));
}
mHandler.postDelayed(new Runnable() {
public void run() {
finish();
}
}, 3000);
|
private void | log(java.lang.String msg)
Log.d(LOG_TAG, "[EnableSimPin] " + msg);
|
protected void | onCreate(android.os.Bundle icicle)
super.onCreate(icicle);
setContentView(R.layout.enable_fdn_screen);
setupView();
mPhone = PhoneFactory.getDefaultPhone();
mEnable = !mPhone.getSimCard().getSimFdnEnabled();
int id = mEnable ? R.string.enable_fdn : R.string.disable_fdn;
setTitle(getResources().getText(id));
|
protected void | onResume()
super.onResume();
|
private void | setupView()
mPin2Field = (EditText) findViewById(R.id.pin);
mPin2Field.setKeyListener(DigitsKeyListener.getInstance());
mPin2Field.setMovementMethod(null);
mPin2Field.setOnClickListener(mClicked);
mPinFieldContainer = (LinearLayout) findViewById(R.id.pinc);
mStatusField = (TextView) findViewById(R.id.status);
|
private void | showStatus(java.lang.CharSequence statusMsg)
if (statusMsg != null) {
mStatusField.setText(statusMsg);
mStatusField.setVisibility(View.VISIBLE);
mPinFieldContainer.setVisibility(View.GONE);
} else {
mPinFieldContainer.setVisibility(View.VISIBLE);
mStatusField.setVisibility(View.GONE);
}
|