From 861d5e4b4e9c8903146d7a05fa531cc0c3bdadd1 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 26 Apr 2017 17:29:29 +0100 Subject: [PATCH] Fix account type and authority to use function and not string. --- .../syncadapter/AddressBooksSyncAdapterService.java | 2 +- .../java/com/etesync/syncadapter/ui/DebugInfoActivity.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/etesync/syncadapter/syncadapter/AddressBooksSyncAdapterService.java b/app/src/main/java/com/etesync/syncadapter/syncadapter/AddressBooksSyncAdapterService.java index ef5ed8ea..9831327f 100644 --- a/app/src/main/java/com/etesync/syncadapter/syncadapter/AddressBooksSyncAdapterService.java +++ b/app/src/main/java/com/etesync/syncadapter/syncadapter/AddressBooksSyncAdapterService.java @@ -85,7 +85,7 @@ public class AddressBooksSyncAdapterService extends SyncAdapterService { updateLocalAddressBooks(contactsProvider, account); AccountManager accountManager = AccountManager.get(getContext()); - for (Account addressBookAccount : accountManager.getAccountsByType(getContext().getString(R.string.account_type_address_book))) { + for (Account addressBookAccount : accountManager.getAccountsByType(App.getAddressBookAccountType())) { App.log.log(Level.INFO, "Running sync for address book", addressBookAccount); Bundle syncExtras = new Bundle(extras); syncExtras.putBoolean(ContentResolver.SYNC_EXTRAS_IGNORE_SETTINGS, true); diff --git a/app/src/main/java/com/etesync/syncadapter/ui/DebugInfoActivity.java b/app/src/main/java/com/etesync/syncadapter/ui/DebugInfoActivity.java index 75263ebf..3b832d84 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/DebugInfoActivity.java +++ b/app/src/main/java/com/etesync/syncadapter/ui/DebugInfoActivity.java @@ -246,7 +246,7 @@ public class DebugInfoActivity extends AppCompatActivity implements LoaderManage try { AccountSettings settings = new AccountSettings(context, acct); report.append("Account: ").append(acct.name).append("\n" + - " Address book sync. interval: ").append(syncStatus(settings, context.getString(R.string.address_books_authority))).append("\n" + + " Address book sync. interval: ").append(syncStatus(settings, App.getAddressBooksAuthority())).append("\n" + " Calendar sync. interval: ").append(syncStatus(settings, CalendarContract.AUTHORITY)).append("\n" + " OpenTasks sync. interval: ").append(syncStatus(settings, "org.dmfs.tasks")).append("\n" + " WiFi only: ").append(settings.getSyncWifiOnly()); @@ -259,7 +259,7 @@ public class DebugInfoActivity extends AppCompatActivity implements LoaderManage report.append(acct).append(" is invalid (unsupported settings version) or does not exist\n"); } // address book accounts - for (Account acct : accountManager.getAccountsByType(context.getString(R.string.account_type_address_book))) + for (Account acct : accountManager.getAccountsByType(App.getAddressBookAccountType())) try { LocalAddressBook addressBook = new LocalAddressBook(context, acct, null); report.append("Address book account: ").append(acct.name).append("\n" +