Skip to content
Snippets Groups Projects
Commit f61de0ad authored by Adrien Béraud's avatar Adrien Béraud
Browse files

ConnectionService: handle exceptions in observeConversation

Change-Id: If28bd076ef96e54c2db3d66a3beb8476194a5211
parent 6cc92e33
No related branches found
No related tags found
No related merge requests found
......@@ -55,10 +55,15 @@ class ConnectionService : ConnectionService() {
val account = request.extras.getString(ConversationPath.KEY_ACCOUNT_ID)
val contactId = request.extras.getString(ConversationPath.KEY_CONVERSATION_URI)
if (account != null && contactId != null) {
val profile = conversationFacade.observeConversation(account, Uri.fromString(contactId), false).blockingFirst()
Log.w(TAG, "Set connection metadata ${profile.title} ${android.net.Uri.parse(profile.uriTitle)}")
setCallerDisplayName(profile.title, TelecomManager.PRESENTATION_ALLOWED)
setAddress(android.net.Uri.parse(profile.uriTitle), TelecomManager.PRESENTATION_UNKNOWN)
try {
val profile = conversationFacade.observeConversation(account, Uri.fromString(contactId), false).blockingFirst()
Log.w(TAG, "Set connection metadata ${profile.title} ${android.net.Uri.parse(profile.uriTitle)}")
setCallerDisplayName(profile.title, TelecomManager.PRESENTATION_ALLOWED)
setAddress(android.net.Uri.parse(profile.uriTitle), TelecomManager.PRESENTATION_UNKNOWN)
} catch (e: Exception) {
Log.e(TAG, "Error setting connection metadata", e)
setAddress(request.address, TelecomManager.PRESENTATION_UNKNOWN)
}
} else
setAddress(request.address, TelecomManager.PRESENTATION_UNKNOWN)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment