mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-12-25 16:38:50 -05:00
Always return a SaveKeyringResult from saving
This commit is contained in:
parent
188eeb79c9
commit
474fc50b80
@ -411,7 +411,12 @@ public class KeychainIntentService extends IntentService
|
|||||||
|
|
||||||
// If the edit operation didn't succeed, exit here
|
// If the edit operation didn't succeed, exit here
|
||||||
if (!modifyResult.success()) {
|
if (!modifyResult.success()) {
|
||||||
sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, modifyResult);
|
// always return SaveKeyringResult, so create one out of the EditKeyResult
|
||||||
|
SaveKeyringResult saveResult = new SaveKeyringResult(
|
||||||
|
SaveKeyringResult.RESULT_ERROR,
|
||||||
|
modifyResult.getLog(),
|
||||||
|
null);
|
||||||
|
sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, saveResult);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,10 +125,9 @@ public class CreateKeyFinalFragment extends Fragment {
|
|||||||
Intent intent = new Intent(getActivity(), KeychainIntentService.class);
|
Intent intent = new Intent(getActivity(), KeychainIntentService.class);
|
||||||
intent.setAction(KeychainIntentService.ACTION_SAVE_KEYRING);
|
intent.setAction(KeychainIntentService.ACTION_SAVE_KEYRING);
|
||||||
|
|
||||||
// Message is received after importing is done in KeychainIntentService
|
|
||||||
KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(
|
KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(
|
||||||
getActivity(),
|
getActivity(),
|
||||||
getString(R.string.progress_importing),
|
getString(R.string.progress_building_key),
|
||||||
ProgressDialog.STYLE_HORIZONTAL) {
|
ProgressDialog.STYLE_HORIZONTAL) {
|
||||||
public void handleMessage(Message message) {
|
public void handleMessage(Message message) {
|
||||||
// handle messages by standard KeychainIntentServiceHandler first
|
// handle messages by standard KeychainIntentServiceHandler first
|
||||||
@ -211,7 +210,6 @@ public class CreateKeyFinalFragment extends Fragment {
|
|||||||
|
|
||||||
intent.putExtra(KeychainIntentService.EXTRA_DATA, data);
|
intent.putExtra(KeychainIntentService.EXTRA_DATA, data);
|
||||||
|
|
||||||
// Message is received after uploading is done in KeychainIntentService
|
|
||||||
KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(getActivity(),
|
KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(getActivity(),
|
||||||
getString(R.string.progress_uploading), ProgressDialog.STYLE_HORIZONTAL) {
|
getString(R.string.progress_uploading), ProgressDialog.STYLE_HORIZONTAL) {
|
||||||
public void handleMessage(Message message) {
|
public void handleMessage(Message message) {
|
||||||
|
Loading…
Reference in New Issue
Block a user