diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2014-07-11 13:49:17 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2014-07-11 13:49:17 +0200 |
commit | bb92fe2804beed31d8f06a92732e9b1f12dd3aec (patch) | |
tree | dfa33ecc9a3c8cde4ebcc0de67ac4fdcc2543141 /OpenKeychain/src/main/java/org | |
parent | 26f6d58284d7665aa810e0d6a219e1191166e349 (diff) | |
download | open-keychain-bb92fe2804beed31d8f06a92732e9b1f12dd3aec.tar.gz open-keychain-bb92fe2804beed31d8f06a92732e9b1f12dd3aec.tar.bz2 open-keychain-bb92fe2804beed31d8f06a92732e9b1f12dd3aec.zip |
test: get rid of some SaveKeyringParcel boilerplate
Diffstat (limited to 'OpenKeychain/src/main/java/org')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java index a56095767..9f29c15dc 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java @@ -39,11 +39,7 @@ public class SaveKeyringParcel implements Parcelable { public ArrayList<Long> revokeSubKeys; public SaveKeyringParcel() { - addUserIds = new ArrayList<String>(); - addSubKeys = new ArrayList<SubkeyAdd>(); - changeSubKeys = new ArrayList<SubkeyChange>(); - revokeUserIds = new ArrayList<String>(); - revokeSubKeys = new ArrayList<Long>(); + reset(); } public SaveKeyringParcel(long masterKeyId, byte[] fingerprint) { @@ -52,6 +48,16 @@ public class SaveKeyringParcel implements Parcelable { mFingerprint = fingerprint; } + public void reset() { + newPassphrase = null; + addUserIds = new ArrayList<String>(); + addSubKeys = new ArrayList<SubkeyAdd>(); + changePrimaryUserId = null; + changeSubKeys = new ArrayList<SubkeyChange>(); + revokeUserIds = new ArrayList<String>(); + revokeSubKeys = new ArrayList<Long>(); + } + // performance gain for using Parcelable here would probably be negligible, // use Serializable instead. public static class SubkeyAdd implements Serializable { |