Fixes for upload

This commit is contained in:
Dominik Schürmann 2014-07-31 23:31:09 +02:00
parent 38120ae77c
commit 97209f9d3d
4 changed files with 20 additions and 15 deletions

View File

@ -333,7 +333,7 @@ public class CertifyKeyActivity extends ActionBarActivity implements
// Message is received after uploading is done in KeychainIntentService // Message is received after uploading is done in KeychainIntentService
KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(this, KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(this,
getString(R.string.progress_exporting), ProgressDialog.STYLE_HORIZONTAL) { getString(R.string.progress_uploading), 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
super.handleMessage(message); super.handleMessage(message);

View File

@ -145,20 +145,20 @@ public class CreateKeyFinalFragment extends Fragment {
return; return;
} }
if (mUploadCheckbox.isChecked()) { if (result.getResult() == OperationResultParcel.RESULT_OK) {
if (result.getResult() == OperationResultParcel.RESULT_OK) { if (mUploadCheckbox.isChecked()) {
// result will be displayed after upload // result will be displayed after upload
uploadKey(result); uploadKey(result);
} else { } else {
// display result on error without finishing activity // TODO: return result
result.createNotify(getActivity()); result.createNotify(getActivity());
getActivity().setResult(Activity.RESULT_OK);
getActivity().finish();
} }
} else { } else {
// TODO: return result // display result on error without finishing activity
result.createNotify(getActivity()); result.createNotify(getActivity());
getActivity().setResult(Activity.RESULT_OK);
getActivity().finish();
} }
} }
} }
@ -196,9 +196,8 @@ public class CreateKeyFinalFragment extends Fragment {
intent.setAction(KeychainIntentService.ACTION_UPLOAD_KEYRING); intent.setAction(KeychainIntentService.ACTION_UPLOAD_KEYRING);
// set data uri as path to keyring // set data uri as path to keyring
Uri blobUri = KeychainContract.KeyRingData.buildPublicKeyRingUri( Uri blobUri = KeychainContract.KeyRings.buildUnifiedKeyRingUri(
Long.toString(editKeyResult.mRingMasterKeyId) editKeyResult.mRingMasterKeyId);
);
intent.setData(blobUri); intent.setData(blobUri);
// fill values for this action // fill values for this action
@ -212,14 +211,15 @@ public class CreateKeyFinalFragment extends Fragment {
// Message is received after uploading is done in KeychainIntentService // Message is received after uploading is done in KeychainIntentService
KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(getActivity(), KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(getActivity(),
getString(R.string.progress_exporting), ProgressDialog.STYLE_HORIZONTAL) { getString(R.string.progress_uploading), 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
super.handleMessage(message); super.handleMessage(message);
if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) { if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
// TODO: return results // TODO: not supported by upload?
// if (result.getResult() == OperationResultParcel.RESULT_OK) {
// TODO: return result
editKeyResult.createNotify(getActivity()); editKeyResult.createNotify(getActivity());
Notify.showNotify(getActivity(), R.string.key_send_success, Notify.showNotify(getActivity(), R.string.key_send_success,
@ -227,6 +227,10 @@ public class CreateKeyFinalFragment extends Fragment {
getActivity().setResult(Activity.RESULT_OK); getActivity().setResult(Activity.RESULT_OK);
getActivity().finish(); getActivity().finish();
// } else {
// // display result on error without finishing activity
// editKeyResult.createNotify(getActivity());
// }
} }
} }
}; };

View File

@ -106,7 +106,7 @@ public class UploadKeyActivity extends ActionBarActivity {
// Message is received after uploading is done in KeychainIntentService // Message is received after uploading is done in KeychainIntentService
KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(this, KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(this,
getString(R.string.progress_exporting), ProgressDialog.STYLE_HORIZONTAL) { getString(R.string.progress_uploading), 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
super.handleMessage(message); super.handleMessage(message);

View File

@ -300,6 +300,7 @@
<string name="progress_saving">saving…</string> <string name="progress_saving">saving…</string>
<string name="progress_importing">importing…</string> <string name="progress_importing">importing…</string>
<string name="progress_exporting">exporting…</string> <string name="progress_exporting">exporting…</string>
<string name="progress_uploading">uploading…</string>
<string name="progress_building_key">building key…</string> <string name="progress_building_key">building key…</string>
<string name="progress_certifying_master_key">certifying master key…</string> <string name="progress_certifying_master_key">certifying master key…</string>
<string name="progress_building_master_key">building master ring…</string> <string name="progress_building_master_key">building master ring…</string>