diff options
Diffstat (limited to 'OpenKeychain/src/main/java')
4 files changed, 10 insertions, 8 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java index 3aa58d024..b6e6a819f 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java @@ -31,14 +31,17 @@ public final class Constants { public static final boolean DEBUG_LOG_DB_QUERIES = false; public static final boolean DEBUG_SYNC_REMOVE_CONTACTS = false; - public static final String TAG = "Keychain"; + public static final String TAG = DEBUG ? "Keychain D" : "Keychain"; public static final String PACKAGE_NAME = "org.sufficientlysecure.keychain"; - public static final String ACCOUNT_NAME = "OpenKeychain"; - public static final String ACCOUNT_TYPE = PACKAGE_NAME + ".account"; + public static final String ACCOUNT_NAME = DEBUG ? "OpenKeychain D" : "OpenKeychain"; + public static final String ACCOUNT_TYPE = BuildConfig.ACCOUNT_TYPE; public static final String CUSTOM_CONTACT_DATA_MIME_TYPE = "vnd.android.cursor.item/vnd.org.sufficientlysecure.keychain.key"; + public static final String PROVIDER_AUTHORITY = BuildConfig.APPLICATION_ID + ".provider"; + public static final String TEMPSTORAGE_AUTHORITY = BuildConfig.APPLICATION_ID + ".tempstorage"; + // as defined in http://tools.ietf.org/html/rfc3156, section 7 public static final String NFC_MIME = "application/pgp-keys"; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java index 710dbf8aa..98f19e98f 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java @@ -128,8 +128,6 @@ public class KeychainApplication extends Application { /** * Add OpenKeychain account to Android to link contacts with keys - * - * @param context */ public static void setupAccountAsNeeded(Context context) { try { @@ -165,7 +163,7 @@ public class KeychainApplication extends Application { int edgeDrawableId = context.getResources().getIdentifier("overscroll_edge", "drawable", "android"); Drawable androidEdge = context.getResources().getDrawable(edgeDrawableId); androidEdge.setColorFilter(brandColor, PorterDuff.Mode.SRC_IN); - } catch (Resources.NotFoundException e) { + } catch (Exception ignored) { } } } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainContract.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainContract.java index d5283f01f..0d9a4ac16 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainContract.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainContract.java @@ -90,7 +90,7 @@ public class KeychainContract { String PACKAGE_NAME = "package_name"; // foreign key to api_apps.package_name } - public static final String CONTENT_AUTHORITY = Constants.PACKAGE_NAME + ".provider"; + public static final String CONTENT_AUTHORITY = Constants.PROVIDER_AUTHORITY; private static final Uri BASE_CONTENT_URI_INTERNAL = Uri .parse("content://" + CONTENT_AUTHORITY); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java index 45f806960..2000a6525 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java @@ -45,7 +45,8 @@ public class TemporaryStorageProvider extends ContentProvider { private static final String COLUMN_ID = "id"; private static final String COLUMN_NAME = "name"; private static final String COLUMN_TIME = "time"; - private static final Uri BASE_URI = Uri.parse("content://org.sufficientlysecure.keychain.tempstorage/"); + public static final String CONTENT_AUTHORITY = Constants.TEMPSTORAGE_AUTHORITY; + private static final Uri BASE_URI = Uri.parse("content://" + CONTENT_AUTHORITY); private static final int DB_VERSION = 2; private static File cacheDir; |