Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79caeb39 authored by Hall Liu's avatar Hall Liu
Browse files

Don't use RTT for calls to voicemail

Check whether an outgoing call is placed to a voicemail number before
setting the RTT property on it.

Bug: 110271520
Test: manual
Change-Id: I5035372b28b8566d9b6908db7925e620a3c93e18
parent 013ab637
Loading
Loading
Loading
Loading
+16 −4
Original line number Diff line number Diff line
@@ -1249,8 +1249,13 @@ public class CallsManager extends Call.ListenerBase
                    CallState.CONNECTING,
                    phoneAccountHandle == null ? "no-handle" : phoneAccountHandle.toString());

            if (isRttSettingOn() || (extras != null
                    && extras.getBoolean(TelecomManager.EXTRA_START_CALL_WITH_RTT, false))) {
            boolean isVoicemail = (call.getHandle() != null)
                    && (PhoneAccount.SCHEME_VOICEMAIL.equals(call.getHandle().getScheme())
                    || (accountToUse != null && mPhoneAccountRegistrar.isVoiceMailNumber(
                    accountToUse.getAccountHandle(), call.getHandle().getSchemeSpecificPart())));

            if (!isVoicemail && (isRttSettingOn() || (extras != null
                    && extras.getBoolean(TelecomManager.EXTRA_START_CALL_WITH_RTT, false)))) {
                Log.d(this, "Outgoing call requesting RTT, rtt setting is %b", isRttSettingOn());
                if (accountToUse != null
                        && accountToUse.hasCapabilities(PhoneAccount.CAPABILITY_RTT)) {
@@ -1833,8 +1838,15 @@ public class CallsManager extends Call.ListenerBase
                Log.d("phoneAccountSelected: default to voip mode for call %s", call.getId());
                call.setIsVoipAudioMode(true);
            }
            if (isRttSettingOn() || call.getIntentExtras()
                    .getBoolean(TelecomManager.EXTRA_START_CALL_WITH_RTT, false)) {

            boolean isVoicemail = (call.getHandle() != null)
                    && (PhoneAccount.SCHEME_VOICEMAIL.equals(call.getHandle().getScheme())
                    || (realPhoneAccount != null && mPhoneAccountRegistrar.isVoiceMailNumber(
                    realPhoneAccount.getAccountHandle(),
                    call.getHandle().getSchemeSpecificPart())));

            if (!isVoicemail && (isRttSettingOn() || call.getIntentExtras()
                    .getBoolean(TelecomManager.EXTRA_START_CALL_WITH_RTT, false))) {
                Log.d(this, "Outgoing call after account selection requesting RTT," +
                        " rtt setting is %b", isRttSettingOn());
                if (realPhoneAccount != null