use arraylists instead of arrays in savekeyringparcel

This commit is contained in:
Vincent Breitmoser 2014-06-22 14:45:40 +02:00
parent 37cee1322b
commit 4d091d1784

View File

@ -4,7 +4,7 @@ import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import java.io.Serializable; import java.io.Serializable;
import java.util.HashMap; import java.util.ArrayList;
/** This class is a a transferable representation for a collection of changes /** This class is a a transferable representation for a collection of changes
* to be done on a keyring. * to be done on a keyring.
@ -29,14 +29,14 @@ public class SaveKeyringParcel implements Parcelable {
public String newPassphrase; public String newPassphrase;
public String[] addUserIds; public ArrayList<String> addUserIds;
public SubkeyAdd[] addSubKeys; public ArrayList<SubkeyAdd> addSubKeys;
public SubkeyChange[] changeSubKeys; public ArrayList<SubkeyChange> changeSubKeys;
public String changePrimaryUserId; public String changePrimaryUserId;
public String[] revokeUserIds; public ArrayList<String> revokeUserIds;
public long[] revokeSubKeys; public ArrayList<Long> revokeSubKeys;
public SaveKeyringParcel(long masterKeyId, byte[] fingerprint) { public SaveKeyringParcel(long masterKeyId, byte[] fingerprint) {
mMasterKeyId = masterKeyId; mMasterKeyId = masterKeyId;
@ -73,14 +73,14 @@ public class SaveKeyringParcel implements Parcelable {
mMasterKeyId = source.readLong(); mMasterKeyId = source.readLong();
mFingerprint = source.createByteArray(); mFingerprint = source.createByteArray();
addUserIds = source.createStringArray(); addUserIds = source.createStringArrayList();
addSubKeys = (SubkeyAdd[]) source.readSerializable(); addSubKeys = (ArrayList<SubkeyAdd>) source.readSerializable();
changeSubKeys = (SubkeyChange[]) source.readSerializable(); changeSubKeys = (ArrayList<SubkeyChange>) source.readSerializable();
changePrimaryUserId = source.readString(); changePrimaryUserId = source.readString();
revokeUserIds = source.createStringArray(); revokeUserIds = source.createStringArrayList();
revokeSubKeys = source.createLongArray(); revokeSubKeys = (ArrayList<Long>) source.readSerializable();
} }
@Override @Override
@ -88,14 +88,14 @@ public class SaveKeyringParcel implements Parcelable {
destination.writeLong(mMasterKeyId); destination.writeLong(mMasterKeyId);
destination.writeByteArray(mFingerprint); destination.writeByteArray(mFingerprint);
destination.writeStringArray(addUserIds); destination.writeStringList(addUserIds);
destination.writeSerializable(addSubKeys); destination.writeSerializable(addSubKeys);
destination.writeSerializable(changeSubKeys); destination.writeSerializable(changeSubKeys);
destination.writeString(changePrimaryUserId); destination.writeString(changePrimaryUserId);
destination.writeStringArray(revokeUserIds); destination.writeStringList(revokeUserIds);
destination.writeLongArray(revokeSubKeys); destination.writeSerializable(revokeSubKeys);
} }
public static final Creator<SaveKeyringParcel> CREATOR = new Creator<SaveKeyringParcel>() { public static final Creator<SaveKeyringParcel> CREATOR = new Creator<SaveKeyringParcel>() {