diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-11-19 23:07:54 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-11-19 23:07:54 +0100 |
commit | d783cec97084a12873ca62b5fcd64620056ec01b (patch) | |
tree | 65e63d03dd4ab7a834c343ba593c8cd8917620cb /libs/MemorizingTrustManager/src/de/duenndns/ssl/MemorizingActivity.java | |
parent | 969ba45c56adaaa056f04464cd98aec115c9611b (diff) |
reformat code
Diffstat (limited to '')
-rw-r--r-- | libs/MemorizingTrustManager/src/de/duenndns/ssl/MemorizingActivity.java | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/libs/MemorizingTrustManager/src/de/duenndns/ssl/MemorizingActivity.java b/libs/MemorizingTrustManager/src/de/duenndns/ssl/MemorizingActivity.java index 567c2d817..c917c5d08 100644 --- a/libs/MemorizingTrustManager/src/de/duenndns/ssl/MemorizingActivity.java +++ b/libs/MemorizingTrustManager/src/de/duenndns/ssl/MemorizingActivity.java @@ -36,69 +36,69 @@ import java.util.logging.Level; import java.util.logging.Logger; public class MemorizingActivity extends Activity - implements OnClickListener,OnCancelListener { + implements OnClickListener, OnCancelListener { - private final static Logger LOGGER = Logger.getLogger(MemorizingActivity.class.getName()); + private final static Logger LOGGER = Logger.getLogger(MemorizingActivity.class.getName()); - int decisionId; + int decisionId; - AlertDialog dialog; - - @Override - public void onCreate(Bundle savedInstanceState) { - LOGGER.log(Level.FINE, "onCreate"); - super.onCreate(savedInstanceState); - } + AlertDialog dialog; - @Override - public void onResume() { - super.onResume(); - Intent i = getIntent(); - decisionId = i.getIntExtra(MemorizingTrustManager.DECISION_INTENT_ID, MTMDecision.DECISION_INVALID); - int titleId = i.getIntExtra(MemorizingTrustManager.DECISION_TITLE_ID, R.string.mtm_accept_cert); - String cert = i.getStringExtra(MemorizingTrustManager.DECISION_INTENT_CERT); - LOGGER.log(Level.FINE, "onResume with " + i.getExtras() + " decId=" + decisionId + " data: " + i.getData()); - dialog = new AlertDialog.Builder(this).setTitle(titleId) - .setMessage(cert) - .setPositiveButton(R.string.mtm_decision_always, this) - .setNeutralButton(R.string.mtm_decision_once, this) - .setNegativeButton(R.string.mtm_decision_abort, this) - .setOnCancelListener(this) - .create(); - dialog.show(); - } + @Override + public void onCreate(Bundle savedInstanceState) { + LOGGER.log(Level.FINE, "onCreate"); + super.onCreate(savedInstanceState); + } - @Override - protected void onPause() { - if (dialog.isShowing()) - dialog.dismiss(); - super.onPause(); - } + @Override + public void onResume() { + super.onResume(); + Intent i = getIntent(); + decisionId = i.getIntExtra(MemorizingTrustManager.DECISION_INTENT_ID, MTMDecision.DECISION_INVALID); + int titleId = i.getIntExtra(MemorizingTrustManager.DECISION_TITLE_ID, R.string.mtm_accept_cert); + String cert = i.getStringExtra(MemorizingTrustManager.DECISION_INTENT_CERT); + LOGGER.log(Level.FINE, "onResume with " + i.getExtras() + " decId=" + decisionId + " data: " + i.getData()); + dialog = new AlertDialog.Builder(this).setTitle(titleId) + .setMessage(cert) + .setPositiveButton(R.string.mtm_decision_always, this) + .setNeutralButton(R.string.mtm_decision_once, this) + .setNegativeButton(R.string.mtm_decision_abort, this) + .setOnCancelListener(this) + .create(); + dialog.show(); + } - void sendDecision(int decision) { - LOGGER.log(Level.FINE, "Sending decision: " + decision); - MemorizingTrustManager.interactResult(decisionId, decision); - finish(); - } + @Override + protected void onPause() { + if (dialog.isShowing()) + dialog.dismiss(); + super.onPause(); + } - // react on AlertDialog button press - public void onClick(DialogInterface dialog, int btnId) { - int decision; - dialog.dismiss(); - switch (btnId) { - case DialogInterface.BUTTON_POSITIVE: - decision = MTMDecision.DECISION_ALWAYS; - break; - case DialogInterface.BUTTON_NEUTRAL: - decision = MTMDecision.DECISION_ONCE; - break; - default: - decision = MTMDecision.DECISION_ABORT; - } - sendDecision(decision); - } + void sendDecision(int decision) { + LOGGER.log(Level.FINE, "Sending decision: " + decision); + MemorizingTrustManager.interactResult(decisionId, decision); + finish(); + } - public void onCancel(DialogInterface dialog) { - sendDecision(MTMDecision.DECISION_ABORT); - } + // react on AlertDialog button press + public void onClick(DialogInterface dialog, int btnId) { + int decision; + dialog.dismiss(); + switch (btnId) { + case DialogInterface.BUTTON_POSITIVE: + decision = MTMDecision.DECISION_ALWAYS; + break; + case DialogInterface.BUTTON_NEUTRAL: + decision = MTMDecision.DECISION_ONCE; + break; + default: + decision = MTMDecision.DECISION_ABORT; + } + sendDecision(decision); + } + + public void onCancel(DialogInterface dialog) { + sendDecision(MTMDecision.DECISION_ABORT); + } } |