From 19b955f981d1a1022c9740d9cc1c86975f961e99 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Fri, 21 Apr 2017 19:39:08 +0100 Subject: [PATCH] Change LocalAddressBook to look like LocalCalendar (accept journalentity) --- .../com/etesync/syncadapter/resource/LocalAddressBook.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/etesync/syncadapter/resource/LocalAddressBook.java b/app/src/main/java/com/etesync/syncadapter/resource/LocalAddressBook.java index 5b59326c..60adac5a 100644 --- a/app/src/main/java/com/etesync/syncadapter/resource/LocalAddressBook.java +++ b/app/src/main/java/com/etesync/syncadapter/resource/LocalAddressBook.java @@ -32,6 +32,7 @@ import android.support.v4.os.OperationCanceledException; import com.etesync.syncadapter.App; import com.etesync.syncadapter.model.CollectionInfo; +import com.etesync.syncadapter.model.JournalEntity; import com.etesync.syncadapter.utils.Base64; import java.io.ByteArrayOutputStream; @@ -83,7 +84,8 @@ public class LocalAddressBook extends AndroidAddressBook implements LocalCollect return result.toArray(new LocalAddressBook[result.size()]); } - public static LocalAddressBook create(@NonNull Context context, @NonNull ContentProviderClient provider, @NonNull Account mainAccount, @NonNull CollectionInfo info) throws ContactsStorageException { + public static LocalAddressBook create(@NonNull Context context, @NonNull ContentProviderClient provider, @NonNull Account mainAccount, @NonNull JournalEntity journalEntity) throws ContactsStorageException { + CollectionInfo info = journalEntity.getInfo(); AccountManager accountManager = AccountManager.get(context); Account account = new Account(accountName(mainAccount, info), App.getAddressBookAccountType()); @@ -99,7 +101,8 @@ public class LocalAddressBook extends AndroidAddressBook implements LocalCollect return addressBook; } - public void update(@NonNull CollectionInfo info) throws AuthenticatorException, OperationCanceledException, IOException, ContactsStorageException, android.accounts.OperationCanceledException { + public void update(@NonNull JournalEntity journalEntity) throws AuthenticatorException, OperationCanceledException, IOException, ContactsStorageException, android.accounts.OperationCanceledException { + CollectionInfo info = journalEntity.getInfo(); final String newAccountName = accountName(getMainAccount(), info); if (!account.name.equals(newAccountName) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { final AccountManager accountManager = AccountManager.get(context);