Loading src/com/android/server/telecom/Call.java +9 −6 Original line number Diff line number Diff line Loading @@ -103,7 +103,7 @@ public class Call implements CreateConnectionResponse { void onExtrasRemoved(Call c, int source, List<String> keys); void onHandleChanged(Call call); void onCallerDisplayNameChanged(Call call); void onVideoStateChanged(Call call); void onVideoStateChanged(Call call, int previousVideoState, int newVideoState); void onTargetPhoneAccountChanged(Call call); void onConnectionManagerPhoneAccountChanged(Call call); void onPhoneAccountChanged(Call call); Loading Loading @@ -160,7 +160,7 @@ public class Call implements CreateConnectionResponse { @Override public void onCallerDisplayNameChanged(Call call) {} @Override public void onVideoStateChanged(Call call) {} public void onVideoStateChanged(Call call, int previousVideoState, int newVideoState) {} @Override public void onTargetPhoneAccountChanged(Call call) {} @Override Loading Loading @@ -1895,11 +1895,14 @@ public class Call implements CreateConnectionResponse { mVideoStateHistory = mVideoStateHistory | videoState; } int previousVideoState = mVideoState; mVideoState = videoState; if (mVideoState != previousVideoState) { Log.event(this, Log.Events.VIDEO_STATE_CHANGED, VideoProfile.videoStateToString(videoState)); mVideoState = videoState; for (Listener l : mListeners) { l.onVideoStateChanged(this); l.onVideoStateChanged(this, previousVideoState, mVideoState); } } if (VideoProfile.isVideo(videoState)) { Loading src/com/android/server/telecom/CallAudioManager.java +19 −0 Original line number Diff line number Diff line Loading @@ -314,6 +314,25 @@ public class CallAudioManager extends CallsManagerListenerBase { CallAudioRouteStateMachine.UPDATE_SYSTEM_AUDIO_ROUTE); } @Override public void onVideoStateChanged(Call call, int previousVideoState, int newVideoState) { if (call != getForegroundCall()) { Log.d(LOG_TAG, "Ignoring video state change from %s to %s for call %s -- not " + "foreground.", VideoProfile.videoStateToString(previousVideoState), VideoProfile.videoStateToString(newVideoState), call.getId()); return; } if (!VideoProfile.isVideo(previousVideoState) && mCallsManager.isSpeakerphoneAutoEnabledForVideoCalls(newVideoState)) { Log.d(LOG_TAG, "Switching to speaker because call %s transitioned video state from %s" + " to %s", call.getId(), VideoProfile.videoStateToString(previousVideoState), VideoProfile.videoStateToString(newVideoState)); mCallAudioRouteStateMachine.sendMessageWithSessionInfo( CallAudioRouteStateMachine.SWITCH_SPEAKER); } } public CallAudioState getCallAudioState() { return mCallAudioRouteStateMachine.getCurrentCallAudioState(); } Loading src/com/android/server/telecom/CallsManager.java +6 −6 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ public class CallsManager extends Call.ListenerBase void onRingbackRequested(Call call, boolean ringback); void onIsConferencedChanged(Call call); void onIsVoipAudioModeChanged(Call call); void onVideoStateChanged(Call call); void onVideoStateChanged(Call call, int previousVideoState, int newVideoState); void onCanAddCallChanged(boolean canAddCall); void onSessionModifyRequestReceived(Call call, VideoProfile videoProfile); void onHoldToneRequested(Call call); Loading Loading @@ -493,9 +493,9 @@ public class CallsManager extends Call.ListenerBase } @Override public void onVideoStateChanged(Call call) { public void onVideoStateChanged(Call call, int previousVideoState, int newVideoState) { for (CallsManagerListener listener : mListeners) { listener.onVideoStateChanged(call); listener.onVideoStateChanged(call, previousVideoState, newVideoState); } } Loading Loading @@ -924,7 +924,7 @@ public class CallsManager extends Call.ListenerBase final boolean useSpeakerWhenDocked = mContext.getResources().getBoolean( R.bool.use_speaker_when_docked); final boolean useSpeakerForDock = isSpeakerphoneEnabledForDock(); final boolean useSpeakerForVideoCall = isSpeakerphoneAutoEnabled(videoState); final boolean useSpeakerForVideoCall = isSpeakerphoneAutoEnabledForVideoCalls(videoState); // Auto-enable speakerphone if the originating intent specified to do so, if the call // is a video call, of if using speaker when docked Loading Loading @@ -1023,7 +1023,7 @@ public class CallsManager extends Call.ListenerBase // We do not update the UI until we get confirmation of the answer() through // {@link #markCallAsActive}. call.answer(videoState); if (isSpeakerphoneAutoEnabled(videoState)) { if (isSpeakerphoneAutoEnabledForVideoCalls(videoState)) { call.setStartWithSpeakerphoneOn(true); } } Loading @@ -1037,7 +1037,7 @@ public class CallsManager extends Call.ListenerBase * @param videoState The video state of the call. * @return {@code true} if the speakerphone should be enabled. */ private boolean isSpeakerphoneAutoEnabled(int videoState) { public boolean isSpeakerphoneAutoEnabledForVideoCalls(int videoState) { return VideoProfile.isVideo(videoState) && !mWiredHeadsetManager.isPluggedIn() && !mBluetoothManager.isBluetoothAvailable() && Loading src/com/android/server/telecom/CallsManagerListenerBase.java +1 −1 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ public class CallsManagerListenerBase implements CallsManager.CallsManagerListen } @Override public void onVideoStateChanged(Call call) { public void onVideoStateChanged(Call call, int previousVideoState, int newVideoState) { } @Override Loading src/com/android/server/telecom/InCallController.java +1 −1 Original line number Diff line number Diff line Loading @@ -546,7 +546,7 @@ public final class InCallController extends CallsManagerListenerBase { } @Override public void onVideoStateChanged(Call call) { public void onVideoStateChanged(Call call, int previousVideoState, int newVideoState) { updateCall(call); } Loading Loading
src/com/android/server/telecom/Call.java +9 −6 Original line number Diff line number Diff line Loading @@ -103,7 +103,7 @@ public class Call implements CreateConnectionResponse { void onExtrasRemoved(Call c, int source, List<String> keys); void onHandleChanged(Call call); void onCallerDisplayNameChanged(Call call); void onVideoStateChanged(Call call); void onVideoStateChanged(Call call, int previousVideoState, int newVideoState); void onTargetPhoneAccountChanged(Call call); void onConnectionManagerPhoneAccountChanged(Call call); void onPhoneAccountChanged(Call call); Loading Loading @@ -160,7 +160,7 @@ public class Call implements CreateConnectionResponse { @Override public void onCallerDisplayNameChanged(Call call) {} @Override public void onVideoStateChanged(Call call) {} public void onVideoStateChanged(Call call, int previousVideoState, int newVideoState) {} @Override public void onTargetPhoneAccountChanged(Call call) {} @Override Loading Loading @@ -1895,11 +1895,14 @@ public class Call implements CreateConnectionResponse { mVideoStateHistory = mVideoStateHistory | videoState; } int previousVideoState = mVideoState; mVideoState = videoState; if (mVideoState != previousVideoState) { Log.event(this, Log.Events.VIDEO_STATE_CHANGED, VideoProfile.videoStateToString(videoState)); mVideoState = videoState; for (Listener l : mListeners) { l.onVideoStateChanged(this); l.onVideoStateChanged(this, previousVideoState, mVideoState); } } if (VideoProfile.isVideo(videoState)) { Loading
src/com/android/server/telecom/CallAudioManager.java +19 −0 Original line number Diff line number Diff line Loading @@ -314,6 +314,25 @@ public class CallAudioManager extends CallsManagerListenerBase { CallAudioRouteStateMachine.UPDATE_SYSTEM_AUDIO_ROUTE); } @Override public void onVideoStateChanged(Call call, int previousVideoState, int newVideoState) { if (call != getForegroundCall()) { Log.d(LOG_TAG, "Ignoring video state change from %s to %s for call %s -- not " + "foreground.", VideoProfile.videoStateToString(previousVideoState), VideoProfile.videoStateToString(newVideoState), call.getId()); return; } if (!VideoProfile.isVideo(previousVideoState) && mCallsManager.isSpeakerphoneAutoEnabledForVideoCalls(newVideoState)) { Log.d(LOG_TAG, "Switching to speaker because call %s transitioned video state from %s" + " to %s", call.getId(), VideoProfile.videoStateToString(previousVideoState), VideoProfile.videoStateToString(newVideoState)); mCallAudioRouteStateMachine.sendMessageWithSessionInfo( CallAudioRouteStateMachine.SWITCH_SPEAKER); } } public CallAudioState getCallAudioState() { return mCallAudioRouteStateMachine.getCurrentCallAudioState(); } Loading
src/com/android/server/telecom/CallsManager.java +6 −6 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ public class CallsManager extends Call.ListenerBase void onRingbackRequested(Call call, boolean ringback); void onIsConferencedChanged(Call call); void onIsVoipAudioModeChanged(Call call); void onVideoStateChanged(Call call); void onVideoStateChanged(Call call, int previousVideoState, int newVideoState); void onCanAddCallChanged(boolean canAddCall); void onSessionModifyRequestReceived(Call call, VideoProfile videoProfile); void onHoldToneRequested(Call call); Loading Loading @@ -493,9 +493,9 @@ public class CallsManager extends Call.ListenerBase } @Override public void onVideoStateChanged(Call call) { public void onVideoStateChanged(Call call, int previousVideoState, int newVideoState) { for (CallsManagerListener listener : mListeners) { listener.onVideoStateChanged(call); listener.onVideoStateChanged(call, previousVideoState, newVideoState); } } Loading Loading @@ -924,7 +924,7 @@ public class CallsManager extends Call.ListenerBase final boolean useSpeakerWhenDocked = mContext.getResources().getBoolean( R.bool.use_speaker_when_docked); final boolean useSpeakerForDock = isSpeakerphoneEnabledForDock(); final boolean useSpeakerForVideoCall = isSpeakerphoneAutoEnabled(videoState); final boolean useSpeakerForVideoCall = isSpeakerphoneAutoEnabledForVideoCalls(videoState); // Auto-enable speakerphone if the originating intent specified to do so, if the call // is a video call, of if using speaker when docked Loading Loading @@ -1023,7 +1023,7 @@ public class CallsManager extends Call.ListenerBase // We do not update the UI until we get confirmation of the answer() through // {@link #markCallAsActive}. call.answer(videoState); if (isSpeakerphoneAutoEnabled(videoState)) { if (isSpeakerphoneAutoEnabledForVideoCalls(videoState)) { call.setStartWithSpeakerphoneOn(true); } } Loading @@ -1037,7 +1037,7 @@ public class CallsManager extends Call.ListenerBase * @param videoState The video state of the call. * @return {@code true} if the speakerphone should be enabled. */ private boolean isSpeakerphoneAutoEnabled(int videoState) { public boolean isSpeakerphoneAutoEnabledForVideoCalls(int videoState) { return VideoProfile.isVideo(videoState) && !mWiredHeadsetManager.isPluggedIn() && !mBluetoothManager.isBluetoothAvailable() && Loading
src/com/android/server/telecom/CallsManagerListenerBase.java +1 −1 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ public class CallsManagerListenerBase implements CallsManager.CallsManagerListen } @Override public void onVideoStateChanged(Call call) { public void onVideoStateChanged(Call call, int previousVideoState, int newVideoState) { } @Override Loading
src/com/android/server/telecom/InCallController.java +1 −1 Original line number Diff line number Diff line Loading @@ -546,7 +546,7 @@ public final class InCallController extends CallsManagerListenerBase { } @Override public void onVideoStateChanged(Call call) { public void onVideoStateChanged(Call call, int previousVideoState, int newVideoState) { updateCall(call); } Loading