aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyServerUploadActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyServerUploadActivity.java')
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyServerUploadActivity.java24
1 files changed, 14 insertions, 10 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyServerUploadActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyServerUploadActivity.java
index 9dca1094f..7b410e461 100644
--- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyServerUploadActivity.java
+++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyServerUploadActivity.java
@@ -22,9 +22,11 @@ import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.Preferences;
import org.sufficientlysecure.keychain.service.KeychainIntentService;
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
+import org.sufficientlysecure.keychain.util.Log;
import android.app.ProgressDialog;
import android.content.Intent;
+import android.net.Uri;
import android.os.Bundle;
import android.os.Message;
import android.os.Messenger;
@@ -43,16 +45,11 @@ import com.beardedhen.androidbootstrap.BootstrapButton;
* Sends the selected public key to a key server
*/
public class KeyServerUploadActivity extends SherlockFragmentActivity {
-
- // Not used in sourcode, but listed in AndroidManifest!
- public static final String ACTION_EXPORT_KEY_TO_SERVER = Constants.INTENT_PREFIX
- + "EXPORT_KEY_TO_SERVER";
-
- public static final String EXTRA_KEYRING_ROW_ID = "key_row_id";
-
private BootstrapButton mUploadButton;
private Spinner mKeyServerSpinner;
+ private Uri mDataUri;
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -79,6 +76,13 @@ public class KeyServerUploadActivity extends SherlockFragmentActivity {
uploadKey();
}
});
+
+ mDataUri = getIntent().getData();
+ if (mDataUri == null) {
+ Log.e(Constants.TAG, "Intent data missing. Should be Uri of key!");
+ finish();
+ return;
+ }
}
private void uploadKey() {
@@ -87,12 +91,12 @@ public class KeyServerUploadActivity extends SherlockFragmentActivity {
intent.setAction(KeychainIntentService.ACTION_UPLOAD_KEYRING);
+ // set data uri as path to keyring
+ intent.setData(mDataUri);
+
// fill values for this action
Bundle data = new Bundle();
- int keyRingId = getIntent().getIntExtra(EXTRA_KEYRING_ROW_ID, -1);
- data.putInt(KeychainIntentService.UPLOAD_KEY_KEYRING_ROW_ID, keyRingId);
-
String server = (String) mKeyServerSpinner.getSelectedItem();
data.putString(KeychainIntentService.UPLOAD_KEY_SERVER, server);