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

Commit 1dc9dbb7 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "IMS-VT: Check for property before enabling speaker for MT VT calls"

parents 729b6a0d 8d55422e
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import android.telecom.PhoneCapabilities;
import android.telecom.TelecomManager;
import android.telephony.TelephonyManager;

import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.TelephonyProperties;
import com.android.internal.util.IndentingPrintWriter;

@@ -649,12 +650,19 @@ public final class CallsManager extends Call.ListenerBase {
            call.answer(videoState);
            if (VideoProfile.VideoState.isVideo(videoState) &&
                !mWiredHeadsetManager.isPluggedIn() &&
                !mCallAudioManager.isBluetoothDeviceAvailable()) {
                !mCallAudioManager.isBluetoothDeviceAvailable() &&
                isSpeakerEnabledForVideoCalls()) {
                call.setStartWithSpeakerphoneOn(true);
            }
        }
    }

    private static boolean isSpeakerEnabledForVideoCalls() {
        return (SystemProperties.getInt(TelephonyProperties.PROPERTY_IMS_AUDIO_OUTPUT,
                PhoneConstants.IMS_AUDIO_OUTPUT_DEFAULT) ==
                PhoneConstants.IMS_AUDIO_OUTPUT_ENABLE_SPEAKER);
    }

    /**
     * Instructs Telecomm to deflect the specified call. Intended to be invoked by the in-call
     * app through {@link InCallAdapter} after Telecomm notifies it of an incoming call followed by