Loading src/com/android/server/telecom/CallsManager.java +4 −1 Original line number Diff line number Diff line Loading @@ -2015,7 +2015,10 @@ public class CallsManager extends Call.ListenerBase // Auto-enable speakerphone if the originating intent specified to do so, if the call // is a video call, of if using speaker when docked call.setStartWithSpeakerphoneOn(speakerphoneOn || useSpeakerForVideoCall PhoneAccount account = mPhoneAccountRegistrar.getPhoneAccount( call.getTargetPhoneAccount(), call.getInitiatingUser()); boolean allowVideo = account.hasCapabilities(PhoneAccount.CAPABILITY_VIDEO_CALLING); call.setStartWithSpeakerphoneOn(speakerphoneOn || (useSpeakerForVideoCall && allowVideo) || (useSpeakerWhenDocked && useSpeakerForDock)); call.setVideoState(videoState); Loading tests/src/com/android/server/telecom/tests/CallsManagerTest.java +17 −1 Original line number Diff line number Diff line Loading @@ -42,9 +42,9 @@ import android.net.Uri; import android.os.Bundle; import android.os.Process; import android.os.SystemClock; import android.os.UserHandle; import android.telecom.CallerInfo; import android.telecom.Connection; import android.telecom.Log; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import android.telecom.TelecomManager; Loading Loading @@ -1195,6 +1195,22 @@ public class CallsManagerTest extends TelecomTestCase { assertTrue(ongoingCall.isVideoCallingSupportedByPhoneAccount()); } /** * Verifies that speakers is disabled when there's no video capabilities, even if a video call * tried to place. * @throws Exception */ @SmallTest @Test public void testSpeakerDisabledWhenNoVideoCapabilities() throws Exception { Call outgoingCall = addSpyCall(CallState.NEW); when(mPhoneAccountRegistrar.getPhoneAccount( any(PhoneAccountHandle.class), any(UserHandle.class))).thenReturn(SIM_1_ACCOUNT); mCallsManager.placeOutgoingCall(outgoingCall, TEST_ADDRESS, null, true, VideoProfile.STATE_TX_ENABLED); assertFalse(outgoingCall.getStartWithSpeakerphoneOn()); } private Call addSpyCall() { return addSpyCall(SIM_2_HANDLE, CallState.ACTIVE); Loading Loading
src/com/android/server/telecom/CallsManager.java +4 −1 Original line number Diff line number Diff line Loading @@ -2015,7 +2015,10 @@ public class CallsManager extends Call.ListenerBase // Auto-enable speakerphone if the originating intent specified to do so, if the call // is a video call, of if using speaker when docked call.setStartWithSpeakerphoneOn(speakerphoneOn || useSpeakerForVideoCall PhoneAccount account = mPhoneAccountRegistrar.getPhoneAccount( call.getTargetPhoneAccount(), call.getInitiatingUser()); boolean allowVideo = account.hasCapabilities(PhoneAccount.CAPABILITY_VIDEO_CALLING); call.setStartWithSpeakerphoneOn(speakerphoneOn || (useSpeakerForVideoCall && allowVideo) || (useSpeakerWhenDocked && useSpeakerForDock)); call.setVideoState(videoState); Loading
tests/src/com/android/server/telecom/tests/CallsManagerTest.java +17 −1 Original line number Diff line number Diff line Loading @@ -42,9 +42,9 @@ import android.net.Uri; import android.os.Bundle; import android.os.Process; import android.os.SystemClock; import android.os.UserHandle; import android.telecom.CallerInfo; import android.telecom.Connection; import android.telecom.Log; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import android.telecom.TelecomManager; Loading Loading @@ -1195,6 +1195,22 @@ public class CallsManagerTest extends TelecomTestCase { assertTrue(ongoingCall.isVideoCallingSupportedByPhoneAccount()); } /** * Verifies that speakers is disabled when there's no video capabilities, even if a video call * tried to place. * @throws Exception */ @SmallTest @Test public void testSpeakerDisabledWhenNoVideoCapabilities() throws Exception { Call outgoingCall = addSpyCall(CallState.NEW); when(mPhoneAccountRegistrar.getPhoneAccount( any(PhoneAccountHandle.class), any(UserHandle.class))).thenReturn(SIM_1_ACCOUNT); mCallsManager.placeOutgoingCall(outgoingCall, TEST_ADDRESS, null, true, VideoProfile.STATE_TX_ENABLED); assertFalse(outgoingCall.getStartWithSpeakerphoneOn()); } private Call addSpyCall() { return addSpyCall(SIM_2_HANDLE, CallState.ACTIVE); Loading