diff --git a/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java b/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java index 6cd30a205..21b2843d1 100644 --- a/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java +++ b/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java @@ -38,8 +38,8 @@ import org.spongycastle.bcpg.UserIDPacket; import org.spongycastle.bcpg.sig.KeyFlags; import org.spongycastle.jce.provider.BouncyCastleProvider; import org.spongycastle.openpgp.PGPSignature; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogType; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.OperationLog; +import org.sufficientlysecure.keychain.service.results.OperationResult.LogType; +import org.sufficientlysecure.keychain.service.results.OperationResult.OperationLog; import org.sufficientlysecure.keychain.service.results.EditKeyResult; import org.sufficientlysecure.keychain.service.SaveKeyringParcel; import org.sufficientlysecure.keychain.service.SaveKeyringParcel.Algorithm; diff --git a/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringCanonicalizeTest.java b/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringCanonicalizeTest.java index 08dcacea5..4fae49694 100644 --- a/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringCanonicalizeTest.java +++ b/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringCanonicalizeTest.java @@ -46,7 +46,7 @@ import org.spongycastle.openpgp.operator.jcajce.JcaPGPContentSignerBuilder; import org.spongycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder; import org.spongycastle.util.Strings; 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.SaveKeyringParcel; import org.sufficientlysecure.keychain.service.SaveKeyringParcel.Algorithm; @@ -75,7 +75,7 @@ public class UncachedKeyringCanonicalizeTest { UncachedKeyRing ring; ArrayList onlyA = new ArrayList(); ArrayList onlyB = new ArrayList(); - OperationResultParcel.OperationLog log = new OperationResultParcel.OperationLog(); + OperationResult.OperationLog log = new OperationResult.OperationLog(); PGPSignatureSubpacketGenerator subHashedPacketsGen; PGPSecretKey secretKey; @@ -303,7 +303,7 @@ public class UncachedKeyringCanonicalizeTest { parcel.mAddUserIds.add("trix"); PgpKeyOperation op = new PgpKeyOperation(null); - OperationResultParcel.OperationLog log = new OperationResultParcel.OperationLog(); + OperationResult.OperationLog log = new OperationResult.OperationLog(); UncachedKeyRing foreign = op.createSecretKeyRing(parcel).getRing(); 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 { - OperationResultParcel.OperationLog log = new OperationResultParcel.OperationLog(); + OperationResult.OperationLog log = new OperationResult.OperationLog(); byte[] encodedRing = ring.getEncoded(); diff --git a/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringMergeTest.java b/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringMergeTest.java index 8cfed42e4..789e1bbb1 100644 --- a/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringMergeTest.java +++ b/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringMergeTest.java @@ -32,7 +32,7 @@ import org.spongycastle.bcpg.SecretKeyPacket; import org.spongycastle.bcpg.sig.KeyFlags; import org.spongycastle.jce.provider.BouncyCastleProvider; 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.SaveKeyringParcel; import org.sufficientlysecure.keychain.service.SaveKeyringParcel.Algorithm; @@ -77,7 +77,7 @@ public class UncachedKeyringMergeTest { UncachedKeyRing ringA, ringB; ArrayList onlyA = new ArrayList(); ArrayList onlyB = new ArrayList(); - OperationResultParcel.OperationLog log = new OperationResultParcel.OperationLog(); + OperationResult.OperationLog log = new OperationResult.OperationLog(); PgpKeyOperation op; SaveKeyringParcel parcel; @@ -99,7 +99,7 @@ public class UncachedKeyringMergeTest { parcel.mNewPassphrase = ""; PgpKeyOperation op = new PgpKeyOperation(null); - OperationResultParcel.OperationLog log = new OperationResultParcel.OperationLog(); + OperationResult.OperationLog log = new OperationResult.OperationLog(); EditKeyResult result = op.createSecretKeyRing(parcel); staticRingA = result.getRing(); @@ -115,7 +115,7 @@ public class UncachedKeyringMergeTest { parcel.mNewPassphrase = ""; PgpKeyOperation op = new PgpKeyOperation(null); - OperationResultParcel.OperationLog log = new OperationResultParcel.OperationLog(); + OperationResult.OperationLog log = new OperationResult.OperationLog(); EditKeyResult result = op.createSecretKeyRing(parcel); staticRingB = result.getRing(); } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java index 6e59a3b9b..58ca2b54a 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java @@ -49,9 +49,9 @@ import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException; import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings; import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.service.results.DecryptVerifyResult; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogLevel; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogType; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.OperationLog; +import org.sufficientlysecure.keychain.service.results.OperationResult.LogLevel; +import org.sufficientlysecure.keychain.service.results.OperationResult.LogType; +import org.sufficientlysecure.keychain.service.results.OperationResult.OperationLog; import org.sufficientlysecure.keychain.util.InputData; import org.sufficientlysecure.keychain.util.Log; import org.sufficientlysecure.keychain.util.ProgressScaler; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java index 06415cf8a..1c994dceb 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java @@ -33,9 +33,9 @@ import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException; import org.sufficientlysecure.keychain.provider.KeychainContract; import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.service.KeychainIntentService; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogLevel; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogType; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.OperationLog; +import org.sufficientlysecure.keychain.service.results.OperationResult.LogLevel; +import org.sufficientlysecure.keychain.service.results.OperationResult.LogType; +import org.sufficientlysecure.keychain.service.results.OperationResult.OperationLog; import org.sufficientlysecure.keychain.service.results.ImportKeyResult; import org.sufficientlysecure.keychain.service.results.SaveKeyringResult; import org.sufficientlysecure.keychain.util.IterableIterator; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java index ad592a3e9..4ee4ac74c 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java @@ -46,10 +46,10 @@ import org.spongycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder; import org.spongycastle.openpgp.operator.jcajce.JcePBESecretKeyEncryptorBuilder; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogLevel; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogType; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.OperationLog; +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.OperationResult.OperationLog; import org.sufficientlysecure.keychain.service.results.EditKeyResult; import org.sufficientlysecure.keychain.service.SaveKeyringParcel; import org.sufficientlysecure.keychain.service.SaveKeyringParcel.Algorithm; @@ -949,7 +949,7 @@ public class PgpKeyOperation { progress(R.string.progress_done, 100); 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)); } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java index a81fa1a5a..e4ed740a5 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java @@ -36,9 +36,9 @@ import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException; import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings; import org.sufficientlysecure.keychain.provider.ProviderHelper; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogLevel; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogType; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.OperationLog; +import org.sufficientlysecure.keychain.service.results.OperationResult.LogLevel; +import org.sufficientlysecure.keychain.service.results.OperationResult.LogType; +import org.sufficientlysecure.keychain.service.results.OperationResult.OperationLog; import org.sufficientlysecure.keychain.service.results.SignEncryptResult; import org.sufficientlysecure.keychain.util.InputData; import org.sufficientlysecure.keychain.util.Log; @@ -367,7 +367,7 @@ public class PgpSignEncrypt { KeyRings.buildUnifiedKeyRingUri(id)); CanonicalizedPublicKey key = keyRing.getEncryptionSubKey(); cPk.addMethod(key.getPubKeyEncryptionGenerator()); - log.add(LogLevel.DEBUG, LogType.MSG_SE_KEY_OK, indent +1, + log.add(LogLevel.DEBUG, LogType.MSG_SE_KEY_OK, indent + 1, PgpKeyHelper.convertKeyIdToHex(id)); } catch (PgpGeneralException e) { log.add(LogLevel.WARN, LogType.MSG_SE_KEY_WARN, indent +1, diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java index d64c3ea55..c76ecbfab 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java @@ -34,12 +34,11 @@ import org.spongycastle.openpgp.PGPSignatureList; import org.spongycastle.openpgp.PGPUtil; import org.spongycastle.openpgp.operator.jcajce.JcaKeyFingerprintCalculator; import org.spongycastle.util.Strings; -import org.spongycastle.util.encoders.Hex; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogLevel; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogType; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.OperationLog; +import org.sufficientlysecure.keychain.service.results.OperationResult.LogLevel; +import org.sufficientlysecure.keychain.service.results.OperationResult.LogType; +import org.sufficientlysecure.keychain.service.results.OperationResult.OperationLog; import org.sufficientlysecure.keychain.util.IterableIterator; import org.sufficientlysecure.keychain.util.Log; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java index 8e6a0dfa5..d2540a97d 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java @@ -55,9 +55,9 @@ import org.sufficientlysecure.keychain.provider.KeychainContract.Keys; import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds; import org.sufficientlysecure.keychain.remote.AccountSettings; import org.sufficientlysecure.keychain.remote.AppSettings; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogLevel; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogType; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.OperationLog; +import org.sufficientlysecure.keychain.service.results.OperationResult.LogLevel; +import org.sufficientlysecure.keychain.service.results.OperationResult.LogType; +import org.sufficientlysecure.keychain.service.results.OperationResult.OperationLog; import org.sufficientlysecure.keychain.service.results.ConsolidateResult; import org.sufficientlysecure.keychain.service.results.SaveKeyringResult; import org.sufficientlysecure.keychain.util.ParcelableFileCache; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java index 29f888a82..a26ee009a 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java @@ -32,7 +32,6 @@ import org.openintents.openpgp.OpenPgpSignatureResult; import org.openintents.openpgp.util.OpenPgpApi; import org.sufficientlysecure.keychain.nfc.NfcActivity; import org.sufficientlysecure.keychain.Constants; -import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.pgp.PgpDecryptVerify; import org.sufficientlysecure.keychain.provider.KeychainDatabase.Tables; 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.remote.ui.RemoteServiceActivity; 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.ui.ImportKeysActivity; import org.sufficientlysecure.keychain.ui.ViewKeyActivity; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AccountSettingsActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AccountSettingsActivity.java index 4bf750121..231b26409 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AccountSettingsActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AccountSettingsActivity.java @@ -30,7 +30,10 @@ import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.helper.ActionBarHelper; import org.sufficientlysecure.keychain.provider.ProviderHelper; 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; public class AccountSettingsActivity extends ActionBarActivity { @@ -105,9 +108,10 @@ public class AccountSettingsActivity extends ActionBarActivity { private void save() { new ProviderHelper(this).updateApiAccount(mAccountUri, mAccountSettingsFragment.getAccSettings()); // 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.putExtra(OperationResultParcel.EXTRA_RESULT, result); + intent.putExtra(SingletonResult.EXTRA_RESULT, result); setResult(RESULT_OK, intent); finish(); } @@ -115,8 +119,8 @@ public class AccountSettingsActivity extends ActionBarActivity { @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { // if a result has been returned, display a notify - if (data != null && data.hasExtra(OperationResultParcel.EXTRA_RESULT)) { - OperationResultParcel result = data.getParcelableExtra(OperationResultParcel.EXTRA_RESULT); + if (data != null && data.hasExtra(OperationResult.EXTRA_RESULT)) { + OperationResult result = data.getParcelableExtra(OperationResult.EXTRA_RESULT); result.createNotify(this).show(); } else { super.onActivityResult(requestCode, resultCode, data); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AccountSettingsFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AccountSettingsFragment.java index d21d83574..a7eb58377 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AccountSettingsFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AccountSettingsFragment.java @@ -33,7 +33,7 @@ import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.pgp.KeyRing; 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.ui.CreateKeyActivity; import org.sufficientlysecure.keychain.ui.adapter.KeyValueSpinnerAdapter; @@ -171,8 +171,8 @@ public class AccountSettingsFragment extends Fragment { switch (requestCode) { case REQUEST_CODE_CREATE_KEY: { if (resultCode == Activity.RESULT_OK) { - if (data != null && data.hasExtra(OperationResultParcel.EXTRA_RESULT)) { - SaveKeyringResult result = data.getParcelableExtra(OperationResultParcel.EXTRA_RESULT); + if (data != null && data.hasExtra(OperationResult.EXTRA_RESULT)) { + SaveKeyringResult result = data.getParcelableExtra(OperationResult.EXTRA_RESULT); mSelectKeySpinner.setSelectedKeyId(result.mRingMasterKeyId); } else { Log.e(Constants.TAG, "missing result!"); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AppSettingsActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AppSettingsActivity.java index 8cc05231e..1c1978fe9 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AppSettingsActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AppSettingsActivity.java @@ -32,7 +32,7 @@ import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.provider.KeychainContract; import org.sufficientlysecure.keychain.provider.ProviderHelper; 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; public class AppSettingsActivity extends ActionBarActivity { @@ -158,8 +158,8 @@ public class AppSettingsActivity extends ActionBarActivity { @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { // if a result has been returned, display a notify - if (data != null && data.hasExtra(OperationResultParcel.EXTRA_RESULT)) { - OperationResultParcel result = data.getParcelableExtra(OperationResultParcel.EXTRA_RESULT); + if (data != null && data.hasExtra(OperationResult.EXTRA_RESULT)) { + OperationResult result = data.getParcelableExtra(OperationResult.EXTRA_RESULT); result.createNotify(this).show(); } else { super.onActivityResult(requestCode, resultCode, data); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java index f012d9a79..52638f592 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java @@ -55,10 +55,10 @@ import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRingData; import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings; import org.sufficientlysecure.keychain.provider.KeychainDatabase; import org.sufficientlysecure.keychain.provider.ProviderHelper; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogLevel; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogType; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.OperationLog; +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.OperationResult.OperationLog; import org.sufficientlysecure.keychain.service.results.ConsolidateResult; import org.sufficientlysecure.keychain.service.results.EditKeyResult; 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.putParcelable(OperationResultParcel.EXTRA_RESULT, data); + bundle.putParcelable(OperationResult.EXTRA_RESULT, data); sendMessageToHandler(arg1, null, bundle); } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/ConsolidateResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/ConsolidateResult.java index 31f4cabc3..44177563f 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/ConsolidateResult.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/ConsolidateResult.java @@ -18,7 +18,7 @@ package org.sufficientlysecure.keychain.service.results; -public class ConsolidateResult extends OperationResultParcel { +public class ConsolidateResult extends OperationResult { public ConsolidateResult(int result, OperationLog log) { super(result, log); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/DecryptVerifyResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/DecryptVerifyResult.java index 7339f1306..18533ffe6 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/DecryptVerifyResult.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/DecryptVerifyResult.java @@ -23,7 +23,7 @@ import android.os.Parcel; import org.openintents.openpgp.OpenPgpMetadata; 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) public static final int RESULT_PENDING = RESULT_ERROR +8; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/EditKeyResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/EditKeyResult.java index 169ed9f36..9385afd8e 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/EditKeyResult.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/EditKeyResult.java @@ -23,7 +23,7 @@ import android.os.Parcel; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.pgp.UncachedKeyRing; -public class EditKeyResult extends OperationResultParcel { +public class EditKeyResult extends OperationResult { private transient UncachedKeyRing mRing; public final long mRingMasterKeyId; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/ImportKeyResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/ImportKeyResult.java index 62b5b1b52..ec9c424cf 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/ImportKeyResult.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/ImportKeyResult.java @@ -34,7 +34,7 @@ import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.ui.LogDisplayActivity; import org.sufficientlysecure.keychain.ui.LogDisplayFragment; -public class ImportKeyResult extends OperationResultParcel { +public class ImportKeyResult extends OperationResult { public final int mNewKeys, mUpdatedKeys, mBadKeys, mSecret; @@ -109,7 +109,7 @@ public class ImportKeyResult extends OperationResultParcel { int duration, color; // Not an overall failure - if ((resultType & OperationResultParcel.RESULT_ERROR) == 0) { + if ((resultType & OperationResult.RESULT_ERROR) == 0) { String withWarnings; duration = Duration.EXTRA_LONG; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResultParcel.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResult.java similarity index 96% rename from OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResultParcel.java rename to OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResult.java index 56f5248cb..d2be1466f 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResultParcel.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResult.java @@ -52,7 +52,7 @@ import java.util.List; * 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"; @@ -71,12 +71,12 @@ public class OperationResultParcel implements Parcelable { /// A list of log entries tied to the operation result. final OperationLog mLog; - public OperationResultParcel(int result, OperationLog log) { + public OperationResult(int result, OperationLog log) { mResult = result; mLog = log; } - public OperationResultParcel(Parcel source) { + public OperationResult(Parcel source) { mResult = source.readInt(); mLog = new OperationLog(); mLog.addAll(source.createTypedArrayList(LogEntryParcel.CREATOR)); @@ -156,25 +156,22 @@ public class OperationResultParcel implements Parcelable { public SuperCardToast createNotify(final Activity activity) { - String str; int color; + // Take the last message as string + String str = activity.getString(mLog.getLast().mType.getMsgId()); + // Not an overall failure if (cancelled()) { color = Style.RED; - str = "operation cancelled!"; } else if (success()) { if (getLog().containsWarnings()) { color = Style.ORANGE; } else { color = Style.GREEN; } - str = "operation succeeded!"; - // str = activity.getString(R.string.import_error); } else { color = Style.RED; - str = "operation failed"; - // str = activity.getString(R.string.import_error); } boolean button = getLog() != null && !getLog().isEmpty(); @@ -197,7 +194,7 @@ public class OperationResultParcel implements Parcelable { public void onClick(View view, Parcelable token) { Intent intent = new Intent( activity, LogDisplayActivity.class); - intent.putExtra(LogDisplayFragment.EXTRA_RESULT, OperationResultParcel.this); + intent.putExtra(LogDisplayFragment.EXTRA_RESULT, OperationResult.this); activity.startActivity(intent); } } @@ -498,6 +495,11 @@ public class OperationResultParcel implements Parcelable { MSG_SE_SIGCRYPTING (R.string.msg_se_sigcrypting), 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; @@ -533,27 +535,17 @@ public class OperationResultParcel implements Parcelable { } } - public static final Creator CREATOR = new Creator() { - 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 { private final List mParcels = new ArrayList(); /// Simple convenience method 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) { - 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) { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SaveKeyringResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SaveKeyringResult.java index 0edb9c617..e229a5c6a 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SaveKeyringResult.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SaveKeyringResult.java @@ -23,7 +23,7 @@ import android.os.Parcel; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.pgp.CanonicalizedKeyRing; -public class SaveKeyringResult extends OperationResultParcel { +public class SaveKeyringResult extends OperationResult { public final long mRingMasterKeyId; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SignEncryptResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SignEncryptResult.java index 100a7c675..9d492e545 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SignEncryptResult.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SignEncryptResult.java @@ -19,12 +19,9 @@ package org.sufficientlysecure.keychain.service.results; import android.os.Parcel; -import org.openintents.openpgp.OpenPgpMetadata; -import org.openintents.openpgp.OpenPgpSignatureResult; - 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) public static final int RESULT_PENDING = RESULT_ERROR +8; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SingletonResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SingletonResult.java index 5022c46a7..38b2e4bc3 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SingletonResult.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SingletonResult.java @@ -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 * 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. */ public SingletonResult(Parcel source) { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyFragment.java index fb2184362..81fa98e7a 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyFragment.java @@ -54,8 +54,11 @@ import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings; import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds; import org.sufficientlysecure.keychain.service.KeychainIntentService; 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.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.dialog.PassphraseDialogFragment; import org.sufficientlysecure.keychain.ui.widget.CertifyKeySpinner; @@ -327,12 +330,10 @@ public class CertifyKeyFragment extends LoaderFragment if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) { -// Notify.showNotify(CertifyKeyActivity.this, R.string.key_certify_success, -// Notify.Style.INFO); - - OperationResultParcel result = new OperationResultParcel(OperationResultParcel.RESULT_OK, null); + SingletonResult result = new SingletonResult( + SingletonResult.RESULT_OK, LogLevel.OK, LogType.MSG_CRT_SUCCESS); Intent intent = new Intent(); - intent.putExtra(OperationResultParcel.EXTRA_RESULT, result); + intent.putExtra(SingletonResult.EXTRA_RESULT, result); mActivity.setResult(CertifyKeyActivity.RESULT_OK, intent); // 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); if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) { - //Notify.showNotify(CertifyKeyActivity.this, R.string.key_send_success, - //Notify.Style.INFO); - - OperationResultParcel result = new OperationResultParcel(OperationResultParcel.RESULT_OK, null); + SingletonResult result = new SingletonResult(SingletonResult.RESULT_OK, + LogLevel.OK, LogType.MSG_CRT_UPLOAD_SUCCESS); Intent intent = new Intent(); - intent.putExtra(OperationResultParcel.EXTRA_RESULT, result); + intent.putExtra(SingletonResult.EXTRA_RESULT, result); mActivity.setResult(CertifyKeyActivity.RESULT_OK, intent); mActivity.finish(); } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java index a645f18a9..dc9fa78e5 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java @@ -39,7 +39,7 @@ import org.sufficientlysecure.keychain.pgp.KeyRing; import org.sufficientlysecure.keychain.provider.KeychainContract; import org.sufficientlysecure.keychain.service.KeychainIntentService; 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.Algorithm; import org.sufficientlysecure.keychain.service.results.SaveKeyringResult; @@ -141,7 +141,7 @@ public class CreateKeyFinalFragment extends Fragment { return; } final SaveKeyringResult result = - returnData.getParcelable(OperationResultParcel.EXTRA_RESULT); + returnData.getParcelable(OperationResult.EXTRA_RESULT); if (result == null) { Log.e(Constants.TAG, "result == null"); return; @@ -152,7 +152,7 @@ public class CreateKeyFinalFragment extends Fragment { uploadKey(result); } else { Intent data = new Intent(); - data.putExtra(OperationResultParcel.EXTRA_RESULT, result); + data.putExtra(OperationResult.EXTRA_RESULT, result); getActivity().setResult(Activity.RESULT_OK, data); getActivity().finish(); } @@ -223,7 +223,7 @@ public class CreateKeyFinalFragment extends Fragment { //Notify.Style.INFO); Intent data = new Intent(); - data.putExtra(OperationResultParcel.EXTRA_RESULT, saveKeyResult); + data.putExtra(OperationResult.EXTRA_RESULT, saveKeyResult); getActivity().setResult(Activity.RESULT_OK, data); getActivity().finish(); } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java index 8bde3f295..0911a98ae 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java @@ -48,9 +48,9 @@ import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.provider.ProviderHelper.NotFoundException; import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogLevel; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogType; +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.service.PassphraseCacheService; import org.sufficientlysecure.keychain.service.SaveKeyringParcel; @@ -541,8 +541,8 @@ public class EditKeyFragment extends LoaderFragment implements if (returnData == null) { return; } - final OperationResultParcel result = - returnData.getParcelable(OperationResultParcel.EXTRA_RESULT); + final OperationResult result = + returnData.getParcelable(OperationResult.EXTRA_RESULT); if (result == null) { return; } @@ -555,7 +555,7 @@ public class EditKeyFragment extends LoaderFragment implements // if good -> finish, return result to showkey and display there! Intent intent = new Intent(); - intent.putExtra(OperationResultParcel.EXTRA_RESULT, result); + intent.putExtra(OperationResult.EXTRA_RESULT, result); getActivity().setResult(EditKeyActivity.RESULT_OK, intent); getActivity().finish(); @@ -590,7 +590,7 @@ public class EditKeyFragment extends LoaderFragment implements // Prepare an intent with an EXTRA_RESULT Intent intent = new Intent(); - intent.putExtra(OperationResultParcel.EXTRA_RESULT, + intent.putExtra(OperationResult.EXTRA_RESULT, new SingletonResult(SingletonResult.RESULT_ERROR, LogLevel.ERROR, reason)); // Finish with result diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java index 732e59e32..d644dabc2 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java @@ -46,7 +46,7 @@ import org.sufficientlysecure.keychain.keyimport.ParcelableKeyRing; import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; import org.sufficientlysecure.keychain.service.KeychainIntentService; 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.ui.adapter.PagerTabStripAdapter; import org.sufficientlysecure.keychain.ui.widget.SlidingTabLayout; @@ -459,7 +459,7 @@ public class ImportKeysActivity extends ActionBarActivity { return; } final ImportKeyResult result = - returnData.getParcelable(OperationResultParcel.EXTRA_RESULT); + returnData.getParcelable(OperationResult.EXTRA_RESULT); if (result == null) { Log.e(Constants.TAG, "result == null"); return; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java index 1b3bb06c3..4c94d25be 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java @@ -34,7 +34,7 @@ import org.sufficientlysecure.keychain.provider.KeychainContract; import org.sufficientlysecure.keychain.provider.KeychainDatabase; import org.sufficientlysecure.keychain.service.KeychainIntentService; 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.util.Log; import org.sufficientlysecure.keychain.util.Notify; @@ -166,7 +166,7 @@ public class KeyListActivity extends DrawerActivity { return; } final ConsolidateResult result = - returnData.getParcelable(OperationResultParcel.EXTRA_RESULT); + returnData.getParcelable(OperationResult.EXTRA_RESULT); if (result == null) { return; } @@ -201,8 +201,8 @@ public class KeyListActivity extends DrawerActivity { @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { // if a result has been returned, display a notify - if (data != null && data.hasExtra(OperationResultParcel.EXTRA_RESULT)) { - OperationResultParcel result = data.getParcelableExtra(OperationResultParcel.EXTRA_RESULT); + if (data != null && data.hasExtra(OperationResult.EXTRA_RESULT)) { + OperationResult result = data.getParcelableExtra(OperationResult.EXTRA_RESULT); result.createNotify(this).show(); } else { super.onActivityResult(requestCode, resultCode, data); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/LogDisplayFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/LogDisplayFragment.java index ddc57b8aa..fcd9324c9 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/LogDisplayFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/LogDisplayFragment.java @@ -37,9 +37,9 @@ import android.widget.TextView; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogEntryParcel; -import org.sufficientlysecure.keychain.service.results.OperationResultParcel.LogLevel; +import org.sufficientlysecure.keychain.service.results.OperationResult; +import org.sufficientlysecure.keychain.service.results.OperationResult.LogEntryParcel; +import org.sufficientlysecure.keychain.service.results.OperationResult.LogLevel; import org.sufficientlysecure.keychain.util.Log; import java.util.HashMap; @@ -50,7 +50,7 @@ public class LogDisplayFragment extends ListFragment implements OnTouchListener LogAdapter mAdapter; LogLevel mLevel = LogLevel.DEBUG; - OperationResultParcel mResult; + OperationResult mResult; GestureDetector mDetector; @@ -66,7 +66,7 @@ public class LogDisplayFragment extends ListFragment implements OnTouchListener return; } - mResult = intent.getParcelableExtra(EXTRA_RESULT); + mResult = intent.getParcelableExtra(EXTRA_RESULT); if (mResult == null) { getActivity().finish(); return; @@ -135,7 +135,7 @@ public class LogDisplayFragment extends ListFragment implements OnTouchListener private LayoutInflater mInflater; 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); mInflater = LayoutInflater.from(getContext()); dipFactor = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java index ef0b95bcc..805fc8753 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java @@ -56,7 +56,7 @@ import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; import org.sufficientlysecure.keychain.provider.KeychainContract; import org.sufficientlysecure.keychain.provider.ProviderHelper; 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.widget.SlidingTabLayout; import org.sufficientlysecure.keychain.ui.widget.SlidingTabLayout.TabColorizer; @@ -322,8 +322,8 @@ public class ViewKeyActivity extends ActionBarActivity implements @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { // if a result has been returned, display a notify - if (data != null && data.hasExtra(OperationResultParcel.EXTRA_RESULT)) { - OperationResultParcel result = data.getParcelableExtra(OperationResultParcel.EXTRA_RESULT); + if (data != null && data.hasExtra(OperationResult.EXTRA_RESULT)) { + OperationResult result = data.getParcelableExtra(OperationResult.EXTRA_RESULT); result.createNotify(this).show(); } else { super.onActivityResult(requestCode, resultCode, data); diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index e1fcf4a0b..69bcca5a1 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -214,8 +214,6 @@ "%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."" - "Successfully uploaded key to server" - "Successfully certified identities" "This list is empty!" "Successfully sent key with NFC Beam!" "Key has been copied to the clipboard!" @@ -827,6 +825,11 @@ "Starting sign and/or encrypt operation" "Preparing symmetric encryption" + "Successfully uploaded key to server" + "Successfully certified identities" + + "Account saved" + "Click to clear cached passphrases" "OpenKeychain has cached %d passphrases"