diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-07-30 14:57:59 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-07-30 14:57:59 +0200 |
commit | 70bfb5c586b3e2923da75d4fa517a785133b537a (patch) | |
tree | 295de40ae6b60d51f0754bec99ac4ec5c49a7d97 /OpenKeychain/src/main/java/org/sufficientlysecure | |
parent | cdee62b79d8246ad6b056fc69bcad4c47df53658 (diff) | |
download | open-keychain-70bfb5c586b3e2923da75d4fa517a785133b537a.tar.gz open-keychain-70bfb5c586b3e2923da75d4fa517a785133b537a.tar.bz2 open-keychain-70bfb5c586b3e2923da75d4fa517a785133b537a.zip |
return values for create key
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure')
3 files changed, 22 insertions, 8 deletions
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 0e38a1c47..a764c323c 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java @@ -24,7 +24,6 @@ import android.net.Uri; import android.os.Bundle; import android.os.Message; import android.os.Messenger; -import android.os.Parcelable; import android.os.RemoteException; import org.sufficientlysecure.keychain.Constants; @@ -53,7 +52,6 @@ import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralMsgIdException; import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings; import org.sufficientlysecure.keychain.provider.KeychainDatabase; import org.sufficientlysecure.keychain.provider.ProviderHelper; -import org.sufficientlysecure.keychain.service.OperationResultParcel.OperationLog; import org.sufficientlysecure.keychain.service.OperationResults.EditKeyResult; import org.sufficientlysecure.keychain.service.OperationResults.ImportKeyResult; import org.sufficientlysecure.keychain.util.InputData; @@ -172,7 +170,7 @@ public class KeychainIntentService extends IntentService // export public static final String RESULT_EXPORT = "exported"; - public static final String RESULT = "result"; + public static final String RESULT_IMPORT = "result"; Messenger mMessenger; @@ -394,7 +392,7 @@ public class KeychainIntentService extends IntentService ImportKeyResult result = pgpImportExport.importKeyRings(entries); Bundle resultData = new Bundle(); - resultData.putParcelable(RESULT, result); + resultData.putParcelable(RESULT_IMPORT, result); sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, resultData); } catch (Exception e) { 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 7e6f81cc2..c60200bce 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java @@ -36,6 +36,8 @@ import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; +import org.sufficientlysecure.keychain.service.OperationResultParcel; +import org.sufficientlysecure.keychain.service.OperationResults; import org.sufficientlysecure.keychain.service.SaveKeyringParcel; import org.sufficientlysecure.keychain.util.Notify; @@ -131,15 +133,29 @@ public class CreateKeyFinalFragment extends Fragment { // handle messages by standard KeychainIntentServiceHandler first super.handleMessage(message); - // TODO + if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) { + // get returned data bundle + Bundle returnData = message.getData(); + if (returnData == null) { + return; + } + final OperationResults.EditKeyResult result = + returnData.getParcelable(OperationResultParcel.EXTRA_RESULT); + if (result == null) { + return; + } + + result.createNotify(getActivity()); + + // TODO // if (mUploadCheckbox.isChecked()) { // uploadKey(); // } else { - if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) { getActivity().setResult(Activity.RESULT_OK); getActivity().finish(); + // } + } -// } } }; 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 5ab4d69f1..cb59afa93 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java @@ -428,7 +428,7 @@ public class ImportKeysActivity extends ActionBarActivity { return; } final ImportKeyResult result = - returnData.getParcelable(KeychainIntentService.RESULT); + returnData.getParcelable(KeychainIntentService.RESULT_IMPORT); if (result == null) { return; } |