Update and fix Intent API

This commit is contained in:
Dominik Schürmann 2014-09-07 18:50:58 +02:00
parent a9644cab07
commit 857fc43873
6 changed files with 19 additions and 17 deletions

View File

@ -148,7 +148,7 @@
<!-- Keychain's own Actions --> <!-- Keychain's own Actions -->
<!-- ENCRYPT with data Uri --> <!-- ENCRYPT with data Uri -->
<intent-filter> <intent-filter>
<action android:name="org.sufficientlysecure.keychain.action.ENCRYPT_FILES" /> <action android:name="org.sufficientlysecure.keychain.action.ENCRYPT_DATA" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
@ -179,7 +179,7 @@
<!-- Keychain's own Actions --> <!-- Keychain's own Actions -->
<!-- ENCRYPT with text as extra --> <!-- ENCRYPT with text as extra -->
<intent-filter> <intent-filter>
<action android:name="org.sufficientlysecure.keychain.action.ENCRYPT" /> <action android:name="org.sufficientlysecure.keychain.action.ENCRYPT_TEXT" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>

View File

@ -26,6 +26,7 @@ import android.support.v4.view.ViewPager;
import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.api.OpenKeychainIntents;
import org.sufficientlysecure.keychain.pgp.PgpHelper; import org.sufficientlysecure.keychain.pgp.PgpHelper;
import org.sufficientlysecure.keychain.ui.adapter.PagerTabStripAdapter; import org.sufficientlysecure.keychain.ui.adapter.PagerTabStripAdapter;
import org.sufficientlysecure.keychain.util.Log; import org.sufficientlysecure.keychain.util.Log;
@ -35,10 +36,10 @@ import java.util.regex.Matcher;
public class DecryptActivity extends DrawerActivity { public class DecryptActivity extends DrawerActivity {
/* Intents */ /* Intents */
public static final String ACTION_DECRYPT = Constants.INTENT_PREFIX + "DECRYPT"; public static final String ACTION_DECRYPT = OpenKeychainIntents.DECRYPT;
/* EXTRA keys for input */ /* EXTRA keys for input */
public static final String EXTRA_TEXT = Constants.EXTRA_PREFIX + "EXTRA_TEXT"; public static final String EXTRA_TEXT = OpenKeychainIntents.DECRYPT_EXTRA_TEXT;
ViewPager mViewPager; ViewPager mViewPager;
PagerTabStrip mPagerTabStrip; PagerTabStrip mPagerTabStrip;

View File

@ -31,6 +31,7 @@ import android.view.MenuItem;
import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.api.OpenKeychainIntents;
import org.sufficientlysecure.keychain.compatibility.ClipboardReflection; import org.sufficientlysecure.keychain.compatibility.ClipboardReflection;
import org.sufficientlysecure.keychain.helper.Preferences; import org.sufficientlysecure.keychain.helper.Preferences;
import org.sufficientlysecure.keychain.helper.ShareHelper; import org.sufficientlysecure.keychain.helper.ShareHelper;
@ -50,10 +51,10 @@ import java.util.Set;
public class EncryptFileActivity extends DrawerActivity implements EncryptActivityInterface { public class EncryptFileActivity extends DrawerActivity implements EncryptActivityInterface {
/* Intents */ /* Intents */
public static final String ACTION_ENCRYPT_FILES = Constants.INTENT_PREFIX + "ENCRYPT_FILES"; public static final String ACTION_ENCRYPT_FILES = OpenKeychainIntents.ENCRYPT_DATA;
// enables ASCII Armor for file encryption when uri is given // enables ASCII Armor for file encryption when uri is given
public static final String EXTRA_ASCII_ARMOR = Constants.EXTRA_PREFIX + "EXTRA_ASCII_ARMOR"; public static final String EXTRA_ASCII_ARMOR = OpenKeychainIntents.ENCRYPT_EXTRA_ASCII_ARMOR;
// preselect ids, for internal use // preselect ids, for internal use
public static final String EXTRA_SIGNATURE_KEY_ID = Constants.EXTRA_PREFIX + "EXTRA_SIGNATURE_KEY_ID"; public static final String EXTRA_SIGNATURE_KEY_ID = Constants.EXTRA_PREFIX + "EXTRA_SIGNATURE_KEY_ID";

View File

@ -31,6 +31,7 @@ import android.view.MenuItem;
import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.api.OpenKeychainIntents;
import org.sufficientlysecure.keychain.compatibility.ClipboardReflection; import org.sufficientlysecure.keychain.compatibility.ClipboardReflection;
import org.sufficientlysecure.keychain.helper.Preferences; import org.sufficientlysecure.keychain.helper.Preferences;
import org.sufficientlysecure.keychain.helper.ShareHelper; import org.sufficientlysecure.keychain.helper.ShareHelper;
@ -49,10 +50,10 @@ import java.util.Set;
public class EncryptTextActivity extends DrawerActivity implements EncryptActivityInterface { public class EncryptTextActivity extends DrawerActivity implements EncryptActivityInterface {
/* Intents */ /* Intents */
public static final String ACTION_ENCRYPT_TEXT = Constants.INTENT_PREFIX + "ENCRYPT_TEXT"; public static final String ACTION_ENCRYPT_TEXT = OpenKeychainIntents.ENCRYPT_TEXT;
/* EXTRA keys for input */ /* EXTRA keys for input */
public static final String EXTRA_TEXT = Constants.EXTRA_PREFIX + "EXTRA_TEXT"; public static final String EXTRA_TEXT = OpenKeychainIntents.ENCRYPT_EXTRA_TEXT;
// preselect ids, for internal use // preselect ids, for internal use
public static final String EXTRA_SIGNATURE_KEY_ID = Constants.EXTRA_PREFIX + "EXTRA_SIGNATURE_KEY_ID"; public static final String EXTRA_SIGNATURE_KEY_ID = Constants.EXTRA_PREFIX + "EXTRA_SIGNATURE_KEY_ID";

View File

@ -40,6 +40,7 @@ import android.view.ViewGroup;
import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.api.OpenKeychainIntents;
import org.sufficientlysecure.keychain.helper.OtherHelper; import org.sufficientlysecure.keychain.helper.OtherHelper;
import org.sufficientlysecure.keychain.helper.Preferences; import org.sufficientlysecure.keychain.helper.Preferences;
import org.sufficientlysecure.keychain.keyimport.ImportKeysListEntry; import org.sufficientlysecure.keychain.keyimport.ImportKeysListEntry;
@ -60,11 +61,9 @@ import java.util.ArrayList;
import java.util.Locale; import java.util.Locale;
public class ImportKeysActivity extends ActionBarActivity { public class ImportKeysActivity extends ActionBarActivity {
public static final String ACTION_IMPORT_KEY = Constants.INTENT_PREFIX + "IMPORT_KEY"; public static final String ACTION_IMPORT_KEY = OpenKeychainIntents.IMPORT_KEY;
public static final String ACTION_IMPORT_KEY_FROM_QR_CODE = Constants.INTENT_PREFIX public static final String ACTION_IMPORT_KEY_FROM_QR_CODE = OpenKeychainIntents.IMPORT_KEY_FROM_QR_CODE;
+ "IMPORT_KEY_FROM_QR_CODE"; public static final String ACTION_IMPORT_KEY_FROM_KEYSERVER = OpenKeychainIntents.IMPORT_KEY_FROM_KEYSERVER;
public static final String ACTION_IMPORT_KEY_FROM_KEYSERVER = Constants.INTENT_PREFIX
+ "IMPORT_KEY_FROM_KEYSERVER";
public static final String ACTION_IMPORT_KEY_FROM_KEYSERVER_AND_RETURN_RESULT = public static final String ACTION_IMPORT_KEY_FROM_KEYSERVER_AND_RETURN_RESULT =
Constants.INTENT_PREFIX + "IMPORT_KEY_FROM_KEY_SERVER_AND_RETURN_RESULT"; Constants.INTENT_PREFIX + "IMPORT_KEY_FROM_KEY_SERVER_AND_RETURN_RESULT";
public static final String ACTION_IMPORT_KEY_FROM_KEYSERVER_AND_RETURN_TO_SERVICE = Constants.INTENT_PREFIX public static final String ACTION_IMPORT_KEY_FROM_KEYSERVER_AND_RETURN_TO_SERVICE = Constants.INTENT_PREFIX
@ -83,12 +82,12 @@ public class ImportKeysActivity extends ActionBarActivity {
public static final String EXTRA_RESULT = "result"; public static final String EXTRA_RESULT = "result";
// only used by ACTION_IMPORT_KEY // only used by ACTION_IMPORT_KEY
public static final String EXTRA_KEY_BYTES = Constants.EXTRA_PREFIX + "KEY_BYTES"; public static final String EXTRA_KEY_BYTES = OpenKeychainIntents.IMPORT_EXTRA_KEY_EXTRA_KEY_BYTES;
// only used by ACTION_IMPORT_KEY_FROM_KEYSERVER // only used by ACTION_IMPORT_KEY_FROM_KEYSERVER
public static final String EXTRA_QUERY = Constants.EXTRA_PREFIX + "EXTRA_QUERY"; public static final String EXTRA_QUERY = OpenKeychainIntents.IMPORT_KEY_FROM_KEYSERVER_EXTRA_QUERY;
public static final String EXTRA_KEY_ID = Constants.EXTRA_PREFIX + "EXTRA_KEY_ID"; public static final String EXTRA_KEY_ID = Constants.EXTRA_PREFIX + "EXTRA_KEY_ID";
public static final String EXTRA_FINGERPRINT = Constants.EXTRA_PREFIX + "EXTRA_FINGERPRINT"; public static final String EXTRA_FINGERPRINT = OpenKeychainIntents.IMPORT_KEY_FROM_KEYSERVER_EXTRA_FINGERPRINT;
// only used by ACTION_IMPORT_KEY_FROM_KEYSERVER_AND_RETURN_TO_SERVICE when used from OpenPgpService // only used by ACTION_IMPORT_KEY_FROM_KEYSERVER_AND_RETURN_TO_SERVICE when used from OpenPgpService
public static final String EXTRA_PENDING_INTENT_DATA = "data"; public static final String EXTRA_PENDING_INTENT_DATA = "data";

@ -1 +1 @@
Subproject commit 5fab1151825579e7c5d215e6317580e3c4014937 Subproject commit 848dc453302c5f54464243a9f208912919927f00