split getMasterKeyId for the remaining use cases

Closes #549
This commit is contained in:
Vincent Breitmoser
2014-04-11 03:29:00 +02:00
parent b77fb2fcc0
commit baa3c86e12
5 changed files with 19 additions and 16 deletions

View File

@@ -331,11 +331,8 @@ public class ViewKeyMainFragment extends Fragment implements
}
private void encryptToContact(Uri dataUri) {
// TODO preselect from uri? should be feasible without trivial query
try {
long keyId = ProviderHelper.getMasterKeyId(getActivity(),
KeyRingData.buildPublicKeyRingUri(dataUri));
long keyId = ProviderHelper.extractOrGetMasterKeyId(getActivity(), dataUri);
long[] encryptionKeyIds = new long[]{ keyId };
Intent intent = new Intent(getActivity(), EncryptActivity.class);
intent.setAction(EncryptActivity.ACTION_ENCRYPT);

View File

@@ -82,7 +82,6 @@ public class ShareQrCodeDialogFragment extends DialogFragment {
mFingerprintOnly = getArguments().getBoolean(ARG_FINGERPRINT_ONLY);
AlertDialog.Builder alert = new AlertDialog.Builder(getActivity());
alert.setTitle(R.string.share_qr_code_dialog_title);
LayoutInflater inflater = activity.getLayoutInflater();
@@ -100,7 +99,8 @@ public class ShareQrCodeDialogFragment extends DialogFragment {
getActivity(), KeyRings.buildUnifiedKeyRingUri(dataUri),
KeyRings.FINGERPRINT, ProviderHelper.FIELD_TYPE_BLOB);
if(blob == null) {
// TODO error handling?!
Log.e(Constants.TAG, "key not found!");
AppMsg.makeText(getActivity(), R.string.error_key_not_found, AppMsg.STYLE_ALERT).show();
return null;
}