mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 11:12:15 -05:00
modify ImportKeysActivity to match new pattern
This commit is contained in:
parent
cc4ecb6be7
commit
cc0893835e
@ -353,30 +353,16 @@ public class ImportKeysActivity extends BaseNfcActivity {
|
|||||||
if (loaderState instanceof ImportKeysListFragment.CloudLoaderState) {
|
if (loaderState instanceof ImportKeysListFragment.CloudLoaderState) {
|
||||||
// do the tor check
|
// do the tor check
|
||||||
// this handle will set tor to be ignored whenever a message is received
|
// this handle will set tor to be ignored whenever a message is received
|
||||||
Handler ignoreTorHandler = new Handler() {
|
Runnable ignoreTor = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void handleMessage(Message msg) {
|
public void run() {
|
||||||
// disables Tor until Activity is recreated
|
// disables Tor until Activity is recreated
|
||||||
mProxyPrefs = new Preferences.ProxyPrefs(false, false, null, -1, null);
|
mProxyPrefs = new Preferences.ProxyPrefs(false, false, null, -1, null);
|
||||||
mListFragment.loadNew(loaderState, mProxyPrefs.parcelableProxy);
|
mListFragment.loadNew(loaderState, mProxyPrefs.parcelableProxy);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
if (OrbotHelper.isOrbotInRequiredState(R.string.orbot_ignore_tor, ignoreTor, mProxyPrefs, this)) {
|
||||||
if(mProxyPrefs.torEnabled && !OrbotHelper.isOrbotInstalled(this)) {
|
mListFragment.loadNew(loaderState, mProxyPrefs.parcelableProxy);
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user