work on OperationResultParcel

This commit is contained in:
Vincent Breitmoser 2014-09-14 01:14:58 +02:00
parent 03d103af07
commit 36ef8a9a62
30 changed files with 116 additions and 123 deletions

View File

@ -38,8 +38,8 @@ import org.spongycastle.bcpg.UserIDPacket;
import org.spongycastle.bcpg.sig.KeyFlags; import org.spongycastle.bcpg.sig.KeyFlags;
import org.spongycastle.jce.provider.BouncyCastleProvider; import org.spongycastle.jce.provider.BouncyCastleProvider;
import org.spongycastle.openpgp.PGPSignature; import org.spongycastle.openpgp.PGPSignature;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogType; import org.sufficientlysecure.keychain.service.results.OperationResult.LogType;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.OperationLog; import org.sufficientlysecure.keychain.service.results.OperationResult.OperationLog;
import org.sufficientlysecure.keychain.service.results.EditKeyResult; import org.sufficientlysecure.keychain.service.results.EditKeyResult;
import org.sufficientlysecure.keychain.service.SaveKeyringParcel; import org.sufficientlysecure.keychain.service.SaveKeyringParcel;
import org.sufficientlysecure.keychain.service.SaveKeyringParcel.Algorithm; import org.sufficientlysecure.keychain.service.SaveKeyringParcel.Algorithm;

View File

