From 7ff526724bfb9774aef3be18be6882eeec10d514 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Mon, 13 Oct 2014 01:19:35 +0200 Subject: forgot committing ExportResult class --- .../keychain/operations/results/ExportResult.java | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/ExportResult.java (limited to 'OpenKeychain/src') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/ExportResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/ExportResult.java new file mode 100644 index 000000000..c8edce259 --- /dev/null +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/ExportResult.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2014 Vincent Breitmoser + * + * 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 . + */ + +package org.sufficientlysecure.keychain.operations.results; + +import android.os.Parcel; + +public class ExportResult extends OperationResult { + + final int mOkPublic, mOkSecret; + + public ExportResult(int result, OperationLog log) { + this(result, log, 0, 0); + } + + public ExportResult(int result, OperationLog log, int okPublic, int okSecret) { + super(result, log); + mOkPublic = okPublic; + mOkSecret = okSecret; + } + + /** Construct from a parcel - trivial because we have no extra data. */ + public ExportResult(Parcel source) { + super(source); + mOkPublic = source.readInt(); + mOkSecret = source.readInt(); + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + super.writeToParcel(dest, flags); + dest.writeInt(mOkPublic); + dest.writeInt(mOkSecret); + } + + public static Creator CREATOR = new Creator() { + public ExportResult createFromParcel(final Parcel source) { + return new ExportResult(source); + } + + public ExportResult[] newArray(final int size) { + return new ExportResult[size]; + } + }; + +} -- cgit v1.2.3