I have a problem integrating a VoIP application with Android smartwatch (any model). Our app uses Android ConnectionService API. The caller name is not displayed at the watch's incoming call notification - it simply writes "Unknown" or the caller id (4-digit extension), never the actual app contact name (app contact, not device contact). However, regular GSM calls are properly displayed (it resolves against the contact name) and also, if someone from my device contacts calls me, their name & avatar are being displayed correctly.
To assign the name I'm using android.telecom.Connection.setCallerDisplayName(displayName, TelecomManager.PRESENTATION_ALLOWED), but to no avail.
I had the same exact issue with Samsung Gear smartwatch. You see "Unknown" because the caller's name is resolved against device contacts (hence regular GSM calls work as expected). The solution is following:
displayName(caller's name) andaddress(caller's phone number). The address is the Uri which might look likesip:1234567ortel:+1234567, it doesn't really matter.displayNameandphoneNumber. ThephoneNumberhere should beUri.schemeSpecificPartof the address (the part after:). The avatar/icon can also be added.ConnectionServiceknow that there is now a contact that corresponds to the Connection you created for your VoIP call.contactManageris my class where aforementioned operations are executed,accountHandleis aandroid.telecom.AccountHandlethat is used to registerPhoneAccount(viatelecomManager.registerPhoneAccount()),addressis our Uri with phone number.addNewIncomingCalltheConnectionService::onCreateIncomingConnection()callback will be triggered, and in this function you should set the address:N.B.
ConnectionRequest.addressreturnsnullfor me inonCreateIncomingConnection(), that's why I pass it inextras.setCallerDisplayName()function and the common sense says that it should be there, but the fix was not related to it.