@ -46,7 +46,7 @@ import org.spongycastle.openpgp.operator.jcajce.JcaPGPContentSignerBuilder;
import org.spongycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder; import org.spongycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder;
import org.spongycastle.util.Strings; import org.spongycastle.util.Strings;
import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel; import org.sufficientlysecure.keychain.service.results.OperationResult;
import org.sufficientlysecure.keychain.service.results.EditKeyResult; import org.sufficientlysecure.keychain.service.results.EditKeyResult;
import org.sufficientlysecure.keychain.service.SaveKeyringParcel; import org.sufficientlysecure.keychain.service.SaveKeyringParcel;
import org.sufficientlysecure.keychain.service.SaveKeyringParcel.Algorithm; import org.sufficientlysecure.keychain.service.SaveKeyringParcel.Algorithm;
@ -75,7 +75,7 @@ public class UncachedKeyringCanonicalizeTest {
UncachedKeyRing ring; UncachedKeyRing ring;
ArrayList<RawPacket> onlyA = new ArrayList<RawPacket>(); ArrayList<RawPacket> onlyA = new ArrayList<RawPacket>();
ArrayList<RawPacket> onlyB = new ArrayList<RawPacket>(); ArrayList<RawPacket> onlyB = new ArrayList<RawPacket>();
OperationResultParcel.OperationLog log = new OperationResultParcel.OperationLog(); OperationResult.OperationLog log = new OperationResult.OperationLog();
PGPSignatureSubpacketGenerator subHashedPacketsGen; PGPSignatureSubpacketGenerator subHashedPacketsGen;
PGPSecretKey secretKey; PGPSecretKey secretKey;
@ -303,7 +303,7 @@ public class UncachedKeyringCanonicalizeTest {
parcel.mAddUserIds.add("trix"); parcel.mAddUserIds.add("trix");
PgpKeyOperation op = new PgpKeyOperation(null); PgpKeyOperation op = new PgpKeyOperation(null);
OperationResultParcel.OperationLog log = new OperationResultParcel.OperationLog(); OperationResult.OperationLog log = new OperationResult.OperationLog();
UncachedKeyRing foreign = op.createSecretKeyRing(parcel).getRing(); UncachedKeyRing foreign = op.createSecretKeyRing(parcel).getRing();
Assert.assertNotNull("initial test key creation must succeed", foreign); Assert.assertNotNull("initial test key creation must succeed", foreign);
@ -532,7 +532,7 @@ public class UncachedKeyringCanonicalizeTest {
private static void injectEverywhere(UncachedKeyRing ring, byte[] packet) throws Exception { private static void injectEverywhere(UncachedKeyRing ring, byte[] packet) throws Exception {
OperationResultParcel.OperationLog log = new OperationResultParcel.OperationLog(); OperationResult.OperationLog log = new OperationResult.OperationLog();
byte[] encodedRing = ring.getEncoded(); byte[] encodedRing = ring.getEncoded();

View File

@ -32,7 +32,7 @@ import org.spongycastle.bcpg.SecretKeyPacket;
import org.spongycastle.bcpg.sig.KeyFlags; import org.spongycastle.bcpg.sig.KeyFlags;
import org.spongycastle.jce.provider.BouncyCastleProvider; import org.spongycastle.jce.provider.BouncyCastleProvider;
import org.spongycastle.util.Strings; import org.spongycastle.util.Strings;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel; import org.sufficientlysecure.keychain.service.results.OperationResult;
import org.sufficientlysecure.keychain.service.results.EditKeyResult; import org.sufficientlysecure.keychain.service.results.EditKeyResult;
import org.sufficientlysecure.keychain.service.SaveKeyringParcel; import org.sufficientlysecure.keychain.service.SaveKeyringParcel;
import org.sufficientlysecure.keychain.service.SaveKeyringParcel.Algorithm; import org.sufficientlysecure.keychain.service.SaveKeyringParcel.Algorithm;
@ -77,7 +77,7 @@ public class UncachedKeyringMergeTest {
UncachedKeyRing ringA, ringB; UncachedKeyRing ringA, ringB;
ArrayList<RawPacket> onlyA = new ArrayList<RawPacket>(); ArrayList<RawPacket> onlyA = new ArrayList<RawPacket>();
ArrayList<RawPacket> onlyB = new ArrayList<RawPacket>(); ArrayList<RawPacket> onlyB = new ArrayList<RawPacket>();
OperationResultParcel.OperationLog log = new OperationResultParcel.OperationLog(); OperationResult.OperationLog log = new OperationResult.OperationLog();
PgpKeyOperation op; PgpKeyOperation op;
SaveKeyringParcel parcel; SaveKeyringParcel parcel;
@ -99,7 +99,7 @@ public class UncachedKeyringMergeTest {
parcel.mNewPassphrase = ""; parcel.mNewPassphrase = "";
PgpKeyOperation op = new PgpKeyOperation(null); PgpKeyOperation op = new PgpKeyOperation(null);
OperationResultParcel.OperationLog log = new OperationResultParcel.OperationLog(); OperationResult.OperationLog log = new OperationResult.OperationLog();
EditKeyResult result = op.createSecretKeyRing(parcel); EditKeyResult result = op.createSecretKeyRing(parcel);
staticRingA = result.getRing(); staticRingA = result.getRing();
@ -115,7 +115,7 @@ public class UncachedKeyringMergeTest {
parcel.mNewPassphrase = ""; parcel.mNewPassphrase = "";
PgpKeyOperation op = new PgpKeyOperation(null); PgpKeyOperation op = new PgpKeyOperation(null);
OperationResultParcel.OperationLog log = new OperationResultParcel.OperationLog(); OperationResult.OperationLog log = new OperationResult.OperationLog();
EditKeyResult result = op.createSecretKeyRing(parcel); EditKeyResult result = op.createSecretKeyRing(parcel);
staticRingB = result.getRing(); staticRingB = result.getRing();
} }

View File

@ -49,9 +49,9 @@ import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings; import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.provider.ProviderHelper;
import org.sufficientlysecure.keychain.service.results.DecryptVerifyResult; import org.sufficientlysecure.keychain.service.results.DecryptVerifyResult;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogLevel; import org.sufficientlysecure.keychain.service.results.OperationResult.LogLevel;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogType; import org.sufficientlysecure.keychain.service.results.OperationResult.LogType;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.OperationLog; import org.sufficientlysecure.keychain.service.results.OperationResult.OperationLog;
import org.sufficientlysecure.keychain.util.InputData; import org.sufficientlysecure.keychain.util.InputData;
import org.sufficientlysecure.keychain.util.Log; import org.sufficientlysecure.keychain.util.Log;
import org.sufficientlysecure.keychain.util.ProgressScaler; import org.sufficientlysecure.keychain.util.ProgressScaler;

View File

@ -33,9 +33,9 @@ import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
import org.sufficientlysecure.keychain.provider.KeychainContract; import org.sufficientlysecure.keychain.provider.KeychainContract;
import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.provider.ProviderHelper;
import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.service.KeychainIntentService;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogLevel; import org.sufficientlysecure.keychain.service.results.OperationResult.LogLevel;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogType; import org.sufficientlysecure.keychain.service.results.OperationResult.LogType;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.OperationLog; import org.sufficientlysecure.keychain.service.results.OperationResult.OperationLog;
import org.sufficientlysecure.keychain.service.results.ImportKeyResult; import org.sufficientlysecure.keychain.service.results.ImportKeyResult;
import org.sufficientlysecure.keychain.service.results.SaveKeyringResult; import org.sufficientlysecure.keychain.service.results.SaveKeyringResult;
import org.sufficientlysecure.keychain.util.IterableIterator; import org.sufficientlysecure.keychain.util.IterableIterator;

View File

@ -46,10 +46,10 @@ import org.spongycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder;
import org.spongycastle.openpgp.operator.jcajce.JcePBESecretKeyEncryptorBuilder; import org.spongycastle.openpgp.operator.jcajce.JcePBESecretKeyEncryptorBuilder;
import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel; import org.sufficientlysecure.keychain.service.results.OperationResult;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogLevel; import org.sufficientlysecure.keychain.service.results.OperationResult.LogLevel;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogType; import org.sufficientlysecure.keychain.service.results.OperationResult.LogType;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.OperationLog; import org.sufficientlysecure.keychain.service.results.OperationResult.OperationLog;
import org.sufficientlysecure.keychain.service.results.EditKeyResult; import org.sufficientlysecure.keychain.service.results.EditKeyResult;
import org.sufficientlysecure.keychain.service.SaveKeyringParcel; import org.sufficientlysecure.keychain.service.SaveKeyringParcel;
import org.sufficientlysecure.keychain.service.SaveKeyringParcel.Algorithm; import org.sufficientlysecure.keychain.service.SaveKeyringParcel.Algorithm;
@ -949,7 +949,7 @@ public class PgpKeyOperation {
progress(R.string.progress_done, 100); progress(R.string.progress_done, 100);
log.add(LogLevel.OK, LogType.MSG_MF_SUCCESS, indent); log.add(LogLevel.OK, LogType.MSG_MF_SUCCESS, indent);
return new EditKeyResult(OperationResultParcel.RESULT_OK, log, new UncachedKeyRing(sKR)); return new EditKeyResult(OperationResult.RESULT_OK, log, new UncachedKeyRing(sKR));
} }

View File

@ -36,9 +36,9 @@ import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException; import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings; import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.provider.ProviderHelper;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogLevel; import org.sufficientlysecure.keychain.service.results.OperationResult.LogLevel;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogType; import org.sufficientlysecure.keychain.service.results.OperationResult.LogType;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.OperationLog; import org.sufficientlysecure.keychain.service.results.OperationResult.OperationLog;
import org.sufficientlysecure.keychain.service.results.SignEncryptResult; import org.sufficientlysecure.keychain.service.results.SignEncryptResult;
import org.sufficientlysecure.keychain.util.InputData; import org.sufficientlysecure.keychain.util.InputData;
import org.sufficientlysecure.keychain.util.Log; import org.sufficientlysecure.keychain.util.Log;

View File

@ -34,12 +34,11 @@ import org.spongycastle.openpgp.PGPSignatureList;
import org.spongycastle.openpgp.PGPUtil; import org.spongycastle.openpgp.PGPUtil;
import org.spongycastle.openpgp.operator.jcajce.JcaKeyFingerprintCalculator; import org.spongycastle.openpgp.operator.jcajce.JcaKeyFingerprintCalculator;
import org.spongycastle.util.Strings; import org.spongycastle.util.Strings;
import org.spongycastle.util.encoders.Hex;
import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException; import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogLevel; import org.sufficientlysecure.keychain.service.results.OperationResult.LogLevel;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogType; import org.sufficientlysecure.keychain.service.results.OperationResult.LogType;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.OperationLog; import org.sufficientlysecure.keychain.service.results.OperationResult.OperationLog;
import org.sufficientlysecure.keychain.util.IterableIterator; import org.sufficientlysecure.keychain.util.IterableIterator;
import org.sufficientlysecure.keychain.util.Log; import org.sufficientlysecure.keychain.util.Log;

View File

@ -55,9 +55,9 @@ import org.sufficientlysecure.keychain.provider.KeychainContract.Keys;
import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds; import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds;
import org.sufficientlysecure.keychain.remote.AccountSettings; import org.sufficientlysecure.keychain.remote.AccountSettings;
import org.sufficientlysecure.keychain.remote.AppSettings; import org.sufficientlysecure.keychain.remote.AppSettings;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogLevel; import org.sufficientlysecure.keychain.service.results.OperationResult.LogLevel;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogType; import org.sufficientlysecure.keychain.service.results.OperationResult.LogType;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.OperationLog; import org.sufficientlysecure.keychain.service.results.OperationResult.OperationLog;
import org.sufficientlysecure.keychain.service.results.ConsolidateResult; import org.sufficientlysecure.keychain.service.results.ConsolidateResult;
import org.sufficientlysecure.keychain.service.results.SaveKeyringResult; import org.sufficientlysecure.keychain.service.results.SaveKeyringResult;
import org.sufficientlysecure.keychain.util.ParcelableFileCache; import org.sufficientlysecure.keychain.util.ParcelableFileCache;

View File

@ -32,7 +32,6 @@ import org.openintents.openpgp.OpenPgpSignatureResult;
import org.openintents.openpgp.util.OpenPgpApi; import org.openintents.openpgp.util.OpenPgpApi;
import org.sufficientlysecure.keychain.nfc.NfcActivity; import org.sufficientlysecure.keychain.nfc.NfcActivity;
import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.pgp.PgpDecryptVerify; import org.sufficientlysecure.keychain.pgp.PgpDecryptVerify;
import org.sufficientlysecure.keychain.provider.KeychainDatabase.Tables; import org.sufficientlysecure.keychain.provider.KeychainDatabase.Tables;
import org.sufficientlysecure.keychain.service.results.DecryptVerifyResult; import org.sufficientlysecure.keychain.service.results.DecryptVerifyResult;
@ -45,7 +44,7 @@ import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.provider.ProviderHelper;
import org.sufficientlysecure.keychain.remote.ui.RemoteServiceActivity; import org.sufficientlysecure.keychain.remote.ui.RemoteServiceActivity;
import org.sufficientlysecure.keychain.service.PassphraseCacheService; import org.sufficientlysecure.keychain.service.PassphraseCacheService;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogEntryParcel; import org.sufficientlysecure.keychain.service.results.OperationResult.LogEntryParcel;
import org.sufficientlysecure.keychain.service.results.SignEncryptResult; import org.sufficientlysecure.keychain.service.results.SignEncryptResult;
import org.sufficientlysecure.keychain.ui.ImportKeysActivity; import org.sufficientlysecure.keychain.ui.ImportKeysActivity;
import org.sufficientlysecure.keychain.ui.ViewKeyActivity; import org.sufficientlysecure.keychain.ui.ViewKeyActivity;

View File

@ -30,7 +30,10 @@ import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.ActionBarHelper; import org.sufficientlysecure.keychain.helper.ActionBarHelper;
import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.provider.ProviderHelper;
import org.sufficientlysecure.keychain.remote.AccountSettings; import org.sufficientlysecure.keychain.remote.AccountSettings;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel; import org.sufficientlysecure.keychain.service.results.OperationResult;
import org.sufficientlysecure.keychain.service.results.OperationResult.LogLevel;
import org.sufficientlysecure.keychain.service.results.OperationResult.LogType;
import org.sufficientlysecure.keychain.service.results.SingletonResult;
import org.sufficientlysecure.keychain.util.Log; import org.sufficientlysecure.keychain.util.Log;
public class AccountSettingsActivity extends ActionBarActivity { public class AccountSettingsActivity extends ActionBarActivity {
@ -105,9 +108,10 @@ public class AccountSettingsActivity extends ActionBarActivity {
private void save() { private void save() {
new ProviderHelper(this).updateApiAccount(mAccountUri, mAccountSettingsFragment.getAccSettings()); new ProviderHelper(this).updateApiAccount(mAccountUri, mAccountSettingsFragment.getAccSettings());
// TODO: show "account saved" instead of "operation succeeded" // TODO: show "account saved" instead of "operation succeeded"
OperationResultParcel result = new OperationResultParcel(OperationResultParcel.RESULT_OK, null); SingletonResult result = new SingletonResult(
SingletonResult.RESULT_OK, LogLevel.OK, LogType.MSG_ACC_SAVED);
Intent intent = new Intent(); Intent intent = new Intent();
intent.putExtra(OperationResultParcel.EXTRA_RESULT, result); intent.putExtra(SingletonResult.EXTRA_RESULT, result);
setResult(RESULT_OK, intent); setResult(RESULT_OK, intent);
finish(); finish();
} }
@ -115,8 +119,8 @@ public class AccountSettingsActivity extends ActionBarActivity {
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// if a result has been returned, display a notify // if a result has been returned, display a notify
if (data != null && data.hasExtra(OperationResultParcel.EXTRA_RESULT)) { if (data != null && data.hasExtra(OperationResult.EXTRA_RESULT)) {
OperationResultParcel result = data.getParcelableExtra(OperationResultParcel.EXTRA_RESULT); OperationResult result = data.getParcelableExtra(OperationResult.EXTRA_RESULT);
result.createNotify(this).show(); result.createNotify(this).show();
} else { } else {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);

View File

@ -33,7 +33,7 @@ import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.pgp.KeyRing; import org.sufficientlysecure.keychain.pgp.KeyRing;
import org.sufficientlysecure.keychain.remote.AccountSettings; import org.sufficientlysecure.keychain.remote.AccountSettings;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel; import org.sufficientlysecure.keychain.service.results.OperationResult;
import org.sufficientlysecure.keychain.service.results.SaveKeyringResult; import org.sufficientlysecure.keychain.service.results.SaveKeyringResult;
import org.sufficientlysecure.keychain.ui.CreateKeyActivity; import org.sufficientlysecure.keychain.ui.CreateKeyActivity;
import org.sufficientlysecure.keychain.ui.adapter.KeyValueSpinnerAdapter; import org.sufficientlysecure.keychain.ui.adapter.KeyValueSpinnerAdapter;
@ -171,8 +171,8 @@ public class AccountSettingsFragment extends Fragment {
switch (requestCode) { switch (requestCode) {
case REQUEST_CODE_CREATE_KEY: { case REQUEST_CODE_CREATE_KEY: {
if (resultCode == Activity.RESULT_OK) { if (resultCode == Activity.RESULT_OK) {
if (data != null && data.hasExtra(OperationResultParcel.EXTRA_RESULT)) { if (data != null && data.hasExtra(OperationResult.EXTRA_RESULT)) {
SaveKeyringResult result = data.getParcelableExtra(OperationResultParcel.EXTRA_RESULT); SaveKeyringResult result = data.getParcelableExtra(OperationResult.EXTRA_RESULT);
mSelectKeySpinner.setSelectedKeyId(result.mRingMasterKeyId); mSelectKeySpinner.setSelectedKeyId(result.mRingMasterKeyId);
} else { } else {
Log.e(Constants.TAG, "missing result!"); Log.e(Constants.TAG, "missing result!");

View File

@ -32,7 +32,7 @@ import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.provider.KeychainContract; import org.sufficientlysecure.keychain.provider.KeychainContract;
import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.provider.ProviderHelper;
import org.sufficientlysecure.keychain.remote.AppSettings; import org.sufficientlysecure.keychain.remote.AppSettings;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel; import org.sufficientlysecure.keychain.service.results.OperationResult;
import org.sufficientlysecure.keychain.util.Log; import org.sufficientlysecure.keychain.util.Log;
public class AppSettingsActivity extends ActionBarActivity { public class AppSettingsActivity extends ActionBarActivity {
@ -158,8 +158,8 @@ public class AppSettingsActivity extends ActionBarActivity {
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// if a result has been returned, display a notify // if a result has been returned, display a notify
if (data != null && data.hasExtra(OperationResultParcel.EXTRA_RESULT)) { if (data != null && data.hasExtra(OperationResult.EXTRA_RESULT)) {
OperationResultParcel result = data.getParcelableExtra(OperationResultParcel.EXTRA_RESULT); OperationResult result = data.getParcelableExtra(OperationResult.EXTRA_RESULT);
result.createNotify(this).show(); result.createNotify(this).show();
} else { } else {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);

View File

@ -55,10 +55,10 @@ import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRingData;
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings; import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
import org.sufficientlysecure.keychain.provider.KeychainDatabase; import org.sufficientlysecure.keychain.provider.KeychainDatabase;
import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.provider.ProviderHelper;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel; import org.sufficientlysecure.keychain.service.results.OperationResult;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogLevel; import org.sufficientlysecure.keychain.service.results.OperationResult.LogLevel;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogType; import org.sufficientlysecure.keychain.service.results.OperationResult.LogType;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.OperationLog; import org.sufficientlysecure.keychain.service.results.OperationResult.OperationLog;
import org.sufficientlysecure.keychain.service.results.ConsolidateResult; import org.sufficientlysecure.keychain.service.results.ConsolidateResult;
import org.sufficientlysecure.keychain.service.results.EditKeyResult; import org.sufficientlysecure.keychain.service.results.EditKeyResult;
import org.sufficientlysecure.keychain.service.results.ImportKeyResult; import org.sufficientlysecure.keychain.service.results.ImportKeyResult;
@ -813,9 +813,9 @@ public class KeychainIntentService extends IntentService implements Progressable
} }
} }
private void sendMessageToHandler(Integer arg1, OperationResultParcel data) { private void sendMessageToHandler(Integer arg1, OperationResult data) {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putParcelable(OperationResultParcel.EXTRA_RESULT, data); bundle.putParcelable(OperationResult.EXTRA_RESULT, data);
sendMessageToHandler(arg1, null, bundle); sendMessageToHandler(arg1, null, bundle);
} }

View File

@ -18,7 +18,7 @@
package org.sufficientlysecure.keychain.service.results; package org.sufficientlysecure.keychain.service.results;
public class ConsolidateResult extends OperationResultParcel { public class ConsolidateResult extends OperationResult {
public ConsolidateResult(int result, OperationLog log) { public ConsolidateResult(int result, OperationLog log) {
super(result, log); super(result, log);

View File

@ -23,7 +23,7 @@ import android.os.Parcel;
import org.openintents.openpgp.OpenPgpMetadata; import org.openintents.openpgp.OpenPgpMetadata;
import org.openintents.openpgp.OpenPgpSignatureResult; import org.openintents.openpgp.OpenPgpSignatureResult;
public class DecryptVerifyResult extends OperationResultParcel { public class DecryptVerifyResult extends OperationResult {
// the fourth bit indicates a "data pending" result! (it's also a form of non-success) // 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; public static final int RESULT_PENDING = RESULT_ERROR +8;

View File

@ -23,7 +23,7 @@ import android.os.Parcel;
import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.pgp.UncachedKeyRing; import org.sufficientlysecure.keychain.pgp.UncachedKeyRing;
public class EditKeyResult extends OperationResultParcel { public class EditKeyResult extends OperationResult {
private transient UncachedKeyRing mRing; private transient UncachedKeyRing mRing;
public final long mRingMasterKeyId; public final long mRingMasterKeyId;

View File

@ -34,7 +34,7 @@ import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.ui.LogDisplayActivity; import org.sufficientlysecure.keychain.ui.LogDisplayActivity;
import org.sufficientlysecure.keychain.ui.LogDisplayFragment; import org.sufficientlysecure.keychain.ui.LogDisplayFragment;
public class ImportKeyResult extends OperationResultParcel { public class ImportKeyResult extends OperationResult {
public final int mNewKeys, mUpdatedKeys, mBadKeys, mSecret; public final int mNewKeys, mUpdatedKeys, mBadKeys, mSecret;
@ -109,7 +109,7 @@ public class ImportKeyResult extends OperationResultParcel {
int duration, color; int duration, color;
// Not an overall failure // Not an overall failure
if ((resultType & OperationResultParcel.RESULT_ERROR) == 0) { if ((resultType & OperationResult.RESULT_ERROR) == 0) {
String withWarnings; String withWarnings;
duration = Duration.EXTRA_LONG; duration = Duration.EXTRA_LONG;

View File

@ -52,7 +52,7 @@ import java.util.List;
* TODO ideally, this class should be abstract, and all actual results of a specific subclass * TODO ideally, this class should be abstract, and all actual results of a specific subclass
* *
*/ */
public class OperationResultParcel implements Parcelable { public abstract class OperationResult implements Parcelable {
public static final String EXTRA_RESULT = "operation_result"; public static final String EXTRA_RESULT = "operation_result";
@ -71,12 +71,12 @@ public class OperationResultParcel implements Parcelable {
/// A list of log entries tied to the operation result. /// A list of log entries tied to the operation result.
final OperationLog mLog; final OperationLog mLog;
public OperationResultParcel(int result, OperationLog log) { public OperationResult(int result, OperationLog log) {
mResult = result; mResult = result;
mLog = log; mLog = log;
} }
public OperationResultParcel(Parcel source) { public OperationResult(Parcel source) {
mResult = source.readInt(); mResult = source.readInt();
mLog = new OperationLog(); mLog = new OperationLog();
mLog.addAll(source.createTypedArrayList(LogEntryParcel.CREATOR)); mLog.addAll(source.createTypedArrayList(LogEntryParcel.CREATOR));
@ -156,25 +156,22 @@ public class OperationResultParcel implements Parcelable {
public SuperCardToast createNotify(final Activity activity) { public SuperCardToast createNotify(final Activity activity) {
String str;
int color; int color;
// Take the last message as string
String str = activity.getString(mLog.getLast().mType.getMsgId());
// Not an overall failure // Not an overall failure
if (cancelled()) { if (cancelled()) {
color = Style.RED; color = Style.RED;
str = "operation cancelled!";
} else if (success()) { } else if (success()) {
if (getLog().containsWarnings()) { if (getLog().containsWarnings()) {
color = Style.ORANGE; color = Style.ORANGE;
} else { } else {
color = Style.GREEN; color = Style.GREEN;
} }
str = "operation succeeded!";
// str = activity.getString(R.string.import_error);
} else { } else {
color = Style.RED; color = Style.RED;
str = "operation failed";
// str = activity.getString(R.string.import_error);
} }
boolean button = getLog() != null && !getLog().isEmpty(); boolean button = getLog() != null && !getLog().isEmpty();
@ -197,7 +194,7 @@ public class OperationResultParcel implements Parcelable {
public void onClick(View view, Parcelable token) { public void onClick(View view, Parcelable token) {
Intent intent = new Intent( Intent intent = new Intent(
activity, LogDisplayActivity.class); activity, LogDisplayActivity.class);
intent.putExtra(LogDisplayFragment.EXTRA_RESULT, OperationResultParcel.this); intent.putExtra(LogDisplayFragment.EXTRA_RESULT, OperationResult.this);
activity.startActivity(intent); activity.startActivity(intent);
} }
} }
@ -498,6 +495,11 @@ public class OperationResultParcel implements Parcelable {
MSG_SE_SIGCRYPTING (R.string.msg_se_sigcrypting), MSG_SE_SIGCRYPTING (R.string.msg_se_sigcrypting),
MSG_SE_SYMMETRIC (R.string.msg_se_symmetric), MSG_SE_SYMMETRIC (R.string.msg_se_symmetric),
MSG_CRT_UPLOAD_SUCCESS (R.string.msg_crt_upload_success),
MSG_CRT_SUCCESS (R.string.msg_crt_success),
MSG_ACC_SAVED (R.string.api_settings_save)
; ;
private final int mMsgId; private final int mMsgId;
@ -533,27 +535,17 @@ public class OperationResultParcel implements Parcelable {
} }
} }
public static final Creator<OperationResultParcel> CREATOR = new Creator<OperationResultParcel>() {
public OperationResultParcel createFromParcel(final Parcel source) {
return new OperationResultParcel(source);
}
public OperationResultParcel[] newArray(final int size) {
return new OperationResultParcel[size];
}
};
public static class OperationLog implements Iterable<LogEntryParcel> { public static class OperationLog implements Iterable<LogEntryParcel> {
private final List<LogEntryParcel> mParcels = new ArrayList<LogEntryParcel>(); private final List<LogEntryParcel> mParcels = new ArrayList<LogEntryParcel>();
/// Simple convenience method /// Simple convenience method
public void add(LogLevel level, LogType type, int indent, Object... parameters) { public void add(LogLevel level, LogType type, int indent, Object... parameters) {
mParcels.add(new OperationResultParcel.LogEntryParcel(level, type, indent, parameters)); mParcels.add(new OperationResult.LogEntryParcel(level, type, indent, parameters));
} }
public void add(LogLevel level, LogType type, int indent) { public void add(LogLevel level, LogType type, int indent) {
mParcels.add(new OperationResultParcel.LogEntryParcel(level, type, indent, (Object[]) null)); mParcels.add(new OperationResult.LogEntryParcel(level, type, indent, (Object[]) null));
} }
public boolean containsType(LogType type) { public boolean containsType(LogType type) {

View File

@ -23,7 +23,7 @@ import android.os.Parcel;
import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.pgp.CanonicalizedKeyRing; import org.sufficientlysecure.keychain.pgp.CanonicalizedKeyRing;
public class SaveKeyringResult extends OperationResultParcel { public class SaveKeyringResult extends OperationResult {
public final long mRingMasterKeyId; public final long mRingMasterKeyId;

View File

@ -19,12 +19,9 @@ package org.sufficientlysecure.keychain.service.results;
import android.os.Parcel; import android.os.Parcel;
import org.openintents.openpgp.OpenPgpMetadata;
import org.openintents.openpgp.OpenPgpSignatureResult;
import java.util.Date; import java.util.Date;
public class SignEncryptResult extends OperationResultParcel { public class SignEncryptResult extends OperationResult {
// the fourth bit indicates a "data pending" result! (it's also a form of non-success) // 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; public static final int RESULT_PENDING = RESULT_ERROR +8;

View File

@ -27,7 +27,7 @@ import com.github.johnpersano.supertoasts.util.Style;
/** This is a simple subclass meant to contain only a single log message. This log /** This is a simple subclass meant to contain only a single log message. This log
* message is also shown without a log button in the createNotify SuperToast. */ * message is also shown without a log button in the createNotify SuperToast. */
public class SingletonResult extends OperationResultParcel { public class SingletonResult extends OperationResult {
/** Construct from a parcel - trivial because we have no extra data. */ /** Construct from a parcel - trivial because we have no extra data. */
public SingletonResult(Parcel source) { public SingletonResult(Parcel source) {

View File

@ -54,8 +54,11 @@ import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds; import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds;
import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.service.KeychainIntentService;
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel; import org.sufficientlysecure.keychain.service.results.OperationResult;
import org.sufficientlysecure.keychain.service.PassphraseCacheService; import org.sufficientlysecure.keychain.service.PassphraseCacheService;
import org.sufficientlysecure.keychain.service.results.OperationResult.LogLevel;
import org.sufficientlysecure.keychain.service.results.OperationResult.LogType;
import org.sufficientlysecure.keychain.service.results.SingletonResult;
import org.sufficientlysecure.keychain.ui.adapter.UserIdsAdapter; import org.sufficientlysecure.keychain.ui.adapter.UserIdsAdapter;
import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment; import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment;
import org.sufficientlysecure.keychain.ui.widget.CertifyKeySpinner; import org.sufficientlysecure.keychain.ui.widget.CertifyKeySpinner;
@ -327,12 +330,10 @@ public class CertifyKeyFragment extends LoaderFragment
if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) { if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
// Notify.showNotify(CertifyKeyActivity.this, R.string.key_certify_success, SingletonResult result = new SingletonResult(
// Notify.Style.INFO); SingletonResult.RESULT_OK, LogLevel.OK, LogType.MSG_CRT_SUCCESS);
OperationResultParcel result = new OperationResultParcel(OperationResultParcel.RESULT_OK, null);
Intent intent = new Intent(); Intent intent = new Intent();
intent.putExtra(OperationResultParcel.EXTRA_RESULT, result); intent.putExtra(SingletonResult.EXTRA_RESULT, result);
mActivity.setResult(CertifyKeyActivity.RESULT_OK, intent); mActivity.setResult(CertifyKeyActivity.RESULT_OK, intent);
// check if we need to send the key to the server or not // check if we need to send the key to the server or not
@ -383,12 +384,10 @@ public class CertifyKeyFragment extends LoaderFragment
super.handleMessage(message); super.handleMessage(message);
if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) { if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
//Notify.showNotify(CertifyKeyActivity.this, R.string.key_send_success, SingletonResult result = new SingletonResult(SingletonResult.RESULT_OK,
//Notify.Style.INFO); LogLevel.OK, LogType.MSG_CRT_UPLOAD_SUCCESS);
OperationResultParcel result = new OperationResultParcel(OperationResultParcel.RESULT_OK, null);
Intent intent = new Intent(); Intent intent = new Intent();
intent.putExtra(OperationResultParcel.EXTRA_RESULT, result); intent.putExtra(SingletonResult.EXTRA_RESULT, result);
mActivity.setResult(CertifyKeyActivity.RESULT_OK, intent); mActivity.setResult(CertifyKeyActivity.RESULT_OK, intent);
mActivity.finish(); mActivity.finish();
} }

View File

@ -39,7 +39,7 @@ import org.sufficientlysecure.keychain.pgp.KeyRing;
import org.sufficientlysecure.keychain.provider.KeychainContract; import org.sufficientlysecure.keychain.provider.KeychainContract;
import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.service.KeychainIntentService;
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel; import org.sufficientlysecure.keychain.service.results.OperationResult;
import org.sufficientlysecure.keychain.service.SaveKeyringParcel; import org.sufficientlysecure.keychain.service.SaveKeyringParcel;
import org.sufficientlysecure.keychain.service.SaveKeyringParcel.Algorithm; import org.sufficientlysecure.keychain.service.SaveKeyringParcel.Algorithm;
import org.sufficientlysecure.keychain.service.results.SaveKeyringResult; import org.sufficientlysecure.keychain.service.results.SaveKeyringResult;
@ -141,7 +141,7 @@ public class CreateKeyFinalFragment extends Fragment {
return; return;
} }
final SaveKeyringResult result = final SaveKeyringResult result =
returnData.getParcelable(OperationResultParcel.EXTRA_RESULT); returnData.getParcelable(OperationResult.EXTRA_RESULT);
if (result == null) { if (result == null) {
Log.e(Constants.TAG, "result == null"); Log.e(Constants.TAG, "result == null");
return; return;
@ -152,7 +152,7 @@ public class CreateKeyFinalFragment extends Fragment {
uploadKey(result); uploadKey(result);
} else { } else {
Intent data = new Intent(); Intent data = new Intent();
data.putExtra(OperationResultParcel.EXTRA_RESULT, result); data.putExtra(OperationResult.EXTRA_RESULT, result);
getActivity().setResult(Activity.RESULT_OK, data); getActivity().setResult(Activity.RESULT_OK, data);
getActivity().finish(); getActivity().finish();
} }
@ -223,7 +223,7 @@ public class CreateKeyFinalFragment extends Fragment {
//Notify.Style.INFO); //Notify.Style.INFO);
Intent data = new Intent(); Intent data = new Intent();
data.putExtra(OperationResultParcel.EXTRA_RESULT, saveKeyResult); data.putExtra(OperationResult.EXTRA_RESULT, saveKeyResult);
getActivity().setResult(Activity.RESULT_OK, data); getActivity().setResult(Activity.RESULT_OK, data);
getActivity().finish(); getActivity().finish();
} }

View File

@ -48,9 +48,9 @@ import org.sufficientlysecure.keychain.provider.ProviderHelper;
import org.sufficientlysecure.keychain.provider.ProviderHelper.NotFoundException; import org.sufficientlysecure.keychain.provider.ProviderHelper.NotFoundException;
import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.service.KeychainIntentService;
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel; import org.sufficientlysecure.keychain.service.results.OperationResult;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogLevel; import org.sufficientlysecure.keychain.service.results.OperationResult.LogLevel;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogType; import org.sufficientlysecure.keychain.service.results.OperationResult.LogType;
import org.sufficientlysecure.keychain.service.results.SingletonResult; import org.sufficientlysecure.keychain.service.results.SingletonResult;
import org.sufficientlysecure.keychain.service.PassphraseCacheService; import org.sufficientlysecure.keychain.service.PassphraseCacheService;
import org.sufficientlysecure.keychain.service.SaveKeyringParcel; import org.sufficientlysecure.keychain.service.SaveKeyringParcel;
@ -541,8 +541,8 @@ public class EditKeyFragment extends LoaderFragment implements
if (returnData == null) { if (returnData == null) {
return; return;
} }
final OperationResultParcel result = final OperationResult result =
returnData.getParcelable(OperationResultParcel.EXTRA_RESULT); returnData.getParcelable(OperationResult.EXTRA_RESULT);
if (result == null) { if (result == null) {
return; return;
} }
@ -555,7 +555,7 @@ public class EditKeyFragment extends LoaderFragment implements
// if good -> finish, return result to showkey and display there! // if good -> finish, return result to showkey and display there!
Intent intent = new Intent(); Intent intent = new Intent();
intent.putExtra(OperationResultParcel.EXTRA_RESULT, result); intent.putExtra(OperationResult.EXTRA_RESULT, result);
getActivity().setResult(EditKeyActivity.RESULT_OK, intent); getActivity().setResult(EditKeyActivity.RESULT_OK, intent);
getActivity().finish(); getActivity().finish();
@ -590,7 +590,7 @@ public class EditKeyFragment extends LoaderFragment implements
// Prepare an intent with an EXTRA_RESULT // Prepare an intent with an EXTRA_RESULT
Intent intent = new Intent(); Intent intent = new Intent();
intent.putExtra(OperationResultParcel.EXTRA_RESULT, intent.putExtra(OperationResult.EXTRA_RESULT,
new SingletonResult(SingletonResult.RESULT_ERROR, LogLevel.ERROR, reason)); new SingletonResult(SingletonResult.RESULT_ERROR, LogLevel.ERROR, reason));
// Finish with result // Finish with result

View File

@ -46,7 +46,7 @@ import org.sufficientlysecure.keychain.keyimport.ParcelableKeyRing;
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.service.KeychainIntentService;
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel; import org.sufficientlysecure.keychain.service.results.OperationResult;
import org.sufficientlysecure.keychain.service.results.ImportKeyResult; import org.sufficientlysecure.keychain.service.results.ImportKeyResult;
import org.sufficientlysecure.keychain.ui.adapter.PagerTabStripAdapter; import org.sufficientlysecure.keychain.ui.adapter.PagerTabStripAdapter;
import org.sufficientlysecure.keychain.ui.widget.SlidingTabLayout; import org.sufficientlysecure.keychain.ui.widget.SlidingTabLayout;
@ -459,7 +459,7 @@ public class ImportKeysActivity extends ActionBarActivity {
return; return;
} }
final ImportKeyResult result = final ImportKeyResult result =
returnData.getParcelable(OperationResultParcel.EXTRA_RESULT); returnData.getParcelable(OperationResult.EXTRA_RESULT);
if (result == null) { if (result == null) {
Log.e(Constants.TAG, "result == null"); Log.e(Constants.TAG, "result == null");
return; return;

View File

@ -34,7 +34,7 @@ import org.sufficientlysecure.keychain.provider.KeychainContract;
import org.sufficientlysecure.keychain.provider.KeychainDatabase; import org.sufficientlysecure.keychain.provider.KeychainDatabase;
import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.service.KeychainIntentService;
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel; import org.sufficientlysecure.keychain.service.results.OperationResult;
import org.sufficientlysecure.keychain.service.results.ConsolidateResult; import org.sufficientlysecure.keychain.service.results.ConsolidateResult;
import org.sufficientlysecure.keychain.util.Log; import org.sufficientlysecure.keychain.util.Log;
import org.sufficientlysecure.keychain.util.Notify; import org.sufficientlysecure.keychain.util.Notify;
@ -166,7 +166,7 @@ public class KeyListActivity extends DrawerActivity {
return; return;
} }
final ConsolidateResult result = final ConsolidateResult result =
returnData.getParcelable(OperationResultParcel.EXTRA_RESULT); returnData.getParcelable(OperationResult.EXTRA_RESULT);
if (result == null) { if (result == null) {
return; return;
} }
@ -201,8 +201,8 @@ public class KeyListActivity extends DrawerActivity {
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// if a result has been returned, display a notify // if a result has been returned, display a notify
if (data != null && data.hasExtra(OperationResultParcel.EXTRA_RESULT)) { if (data != null && data.hasExtra(OperationResult.EXTRA_RESULT)) {
OperationResultParcel result = data.getParcelableExtra(OperationResultParcel.EXTRA_RESULT); OperationResult result = data.getParcelableExtra(OperationResult.EXTRA_RESULT);
result.createNotify(this).show(); result.createNotify(this).show();
} else { } else {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);

View File

@ -37,9 +37,9 @@ import android.widget.TextView;
import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel; import org.sufficientlysecure.keychain.service.results.OperationResult;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogEntryParcel; import org.sufficientlysecure.keychain.service.results.OperationResult.LogEntryParcel;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogLevel; import org.sufficientlysecure.keychain.service.results.OperationResult.LogLevel;
import org.sufficientlysecure.keychain.util.Log; import org.sufficientlysecure.keychain.util.Log;
import java.util.HashMap; import java.util.HashMap;
@ -50,7 +50,7 @@ public class LogDisplayFragment extends ListFragment implements OnTouchListener
LogAdapter mAdapter; LogAdapter mAdapter;
LogLevel mLevel = LogLevel.DEBUG; LogLevel mLevel = LogLevel.DEBUG;
OperationResultParcel mResult; OperationResult mResult;
GestureDetector mDetector; GestureDetector mDetector;
@ -66,7 +66,7 @@ public class LogDisplayFragment extends ListFragment implements OnTouchListener
return; return;
} }
mResult = intent.<OperationResultParcel>getParcelableExtra(EXTRA_RESULT); mResult = intent.<OperationResult>getParcelableExtra(EXTRA_RESULT);
if (mResult == null) { if (mResult == null) {
getActivity().finish(); getActivity().finish();
return; return;
@ -135,7 +135,7 @@ public class LogDisplayFragment extends ListFragment implements OnTouchListener
private LayoutInflater mInflater; private LayoutInflater mInflater;
private int dipFactor; private int dipFactor;
public LogAdapter(Context context, OperationResultParcel.OperationLog log, LogLevel level) { public LogAdapter(Context context, OperationResult.OperationLog log, LogLevel level) {
super(context, R.layout.log_display_item); super(context, R.layout.log_display_item);
mInflater = LayoutInflater.from(getContext()); mInflater = LayoutInflater.from(getContext());
dipFactor = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dipFactor = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,

View File

@ -56,7 +56,7 @@ import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
import org.sufficientlysecure.keychain.provider.KeychainContract; import org.sufficientlysecure.keychain.provider.KeychainContract;
import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.provider.ProviderHelper;
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
import org.sufficientlysecure.keychain.service.results.OperationResultParcel; import org.sufficientlysecure.keychain.service.results.OperationResult;
import org.sufficientlysecure.keychain.ui.adapter.PagerTabStripAdapter; import org.sufficientlysecure.keychain.ui.adapter.PagerTabStripAdapter;
import org.sufficientlysecure.keychain.ui.widget.SlidingTabLayout; import org.sufficientlysecure.keychain.ui.widget.SlidingTabLayout;
import org.sufficientlysecure.keychain.ui.widget.SlidingTabLayout.TabColorizer; import org.sufficientlysecure.keychain.ui.widget.SlidingTabLayout.TabColorizer;
@ -322,8 +322,8 @@ public class ViewKeyActivity extends ActionBarActivity implements
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// if a result has been returned, display a notify // if a result has been returned, display a notify
if (data != null && data.hasExtra(OperationResultParcel.EXTRA_RESULT)) { if (data != null && data.hasExtra(OperationResult.EXTRA_RESULT)) {
OperationResultParcel result = data.getParcelableExtra(OperationResultParcel.EXTRA_RESULT); OperationResult result = data.getParcelableExtra(OperationResult.EXTRA_RESULT);
result.createNotify(this).show(); result.createNotify(this).show();
} else { } else {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);

View File

@ -214,8 +214,6 @@
<item quantity="other">"%d bad secret keys ignored. Perhaps you exported with the option\n --export-secret-subkeys\nMake sure you export with\n --export-secret-keys\ninstead.""</item> <item quantity="other">"%d bad secret keys ignored. Perhaps you exported with the option\n --export-secret-subkeys\nMake sure you export with\n --export-secret-keys\ninstead.""</item>
</plurals> </plurals>
<string name="key_send_success">"Successfully uploaded key to server"</string>
<string name="key_certify_success">"Successfully certified identities"</string>
<string name="list_empty">"This list is empty!"</string> <string name="list_empty">"This list is empty!"</string>
<string name="nfc_successful">"Successfully sent key with NFC Beam!"</string> <string name="nfc_successful">"Successfully sent key with NFC Beam!"</string>
<string name="key_copied_to_clipboard">"Key has been copied to the clipboard!"</string> <string name="key_copied_to_clipboard">"Key has been copied to the clipboard!"</string>
@ -827,6 +825,11 @@
<string name="msg_se">"Starting sign and/or encrypt operation"</string> <string name="msg_se">"Starting sign and/or encrypt operation"</string>
<string name="msg_se_symmetric">"Preparing symmetric encryption"</string> <string name="msg_se_symmetric">"Preparing symmetric encryption"</string>
<string name="msg_crt_upload_success">"Successfully uploaded key to server"</string>
<string name="msg_crt_success">"Successfully certified identities"</string>
<string name="msg_acc_saved">"Account saved"</string>
<!-- PassphraseCache --> <!-- PassphraseCache -->
<string name="passp_cache_notif_click_to_clear">"Click to clear cached passphrases"</string> <string name="passp_cache_notif_click_to_clear">"Click to clear cached passphrases"</string>
<string name="passp_cache_notif_n_keys">"OpenKeychain has cached %d passphrases"</string> <string name="passp_cache_notif_n_keys">"OpenKeychain has cached %d passphrases"</string>