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

Commit 8d55422e authored by Suresh Koleti's avatar Suresh Koleti Committed by Gerrit - the friendly Code Review server
Browse files

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

Check persist.radio.ims.audio.output before enabling speaker
if property is set to disable speaker then MT VT calls should not
use the speaker.

Change-Id: I0c6288a8fd672c9b7a13edac11e29875d0df4eb7
CRs-Fixed: 776841
parent 137bb023
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