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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user