ImportKeys: Refactoring

- Avoid instanceof and duplicated code
This commit is contained in:
Andrea Torlaschi
2016-08-17 20:39:28 +02:00
parent 6ab633f08e
commit 756f427f19
17 changed files with 208 additions and 197 deletions

View File

@@ -26,10 +26,11 @@ import org.sufficientlysecure.keychain.keyimport.ParcelableKeyRing;
import java.util.ArrayList;
public class ImportKeyringParcel implements Parcelable {
// if null, keys are expected to be read from a cache file in ImportExportOperations
// If null, keys are expected to be read from a cache file in ImportExportOperations
public ArrayList<ParcelableKeyRing> mKeyList;
public String mKeyserver; // must be set if keys are to be imported from a keyserver
public boolean mSkipSave = false; // don't save the key, only return it as part of result
public String mKeyserver;
// If false, don't save the key, only return it as part of result
public boolean mSkipSave = false;
public ImportKeyringParcel(ArrayList<ParcelableKeyRing> keyList, String keyserver) {
mKeyList = keyList;

View File

@@ -466,7 +466,7 @@ public class KeyserverSyncAdapterService extends Service {
String hexKeyId = KeyFormattingUtils
.convertKeyIdToHex(keyId);
// we aren't updating from keybase as of now
keyList.add(new ParcelableKeyRing(fingerprint, hexKeyId));
keyList.add(new ParcelableKeyRing(fingerprint, hexKeyId, null, null));
}
keyCursor.close();