diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-08-16 12:13:30 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-08-16 12:13:30 +0200 |
commit | 188eeb79c9f2eb536d73efee09a3698750c87dab (patch) | |
tree | 6da671b966a65503b78bf217493fd922e0611a64 /OpenKeychain | |
parent | 2497722b48561ac1031f7ed9c0cb0526f694b1b3 (diff) | |
download | open-keychain-188eeb79c9f2eb536d73efee09a3698750c87dab.tar.gz open-keychain-188eeb79c9f2eb536d73efee09a3698750c87dab.tar.bz2 open-keychain-188eeb79c9f2eb536d73efee09a3698750c87dab.zip |
Fix and simplify in OperationResultParcel
Diffstat (limited to 'OpenKeychain')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResults.java | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResults.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResults.java index 1c83873be..1fc496082 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResults.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResults.java @@ -28,6 +28,7 @@ import com.github.johnpersano.supertoasts.SuperToast; import com.github.johnpersano.supertoasts.util.OnClickWrapper; import com.github.johnpersano.supertoasts.util.Style; +import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.pgp.CanonicalizedKeyRing; import org.sufficientlysecure.keychain.pgp.KeyRing; @@ -190,13 +191,13 @@ public abstract class OperationResults { public static class EditKeyResult extends OperationResultParcel { private transient UncachedKeyRing mRing; - public final Long mRingMasterKeyId; + public final long mRingMasterKeyId; public EditKeyResult(int result, OperationLog log, UncachedKeyRing ring) { super(result, log); mRing = ring; - mRingMasterKeyId = ring != null ? ring.getMasterKeyId() : null; + mRingMasterKeyId = ring != null ? ring.getMasterKeyId() : Constants.key.none; } public UncachedKeyRing getRing() { @@ -205,18 +206,13 @@ public abstract class OperationResults { public EditKeyResult(Parcel source) { super(source); - mRingMasterKeyId = source.readInt() != 0 ? source.readLong() : null; + mRingMasterKeyId = source.readLong(); } @Override public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); - if (mRingMasterKeyId == null) { - dest.writeInt(0); - } else { - dest.writeInt(1); - dest.writeLong(mRingMasterKeyId); - } + dest.writeLong(mRingMasterKeyId); } public static Creator<EditKeyResult> CREATOR = new Creator<EditKeyResult>() { @@ -234,12 +230,12 @@ public abstract class OperationResults { public static class SaveKeyringResult extends OperationResultParcel { - public final Long mRingMasterKeyId; + public final long mRingMasterKeyId; public SaveKeyringResult(int result, OperationLog log, CanonicalizedKeyRing ring) { super(result, log); - mRingMasterKeyId = ring != null ? ring.getMasterKeyId() : null; + mRingMasterKeyId = ring != null ? ring.getMasterKeyId() : Constants.key.none; } // Some old key was updated |