pending results are a type of non-success

This commit is contained in:
Vincent Breitmoser 2014-09-14 00:55:50 +02:00
parent 760b05273c
commit 03d103af07
6 changed files with 12 additions and 10 deletions

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) 2012-2014 Dominik Schürmann <dominik@dominikschuermann.de>
* Copyright (C) 2010-2014 Thialfihar <thi@thialfihar.org>
* 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

View File

@ -364,7 +364,7 @@ public class KeychainIntentService extends IntentService implements Progressable
outStream.close();
resultData.putParcelable(RESULT_DECRYPT_VERIFY_RESULT, decryptVerifyResult);
resultData.putParcelable(DecryptVerifyResult.EXTRA_RESULT, decryptVerifyResult);
/* Output */
@ -411,7 +411,7 @@ public class KeychainIntentService extends IntentService implements Progressable
DecryptVerifyResult decryptVerifyResult = builder.build().execute();
resultData.putParcelable(RESULT_DECRYPT_VERIFY_RESULT, decryptVerifyResult);
resultData.putParcelable(DecryptVerifyResult.EXTRA_RESULT, decryptVerifyResult);
/* Output */
OtherHelper.logDebugBundle(resultData, "resultData");

View File

@ -1,5 +1,6 @@
/*
* 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
@ -24,8 +25,8 @@ import org.openintents.openpgp.OpenPgpSignatureResult;
public class DecryptVerifyResult extends OperationResultParcel {
// the fourth bit indicates a "data pending" result!
public static final int RESULT_PENDING = 8;
// the fourth bit indicates a "data pending" result! (it's also a form of non-success)
public static final int RESULT_PENDING = RESULT_ERROR +8;
// fifth to sixth bit in addition indicate specific type of pending
public static final int RESULT_PENDING_ASYM_PASSPHRASE = RESULT_PENDING +16;

View File

@ -1,5 +1,5 @@
/*
* 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
@ -26,8 +26,8 @@ import java.util.Date;
public class SignEncryptResult extends OperationResultParcel {
// the fourth bit indicates a "data pending" result!
public static final int RESULT_PENDING = 8;
// the fourth bit indicates a "data pending" result! (it's also a form of non-success)
public static final int RESULT_PENDING = RESULT_ERROR +8;
// fifth to sixth bit in addition indicate specific type of pending
public static final int RESULT_PENDING_NFC = RESULT_PENDING +16;

View File

@ -179,7 +179,7 @@ public class DecryptFileFragment extends DecryptFragment {
Bundle returnData = message.getData();
DecryptVerifyResult result =
returnData.getParcelable(KeychainIntentService.RESULT_DECRYPT_VERIFY_RESULT);
returnData.getParcelable(DecryptVerifyResult.EXTRA_RESULT);
switch (result.getResult()) {
case DecryptVerifyResult.RESULT_PENDING_ASYM_PASSPHRASE:
@ -259,7 +259,7 @@ public class DecryptFileFragment extends DecryptFragment {
Bundle returnData = message.getData();
DecryptVerifyResult result =
returnData.getParcelable(KeychainIntentService.RESULT_DECRYPT_VERIFY_RESULT);
returnData.getParcelable(DecryptVerifyResult.EXTRA_RESULT);
if (result.isPending()) {
switch (result.getResult()) {

View File

@ -144,7 +144,7 @@ public class DecryptMessageFragment extends DecryptFragment {
Bundle returnData = message.getData();
DecryptVerifyResult result =
returnData.getParcelable(KeychainIntentService.RESULT_DECRYPT_VERIFY_RESULT);
returnData.getParcelable(DecryptVerifyResult.EXTRA_RESULT);
if (result.isPending()) {
switch (result.getResult()) {