summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2015-12-07 23:05:20 +0000
committerandroid-build-merger <android-build-merger@google.com>2015-12-07 23:05:20 +0000
commit8aefd1fd740115054c294f1ce1b86b76f44d7d71 (patch)
treee38e7c0785fc928fe82c89446df27692d3b8d129
parente5fddc5f16e6c71590fe3056c86c381410027fb1 (diff)
parent9ae451c42fac9257a2254d64ffbe6f60cdd97fd6 (diff)
Move auto-speakerphone logic to Telecom.
am: 3d6516ed91 * commit '3d6516ed91cccc17c4f95495a9af5088be8b1ff9': Move auto-speakerphone logic to Telecom.
-rw-r--r--InCallUI/src/com/android/incallui/VideoCallPresenter.java43
1 files changed, 0 insertions, 43 deletions
diff --git a/InCallUI/src/com/android/incallui/VideoCallPresenter.java b/InCallUI/src/com/android/incallui/VideoCallPresenter.java
index b663bb8bd..8e88afc13 100644
--- a/InCallUI/src/com/android/incallui/VideoCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/VideoCallPresenter.java
@@ -162,11 +162,6 @@ public class VideoCallPresenter extends Presenter<VideoCallPresenter.VideoCallUi
*/
private int mPreviewSurfaceState = PreviewSurfaceState.NONE;
- /**
- * Saves the audio mode which was selected prior to going into a video call.
- */
- private static int sPrevVideoAudioMode = AudioModeProvider.AUDIO_MODE_INVALID;
-
private static boolean mIsVideoMode = false;
/**
@@ -408,8 +403,6 @@ public class VideoCallPresenter extends Presenter<VideoCallPresenter.VideoCallUi
" isVideoMode=" + isVideoMode());
if (newState == InCallPresenter.InCallState.NO_CALLS) {
- updateAudioMode(false);
-
if (isVideoMode()) {
exitVideoMode();
}
@@ -702,48 +695,12 @@ public class VideoCallPresenter extends Presenter<VideoCallPresenter.VideoCallUi
enableCamera(videoCall, isCameraRequired(newVideoState));
}
mCurrentVideoState = newVideoState;
- updateAudioMode(true);
mIsVideoMode = true;
maybeAutoEnterFullscreen(call);
}
- //TODO: Move this into Telecom. InCallUI should not be this close to audio functionality.
- private void updateAudioMode(boolean enableSpeaker) {
- if (!isSpeakerEnabledForVideoCalls()) {
- Log.d(this, "Speaker is disabled. Can't update audio mode");
- return;
- }
-
- final TelecomAdapter telecomAdapter = TelecomAdapter.getInstance();
- final boolean isPrevAudioModeValid =
- sPrevVideoAudioMode != AudioModeProvider.AUDIO_MODE_INVALID;
-
- Log.d(this, "Is previous audio mode valid = " + isPrevAudioModeValid + " enableSpeaker is "
- + enableSpeaker);
-
- // Set audio mode to previous mode if enableSpeaker is false.
- if (isPrevAudioModeValid && !enableSpeaker) {
- telecomAdapter.setAudioRoute(sPrevVideoAudioMode);
- sPrevVideoAudioMode = AudioModeProvider.AUDIO_MODE_INVALID;
- return;
- }
-
- int currentAudioMode = AudioModeProvider.getInstance().getAudioMode();
-
- // Set audio mode to speaker if enableSpeaker is true and bluetooth or headset are not
- // connected and it's a video call.
- if (!isAudioRouteEnabled(currentAudioMode,
- CallAudioState.ROUTE_BLUETOOTH | CallAudioState.ROUTE_WIRED_HEADSET) &&
- !isPrevAudioModeValid && enableSpeaker && CallUtils.isVideoCall(mPrimaryCall)) {
- sPrevVideoAudioMode = currentAudioMode;
-
- Log.d(this, "Routing audio to speaker");
- telecomAdapter.setAudioRoute(CallAudioState.ROUTE_SPEAKER);
- }
- }
-
private static boolean isSpeakerEnabledForVideoCalls() {
// TODO: Make this a carrier configurable setting. For now this is always true. b/20090407
return true;