mirror of
https://github.com/etesync/android
synced 2025-01-11 08:10:58 +00:00
Log group assignments more verbosely
This commit is contained in:
parent
d2df3c9027
commit
29068389c7
@ -26,7 +26,9 @@ import java.io.FileNotFoundException;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import at.bitfire.davdroid.App;
|
||||
import at.bitfire.vcard4android.AndroidAddressBook;
|
||||
import at.bitfire.vcard4android.AndroidContact;
|
||||
import at.bitfire.vcard4android.AndroidGroup;
|
||||
@ -162,9 +164,11 @@ public class LocalAddressBook extends AndroidAddressBook implements LocalCollect
|
||||
// find groups without members
|
||||
/** should be done using {@link Groups.SUMMARY_COUNT}, but it's not implemented in Android yet */
|
||||
for (LocalGroup group : (LocalGroup[])queryGroups(null, null))
|
||||
if (group.getMembers().length == 0)
|
||||
if (group.getMembers().length == 0) {
|
||||
App.log.log(Level.FINE, "Deleting group", group);
|
||||
group.delete();
|
||||
}
|
||||
}
|
||||
|
||||
public void removeGroups() throws ContactsStorageException {
|
||||
try {
|
||||
|
@ -451,10 +451,12 @@ public class ContactsSyncManager extends SyncManager {
|
||||
LocalContact contact = (LocalContact)local;
|
||||
|
||||
BatchOperation batch = new BatchOperation(provider);
|
||||
App.log.log(Level.FINE, "Removing contact group memberships");
|
||||
contact.removeGroupMemberships(batch);
|
||||
|
||||
for (String category : contact.getContact().categories) {
|
||||
long groupID = localAddressBook().findOrCreateGroup(category);
|
||||
App.log.log(Level.FINE, "Adding membership in group " + category + " (" + groupID + ")");
|
||||
contact.addToGroup(batch, groupID);
|
||||
}
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit eae31dac277c1b1d85f5870829fbc0ff1cb49735
|
||||
Subproject commit 6eee71f9aac8573f353059879c8fe45f527cc391
|
Loading…
Reference in New Issue
Block a user