I’ve got contacts with no special person, just the company name, and empty name fields.
Yeah, I use such contacts, too.
At present, Davdroid fills in the company name into the name fields.
No, it does not. You can find the relevant code in the Contact and LocalAddressBook classes.
However, DAVdroid always inserts a StructuredName which will result in a structured name entry with only NULL fields (if there is no structured name available). Is it possible that this causes your troubles?
I have done so because Android docs say:
»Always add a ContactsContract.CommonDataKinds.StructuredName row for every ContactsContract.RawContacts row you add. A ContactsContract.RawContacts row without a ContactsContract.CommonDataKinds.StructuredName row in the ContactsContract.Data table may cause problems during aggregation.« [http://developer.android.com/guide/topics/providers/contacts-provider.html#Access, scroll down to “Data integrity”]
But it doesn’t make sense when a row with an empty StructuredName causes “problems” during aggregation, too.
This creates a mess on android, esp. when you choose to sort contacts by second name.
What exactly do you mean? In my Contacts app (Android 4.4.2 CyanogenMod), sorting by first and or/second name always sorts in organization-only contacts correctly.
Can you attach a screen shot illustrating the problem?