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

Fixes #10271
fork-5.53.8
Greyson Parrelli 2020-12-09 17:07:29 -05:00
rodzic 5a773de3b1
commit bed2544ff4
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -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) {