Don't try to update contacts if you have no permission.

Fixes #10271
This commit is contained in:
Greyson Parrelli
2020-12-09 17:07:29 -05:00
parent 5a773de3b1
commit bed2544ff4

View File

@@ -297,6 +297,11 @@ public class DirectoryHelper {
boolean removeMissing,
@NonNull Map<String, String> rewrites)
{
if (!Permissions.hasAll(context, Manifest.permission.READ_CONTACTS, Manifest.permission.WRITE_CONTACTS)) {
Log.w(TAG, "[updateContactsDatabase] No contact permissions. Skipping.");
return;
}
AccountHolder account = getOrCreateSystemAccount(context);
if (account == null) {