Commit e3ff8b19 authored by Ricki Hirner's avatar Ricki Hirner 🐑

Rename sync state methods

parent ff4ef654
Pipeline #16125742 passed with stages
in 6 minutes and 47 seconds
......@@ -72,12 +72,12 @@ public class AndroidAddressBookTest {
public void testSyncState() throws ContactsStorageException {
AndroidAddressBook addressBook = new TestAddressBook(testAccount, provider);
addressBook.setSyncState(new byte[0]);
assertEquals(0, addressBook.getSyncState().length);
addressBook.writeSyncState(new byte[0]);
assertEquals(0, addressBook.readSyncState().length);
final byte[] random = { 1, 2, 3, 4, 5 };
addressBook.setSyncState(random);
assertTrue(Arrays.equals(random, addressBook.getSyncState()));
addressBook.writeSyncState(random);
assertTrue(Arrays.equals(random, addressBook.readSyncState()));
}
}
......@@ -61,7 +61,7 @@ open class AndroidAddressBook<T1: AndroidContact, T2: AndroidGroup>(
// account-specific address book sync state
@Throws(ContactsStorageException::class)
fun getSyncState(): ByteArray =
fun readSyncState(): ByteArray =
try {
ContactsContract.SyncState.get(provider, account)
} catch(e: RemoteException) {
......@@ -69,11 +69,11 @@ open class AndroidAddressBook<T1: AndroidContact, T2: AndroidGroup>(
}
@Throws(ContactsStorageException::class)
fun setSyncState(data: ByteArray) {
fun writeSyncState(data: ByteArray) {
try {
ContactsContract.SyncState.set(provider, account, data)
} catch(e: RemoteException) {
throw ContactsStorageException("Couldn't write contacts sync state", e)
throw ContactsStorageException("Couldn't write address book sync state", e)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment