From 865aeda6f2311b5e772705e2b20c5e65b445f278 Mon Sep 17 00:00:00 2001 From: Cody Henthorne Date: Thu, 17 Mar 2022 12:04:33 -0400 Subject: [PATCH] Disable telecom integration. --- .../service/webrtc/AndroidTelecomUtil.kt | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/AndroidTelecomUtil.kt b/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/AndroidTelecomUtil.kt index 3a5326cb2..3ba9db8cc 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/AndroidTelecomUtil.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/AndroidTelecomUtil.kt @@ -39,18 +39,18 @@ object AndroidTelecomUtil { @JvmStatic val telecomSupported: Boolean get() { - if (Build.VERSION.SDK_INT >= 26 && !systemRejected) { - if (!accountRegistered) { - registerPhoneAccount() - } - - if (accountRegistered) { - val phoneAccount = ContextCompat.getSystemService(context, TelecomManager::class.java)!!.getPhoneAccount(getPhoneAccountHandle()) - if (phoneAccount != null && phoneAccount.isEnabled) { - return true - } - } - } +// if (Build.VERSION.SDK_INT >= 26 && !systemRejected) { +// if (!accountRegistered) { +// registerPhoneAccount() +// } +// +// if (accountRegistered) { +// val phoneAccount = ContextCompat.getSystemService(context, TelecomManager::class.java)!!.getPhoneAccount(getPhoneAccountHandle()) +// if (phoneAccount != null && phoneAccount.isEnabled) { +// return true +// } +// } +// } return false } @@ -161,7 +161,7 @@ object AndroidTelecomUtil { if (telecomSupported) { val connection: AndroidCallConnection? = connections[recipientId] Log.i(TAG, "Selecting audio route: $device connection: ${connection != null}") - if (connection != null) { + if (connection?.callAudioState != null) { when (device) { SignalAudioManager.AudioDevice.SPEAKER_PHONE -> connection.setAudioRouteIfDifferent(CallAudioState.ROUTE_SPEAKER) SignalAudioManager.AudioDevice.BLUETOOTH -> connection.setAudioRouteIfDifferent(CallAudioState.ROUTE_BLUETOOTH)