aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/PgpEditKeyResult.java
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2015-01-03 13:55:06 +0100
committerVincent Breitmoser <valodim@mugenguild.com>2015-01-03 13:55:15 +0100
commit320f7d35efb059b99b31506426554e9a8f138d8f (patch)
treec30cfb5a180b61949c37ce0dc63c74374b24d27f /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/PgpEditKeyResult.java
parent5057ea1744eac05fc999db1756cf0d739ae41a72 (diff)
downloadopen-keychain-320f7d35efb059b99b31506426554e9a8f138d8f.tar.gz
open-keychain-320f7d35efb059b99b31506426554e9a8f138d8f.tar.bz2
open-keychain-320f7d35efb059b99b31506426554e9a8f138d8f.zip
encapsulate high level edit key into new operation class
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/PgpEditKeyResult.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/PgpEditKeyResult.java63
1 files changed, 63 insertions, 0 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/PgpEditKeyResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/PgpEditKeyResult.java
new file mode 100644
index 000000000..611353ac9
--- /dev/null
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/PgpEditKeyResult.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann <dominik@dominikschuermann.de>
+ * Copyright (C) 2014 Vincent Breitmoser <v.breitmoser@mugenguild.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package org.sufficientlysecure.keychain.operations.results;
+
+import android.os.Parcel;
+
+import org.sufficientlysecure.keychain.Constants;
+import org.sufficientlysecure.keychain.pgp.UncachedKeyRing;
+
+public class PgpEditKeyResult extends OperationResult {
+
+ private transient UncachedKeyRing mRing;
+ public final long mRingMasterKeyId;
+
+ public PgpEditKeyResult(int result, OperationLog log,
+ UncachedKeyRing ring) {
+ super(result, log);
+ mRing = ring;
+ mRingMasterKeyId = ring != null ? ring.getMasterKeyId() : Constants.key.none;
+ }
+
+ public UncachedKeyRing getRing() {
+ return mRing;
+ }
+
+ public PgpEditKeyResult(Parcel source) {
+ super(source);
+ mRingMasterKeyId = source.readLong();
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ super.writeToParcel(dest, flags);
+ dest.writeLong(mRingMasterKeyId);
+ }
+
+ public static Creator<PgpEditKeyResult> CREATOR = new Creator<PgpEditKeyResult>() {
+ public PgpEditKeyResult createFromParcel(final Parcel source) {
+ return new PgpEditKeyResult(source);
+ }
+
+ public PgpEditKeyResult[] newArray(final int size) {
+ return new PgpEditKeyResult[size];
+ }
+ };
+
+}