mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-28 09:09:20 +00:00
Fixed use of TelecomManager APIs
This commit is contained in:
parent
5391c12473
commit
597581faa5
1 changed files with 6 additions and 8 deletions
|
|
@ -77,10 +77,7 @@ class TelecomManager
|
|||
"$TAG android.software.telecom feature is [${if (hasTelecomFeature) "available" else "not available"}]"
|
||||
)
|
||||
try {
|
||||
callsManager.registerAppWithTelecom(
|
||||
CallsManager.CAPABILITY_BASELINE or
|
||||
CallsManager.CAPABILITY_SUPPORTS_VIDEO_CALLING
|
||||
)
|
||||
callsManager.registerAppWithTelecom(CallsManager.CAPABILITY_SUPPORTS_VIDEO_CALLING)
|
||||
Log.i("$TAG App has been registered with Telecom")
|
||||
} catch (e: Exception) {
|
||||
Log.e("$TAG Can't init TelecomManager: $e")
|
||||
|
|
@ -110,11 +107,12 @@ class TelecomManager
|
|||
friend?.name ?: LinphoneUtils.getDisplayName(address)
|
||||
}
|
||||
|
||||
val isVideo = LinphoneUtils.isVideoEnabled(call)
|
||||
val type = if (isVideo) {
|
||||
CallAttributesCompat.CALL_TYPE_VIDEO_CALL
|
||||
} else {
|
||||
// Always set type to video (if enabled in Core) as it indicates that video is supported, not that it's being used at the time
|
||||
// https://developer.android.com/reference/kotlin/androidx/core/telecom/CallAttributesCompat#CALL_TYPE_VIDEO_CALL()
|
||||
val type = if (!call.core.isVideoEnabled) {
|
||||
CallAttributesCompat.CALL_TYPE_AUDIO_CALL
|
||||
} else {
|
||||
CallAttributesCompat.CALL_TYPE_VIDEO_CALL
|
||||
}
|
||||
|
||||
scope.launch {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue