aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java
diff options
context:
space:
mode:
authormar-v-in <github@rvin.mooo.com>2014-06-05 23:22:21 +0200
committermar-v-in <github@rvin.mooo.com>2014-06-05 23:22:21 +0200
commit80e99986401b635f4eeef5d13740911d10740aef (patch)
treeaed9056765590de9d251380aa881a8c0655a3fb2 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java
parentdc1e26f39c9c7fa88dd28d2920a2919f83e0575c (diff)
downloadopen-keychain-80e99986401b635f4eeef5d13740911d10740aef.tar.gz
open-keychain-80e99986401b635f4eeef5d13740911d10740aef.tar.bz2
open-keychain-80e99986401b635f4eeef5d13740911d10740aef.zip
Show keys with android contacts
This means to sync userid + keyid into contact storage. Android will merge them to normal contacts based on primary userid.
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java
index 3ac3a9dee..5d6a62f9c 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java
@@ -26,6 +26,7 @@ import android.graphics.drawable.Drawable;
import android.os.Environment;
import org.spongycastle.jce.provider.BouncyCastleProvider;
+import org.sufficientlysecure.keychain.helper.ContactHelper;
import org.sufficientlysecure.keychain.util.Log;
import org.sufficientlysecure.keychain.util.PRNGFixes;
@@ -79,14 +80,14 @@ public class KeychainApplication extends Application {
brandGlowEffect(getApplicationContext(),
getApplicationContext().getResources().getColor(R.color.emphasis));
- setupAccountAsNeeded();
+ setupAccountAsNeeded(this);
}
- private void setupAccountAsNeeded() {
- AccountManager manager = AccountManager.get(this);
- Account[] accounts = manager.getAccountsByType(getPackageName());
+ public static void setupAccountAsNeeded(Context context) {
+ AccountManager manager = AccountManager.get(context);
+ Account[] accounts = manager.getAccountsByType(Constants.PACKAGE_NAME);
if (accounts == null || accounts.length == 0) {
- Account dummy = new Account(getString(R.string.app_name), getPackageName());
+ Account dummy = new Account(context.getString(R.string.app_name), Constants.PACKAGE_NAME);
manager.addAccountExplicitly(dummy, null, null);
}
}