Disable telecom integration.

fork-5.53.8
Cody Henthorne 2022-03-17 12:04:33 -04:00
rodzic 2c4ebedda4
commit 865aeda6f2
1 zmienionych plików z 13 dodań i 13 usunięć

Wyświetl plik

@ -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)