mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-05 08:45:08 -05:00
No need for setSyncAutomatically, this is only for network tickles
This commit is contained in:
parent
f0ff8d2222
commit
0c1e65bc8b
@ -115,9 +115,11 @@ public class KeychainApplication extends Application {
|
|||||||
Account[] accounts = manager.getAccountsByType(Constants.ACCOUNT_TYPE);
|
Account[] accounts = manager.getAccountsByType(Constants.ACCOUNT_TYPE);
|
||||||
if (accounts == null || accounts.length == 0) {
|
if (accounts == null || accounts.length == 0) {
|
||||||
Account account = new Account(Constants.ACCOUNT_NAME, Constants.ACCOUNT_TYPE);
|
Account account = new Account(Constants.ACCOUNT_NAME, Constants.ACCOUNT_TYPE);
|
||||||
manager.addAccountExplicitly(account, null, null);
|
if (manager.addAccountExplicitly(account, null, null)) {
|
||||||
ContentResolver.setIsSyncable(account, ContactsContract.AUTHORITY, 1);
|
ContentResolver.setIsSyncable(account, ContactsContract.AUTHORITY, 1);
|
||||||
ContentResolver.setSyncAutomatically(account, ContactsContract.AUTHORITY, true);
|
} else {
|
||||||
|
Log.e(Constants.TAG, "Adding account failed!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user