Make bit size optional

This commit is contained in:
Dominik Schürmann 2014-10-05 01:46:56 +02:00
parent 60fb3b60a8
commit fa2b3054b0
3 changed files with 5 additions and 6 deletions

View File

@ -73,7 +73,10 @@ public class ImportKeysListEntry implements Serializable, Parcelable {
}
dest.writeString(mFingerprintHex);
dest.writeString(mKeyIdHex);
dest.writeInt(mBitStrength == null ? 0 : 1);
if (mBitStrength != null) {
dest.writeInt(mBitStrength);
}
dest.writeString(mAlgorithm);
dest.writeByte((byte) (mSecretKey ? 1 : 0));
dest.writeByte((byte) (mSelected ? 1 : 0));
@ -94,7 +97,7 @@ public class ImportKeysListEntry implements Serializable, Parcelable {
vr.mDate = source.readInt() != 0 ? new Date(source.readLong()) : null;
vr.mFingerprintHex = source.readString();
vr.mKeyIdHex = source.readString();
vr.mBitStrength = source.readInt();
vr.mBitStrength = source.readInt() != 0 ? source.readInt() : null;
vr.mAlgorithm = source.readString();
vr.mSecretKey = source.readByte() == 1;
vr.mSelected = source.readByte() == 1;

View File

@ -389,8 +389,6 @@ public class AddKeysActivity extends ActionBarActivity implements
certifyIntent.putExtra(MultiCertifyKeyActivity.EXTRA_KEY_IDS, result.getImportedMasterKeyIds());
certifyIntent.putExtra(MultiCertifyKeyActivity.EXTRA_CERTIFY_KEY_ID, mExchangeMasterKeyId);
startActivity(certifyIntent);
result.createNotify(AddKeysActivity.this).show();
}
}
};
@ -449,7 +447,6 @@ public class AddKeysActivity extends ActionBarActivity implements
final ImportKeysListEntry keyEntry = new ImportKeysListEntry();
keyEntry.setFingerprintHex(fingerprint);
keyEntry.setBitStrength(1337); // TODO: make optional!
keyEntry.addOrigin(cloudPrefs.keyserver);
ArrayList<ImportKeysListEntry> selectedEntries = new ArrayList<ImportKeysListEntry>();
selectedEntries.add(keyEntry);

View File

@ -59,7 +59,6 @@ public class KeyUpdateHelper {
for (String fprint : providerHelper.getAllFingerprints(KeychainContract.KeyRings.buildUnifiedKeyRingsUri())) {
ImportKeysListEntry key = new ImportKeysListEntry();
key.setFingerprintHex(fprint);
key.setBitStrength(1337);
key.addOrigin(servers[0]);
keys.add(key);
}