summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2015-05-19 12:55:56 -0700
committerTyler Gunn <tgunn@google.com>2015-12-06 22:05:00 -0800
commit9ae451c42fac9257a2254d64ffbe6f60cdd97fd6 (patch)
tree875fe4c4a75e6cef147a276ee3327cdac28e4fe0 /InCallUI
parentebd8a06582ed251a678fd0b0008f74b81d74e160 (diff)
Move auto-speakerphone logic to Telecom.
Removing speaker logic from InCall. Bug: 20090407 Change-Id: Ic5108390508f1175d087f023b36a58791897c8a3
Diffstat (limited to 'InCallUI')
-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;