Category/Group field for Contacts is not synchronized


  • developer

    However, you should think about how to deal with groups that are deleted on the server. At the moment, a deleted group remains as empty group on the phone forever.

    As fas as I have understood the Android contacts concept, it's not task of a sync adapter to manage groups. If you delete all contacts from a group using the GUI, the group isn't deleted either (you'd have to delete it manually).

    Also, we can't know whether the group shall be deleted or whether it's just temporarily empty. In the latter case, the user may want to add contacts to this group again and so it shouldn't be deleted.



  • As fas as I have understood the Android contacts concept, it's not task of a sync adapter to manage groups.

    This depends on what you understand of "managing groups". Ideally, the sync adapter synchronizes the groups in a two way manner: from phone to server and from server to phone. Unfortunately, CardDAV does not provide a list of existing groups (you can only see non-empty groups). Consequently, the "normal" (easy) way is not applicable and a more complicated "management" of groups is required. Therefore I wold suggest the above mentioned workaround in order to deal with some problems that occur due to this limitations of CardDAV.

    In order to respond to your doubts, I would like to split the DAVdroid users into two cluster:

    1. The addressbook app does not allow any changes to groups.
      Here, groups can only be created, deleted and assigned on the server. Empty groups are not synchronized, which is not a real problem, because they are useless on the phone. If a new group is assigned to contacts on the server, the group will be created on the phone on synchronization. But if the group is deleted on the server, an empty and useless group remains at the phone after the next synchronization. The user can't delete it -- this is a problem.
      With the above mentioned workaround, this empty group will be deleted on the phone. For the user, it does not matter if the group on the server is deleted or only empty. We do not need it on the phone. So, everything is fine.

    2. The addressbook app is able to create, delete and assign groups.
      Indeed, this situation is more complicated. I have to make some assumptions about the intension of the user. So let us distinct some cases:

    • The group is created locally on the phone: It is clear, that the user wants to do something with the group. So we do not touch it, even if it is empty. This is respected in the above mentioned workaround, so everything is fine.
    • The group is created on the server and deleted later: here, the same problem occurs like in the first cluster (no changes to groups possible on the phone). This means, that the intrinsically deleted group will not be deleted on the phone. In my point of view, this is a problem and this problem will not occur anymore using the above mentioned workaround. So everything is fine.
    • The group is created on the server and then remains empty: in this case, the empty group should remain as empty group an the phone. Here (and only here!), the above mentioned workaround would delete the group, although it is possible that the user eventually wants to add a contact to this group on the phone.

    In summary:
    The current situation is that deleted groups remain on the phone and in same cases the user has no possibility to delete these groups from the phone.
    In the above mentioned workaround, these groups are deleted automatically. However, there is one instance in which an empty group is deleted although it is perhaps eventually used. This case occurs rarely, since most people will edit their contacts and groups only on the phone or only on the server. But if this case really occurs, then the user can easily add a contact to the group on the server or add the group again on the phone and the group will not be deleted again.

    It's a trade-off, but I think the workaround makes the situation better. How do other users think about this issue?



  • But if the group is deleted on the server, an empty and useless group remains at the phone after the next synchronization. The user can't delete it -- this is a problem.

    In android 4.4.4, I can delete the group on the device, it is not synced back to server. As for groups having zero contacts is concerned, yes, they can be deleted (this may be a recent addition as I did not notice this before).

    So, what can be done is:

    1. Sync non-zero groups from server to client.
    2. If group created/or present on client is of zero size, leave it there. It can be manually deleted.
    3. If a group is assigned to a contact, sync the updated contact.

    As far as I understand, the contacts app builds the group from the category information present in the contact synced. Groups are not sent via carddav as separate entities(but as part of individual contacts). Please correct me if I am wrong.

    So, if somehow the category information of the contact is changed on the client, it will be synced without a separate implementation for groups, just as regular carddav fields (is this how groups are maintained on the phone?)



  • OmniROM (http://omnirom.org/) should be coming to the party soon:
    https://gerrit.omnirom.org/#/c/8789/

    If I understand it correctly, this is all that is required to allow groups on non-google accounts.


  • developer

    OmniROM (http://omnirom.org/) should be coming to the party soon:
    https://gerrit.omnirom.org/#/c/8789/

    Wow, nice 👍

    If I understand it correctly, this is all that is required to allow groups on non-google accounts.

    I think so.


  • developer

    Do you know whether an AOSP bug has already been filed for this issue?



  • Not that I know of. I'm not sure if Google did this 'by design' and it would be rejected anyway... Would be interesting to see though....



  • For what its worth, this works in all devices supported by OmniROM as of the 20140728 nightly.

    I'm using DavDroid to sync my Nexus 5 with ownCloud, which then syncs to Thunderbird - and groups are replicated between all systems as they should. Great work to all involved here.


  • developer



  • If someone uses Xposed together with a ROM which doesn't support editable groups, I recommend the app EnableContactsGroups (http://repo.xposed.info/module/name.iavael.xposed.enablecontactsgroups).