From cc0893835e614159d3413b64c149fb9f67b004f3 Mon Sep 17 00:00:00 2001 From: Adithya Abraham Philip Date: Thu, 11 Jun 2015 05:42:10 +0530 Subject: [PATCH] modify ImportKeysActivity to match new pattern --- .../keychain/ui/ImportKeysActivity.java | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java index ab5539193..f1b1308c6 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java @@ -353,30 +353,16 @@ public class ImportKeysActivity extends BaseNfcActivity { if (loaderState instanceof ImportKeysListFragment.CloudLoaderState) { // do the tor check // this handle will set tor to be ignored whenever a message is received - Handler ignoreTorHandler = new Handler() { + Runnable ignoreTor = new Runnable() { @Override - public void handleMessage(Message msg) { + public void run() { // disables Tor until Activity is recreated mProxyPrefs = new Preferences.ProxyPrefs(false, false, null, -1, null); mListFragment.loadNew(loaderState, mProxyPrefs.parcelableProxy); } }; - - if(mProxyPrefs.torEnabled && !OrbotHelper.isOrbotInstalled(this)) { - - OrbotHelper.getInstallDialogFragmentWithThirdButton( - new Messenger(ignoreTorHandler), - R.string.orbot_install_dialog_ignore_tor - ).show(getSupportFragmentManager(), "orbotInstallDialog"); - - return; - } - - if(mProxyPrefs.torEnabled && !OrbotHelper.isOrbotRunning()) { - OrbotHelper.getOrbotStartDialogFragment(new Messenger(ignoreTorHandler), - R.string.orbot_install_dialog_ignore_tor) - .show(getSupportFragmentManager(), "orbotStartDialog"); - return; + if (OrbotHelper.isOrbotInRequiredState(R.string.orbot_ignore_tor, ignoreTor, mProxyPrefs, this)) { + mListFragment.loadNew(loaderState, mProxyPrefs.parcelableProxy); } }