diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyYubiKeyImportFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyYubiKeyImportFragment.java index eaabb3e65..2d88f4d6e 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyYubiKeyImportFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyYubiKeyImportFragment.java @@ -143,7 +143,18 @@ public class CreateKeyYubiKeyImportFragment extends Fragment implements NfcListe view.findViewById(R.id.button_search).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - refreshSearch(); + final Preferences.ProxyPrefs proxyPrefs = Preferences.getPreferences(getActivity()).getProxyPrefs(); + Runnable ignoreTor = new Runnable() { + @Override + public void run() { + refreshSearch(new ParcelableProxy(null, -1, null)); + } + }; + + if (OrbotHelper.isOrbotInRequiredState(R.string.orbot_ignore_tor, ignoreTor, proxyPrefs, + getActivity())) { + refreshSearch(proxyPrefs.parcelableProxy); + } } }); @@ -182,10 +193,10 @@ public class CreateKeyYubiKeyImportFragment extends Fragment implements NfcListe } } - public void refreshSearch() { + public void refreshSearch(ParcelableProxy parcelableProxy) { // TODO: PHILIP implement proxy in YubiKey parts mListFragment.loadNew(new ImportKeysListFragment.CloudLoaderState("0x" + mNfcFingerprint, - Preferences.getPreferences(getActivity()).getCloudSearchPrefs()), null); + Preferences.getPreferences(getActivity()).getCloudSearchPrefs()), parcelableProxy); } public void importKey(ParcelableProxy parcelableProxy) { @@ -278,7 +289,19 @@ public class CreateKeyYubiKeyImportFragment extends Fragment implements NfcListe mNfcFingerprint = KeyFormattingUtils.convertFingerprintToHex(fp); setData(); - refreshSearch(); + + Preferences.ProxyPrefs proxyPrefs = Preferences.getPreferences(getActivity()).getProxyPrefs(); + Runnable ignoreTor = new Runnable() { + @Override + public void run() { + refreshSearch(new ParcelableProxy(null, -1, null)); + } + }; + + if (OrbotHelper.isOrbotInRequiredState(R.string.orbot_ignore_tor, ignoreTor, proxyPrefs, + getActivity())) { + refreshSearch(proxyPrefs.parcelableProxy); + } } }