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

Commit 7134c3bd authored by Suresh Koleti's avatar Suresh Koleti
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 9083f2c3
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ import android.telephony.TelephonyManager;
import com.android.internal.telephony.CallStateException;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.TelephonyProperties;
import com.android.internal.telephony.util.BlacklistUtils;
import com.android.internal.util.IndentingPrintWriter;
@@ -660,12 +661,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