From 0e0e3d8dd09deb2ff36d46ccceba08bb5c0967ce Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Sat, 4 Oct 2014 14:11:51 +0200 Subject: redesign certify action to work with parcel input and result --- .../keychain/service/results/CertifyResult.java | 57 ++++++++++++++++++++++ .../keychain/service/results/OperationResult.java | 17 ++++++- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/CertifyResult.java (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/CertifyResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/CertifyResult.java new file mode 100644 index 000000000..cf54238ec --- /dev/null +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/CertifyResult.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2014 Dominik Schürmann + * 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.service.results; + +import android.os.Parcel; + +public class CertifyResult extends OperationResult { + + int mCertifyOk, mCertifyError; + + public CertifyResult(int result, OperationLog log) { + super(result, log); + } + + public CertifyResult(int result, OperationLog log, int certifyOk, int certifyError) { + this(result, log); + mCertifyOk = certifyOk; + mCertifyError = certifyError; + } + + /** Construct from a parcel - trivial because we have no extra data. */ + public CertifyResult(Parcel source) { + super(source); + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + super.writeToParcel(dest, flags); + } + + public static Creator CREATOR = new Creator() { + public CertifyResult createFromParcel(final Parcel source) { + return new CertifyResult(source); + } + + public CertifyResult[] newArray(final int size) { + return new CertifyResult[size]; + } + }; + +} diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResult.java index 29924ee5d..90e1d0037 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResult.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResult.java @@ -517,8 +517,23 @@ public abstract class OperationResult implements Parcelable { MSG_SE_SIGCRYPTING (LogLevel.DEBUG, R.string.msg_se_sigcrypting), MSG_SE_SYMMETRIC (LogLevel.INFO, R.string.msg_se_symmetric), - MSG_CRT_UPLOAD_SUCCESS (LogLevel.OK, R.string.msg_crt_upload_success), + MSG_CRT_CERTIFYING (LogLevel.DEBUG, R.string.msg_crt_certifying), + MSG_CRT_CERTIFY_ALL (LogLevel.DEBUG, R.string.msg_crt_certify_all), + MSG_CRT_CERTIFY_SOME (LogLevel.DEBUG, R.plurals.msg_crt_certify_some), + MSG_CRT_ERROR_MASTER_NOT_FOUND (LogLevel.ERROR, R.string.msg_crt_error_master_not_found), + MSG_CRT_ERROR_UNLOCK (LogLevel.ERROR, R.string.msg_crt_error_unlock), + MSG_CRT_FP_MISMATCH (LogLevel.WARN, R.string.msg_crt_fp_mismatch), + MSG_CRT (LogLevel.START, R.string.msg_crt), + MSG_CRT_MASTER_FETCH (LogLevel.DEBUG, R.string.msg_crt_master_fetch), + MSG_CRT_SAVE (LogLevel.DEBUG, R.string.msg_crt_save), + MSG_CRT_SAVING (LogLevel.DEBUG, R.string.msg_crt_saving), MSG_CRT_SUCCESS (LogLevel.OK, R.string.msg_crt_success), + MSG_CRT_UNLOCK (LogLevel.DEBUG, R.string.msg_crt_unlock), + MSG_CRT_WARN_NOT_FOUND (LogLevel.WARN, R.string.msg_crt_warn_not_found), + MSG_CRT_WARN_CERT_FAILED (LogLevel.WARN, R.string.msg_crt_warn_cert_failed), + MSG_CRT_WARN_SAVE_FAILED (LogLevel.WARN, R.string.msg_crt_warn_save_failed), + + MSG_CRT_UPLOAD_SUCCESS (LogLevel.OK, R.string.msg_crt_upload_success), MSG_ACC_SAVED (LogLevel.INFO, R.string.api_settings_save_msg), -- cgit v1.2.3