consolidate: split into two steps, can pick up at second step if anything fails
This commit is contained in:
@@ -490,10 +490,7 @@ public class KeychainIntentService extends IntentService
|
||||
PgpImportExport pgpImportExport = new PgpImportExport(this, this);
|
||||
ImportKeyResult result = pgpImportExport.importKeyRings(entries);
|
||||
|
||||
Bundle resultData = new Bundle();
|
||||
resultData.putParcelable(RESULT_IMPORT, result);
|
||||
|
||||
sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, resultData);
|
||||
sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, result);
|
||||
} catch (Exception e) {
|
||||
sendErrorToHandler(e);
|
||||
}
|
||||
@@ -670,12 +667,8 @@ public class KeychainIntentService extends IntentService
|
||||
}
|
||||
|
||||
} else if (ACTION_CONSOLIDATE.equals(action)) {
|
||||
ConsolidateResult result = new ProviderHelper(this).consolidateDatabase(this);
|
||||
|
||||
Bundle resultData = new Bundle();
|
||||
resultData.putParcelable(RESULT_CONSOLIDATE, result);
|
||||
|
||||
sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, resultData);
|
||||
ConsolidateResult result = new ProviderHelper(this).consolidateDatabaseStep1(this);
|
||||
sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -391,6 +391,7 @@ public class OperationResultParcel implements Parcelable {
|
||||
|
||||
// consolidate
|
||||
MSG_CON (R.string.msg_con),
|
||||
MSG_CON_ERROR_BAD_STATE (R.string.msg_con_error_bad_state),
|
||||
MSG_CON_SAVE_SECRET (R.string.msg_con_save_secret),
|
||||
MSG_CON_SAVE_PUBLIC (R.string.msg_con_save_public),
|
||||
MSG_CON_DB_CLEAR (R.string.msg_con_db_clear),
|
||||
|
||||
Reference in New Issue
Block a user