mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 11:12:15 -05:00
don't check for proxy if offline import
This commit is contained in:
parent
35ee21bfab
commit
83fc9d796f
@ -641,6 +641,7 @@ public class ImportExportOperation extends BaseOperation<ImportKeyringParcel> {
|
|||||||
public ImportKeyResult execute(ImportKeyringParcel input, CryptoInputParcel cryptoInput) {
|
public ImportKeyResult execute(ImportKeyringParcel input, CryptoInputParcel cryptoInput) {
|
||||||
Proxy proxy = null;
|
Proxy proxy = null;
|
||||||
|
|
||||||
|
if (!isOfflineImport(input)) {
|
||||||
if (cryptoInput.getParcelableProxy() == null) {
|
if (cryptoInput.getParcelableProxy() == null) {
|
||||||
// if a proxy is not specified, we retrieve from preferences
|
// if a proxy is not specified, we retrieve from preferences
|
||||||
Preferences.ProxyPrefs proxyPrefs = Preferences.getPreferences(mContext).getProxyPrefs();
|
Preferences.ProxyPrefs proxyPrefs = Preferences.getPreferences(mContext).getProxyPrefs();
|
||||||
@ -652,10 +653,16 @@ public class ImportExportOperation extends BaseOperation<ImportKeyringParcel> {
|
|||||||
} else {
|
} else {
|
||||||
proxy = cryptoInput.getParcelableProxy().getProxy();
|
proxy = cryptoInput.getParcelableProxy().getProxy();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return importKeys(input.mKeyList, input.mKeyserver, proxy);
|
return importKeys(input.mKeyList, input.mKeyserver, proxy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Verify if this is sufficient to determine offline import
|
||||||
|
private boolean isOfflineImport(ImportKeyringParcel importParcel) {
|
||||||
|
return importParcel.mKeyList == null;
|
||||||
|
}
|
||||||
|
|
||||||
public ImportKeyResult importKeys(ArrayList<ParcelableKeyRing> keyList, String keyServer, Proxy proxy) {
|
public ImportKeyResult importKeys(ArrayList<ParcelableKeyRing> keyList, String keyServer, Proxy proxy) {
|
||||||
|
|
||||||
ImportKeyResult result = null;
|
ImportKeyResult result = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user