summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNivedita Sarkar <nsarkar@codeaurora.org>2014-12-01 19:26:17 -0800
committerArne Coucheron <arco68@gmail.com>2014-12-13 01:46:02 +0100
commit013959488e93d3657bc4ffd3f59e39ba71ea3130 (patch)
treec9203d38577ec9cfae89f8c70afa5a14157c13a3
parent4e67b43cc7790ebb05c006b73e5218535f6a3add (diff)
downloadpackages_apps_InCallUI-013959488e93d3657bc4ffd3f59e39ba71ea3130.tar.gz
packages_apps_InCallUI-013959488e93d3657bc4ffd3f59e39ba71ea3130.tar.bz2
packages_apps_InCallUI-013959488e93d3657bc4ffd3f59e39ba71ea3130.zip
IMS-VT: Set audio route to Speaker if current route is not bluetooth or headset
- We always set the audio route to speaker when we enter video mode. - That is not correct. We should check if headset or bluetooth is connected before defaulting to speaker. Change-Id: I42f9ba27443a44adb256e0bca27cc7ec0c779e7b CRs-Fixed: 755377
-rw-r--r--src/com/android/incallui/VideoCallPresenter.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/com/android/incallui/VideoCallPresenter.java b/src/com/android/incallui/VideoCallPresenter.java
index 19ad3f4c..373cf625 100644
--- a/src/com/android/incallui/VideoCallPresenter.java
+++ b/src/com/android/incallui/VideoCallPresenter.java
@@ -544,10 +544,15 @@ public class VideoCallPresenter extends Presenter<VideoCallPresenter.VideoCallUi
// If the speaker is explicitly disabled then do not enable it.
if (SystemProperties.getInt(PROPERTY_IMS_AUDIO_OUTPUT,
IMS_AUDIO_OUTPUT_DEFAULT) != IMS_AUDIO_OUTPUT_DISABLE_SPEAKER) {
- Log.d(this, "Routing audio to speaker");
- mPreVideoAudioMode = AudioModeProvider.getInstance().getAudioMode();
- TelecomAdapter.getInstance().setAudioRoute(AudioState.ROUTE_SPEAKER);
+ int currentAudioMode = AudioModeProvider.getInstance().getAudioMode();
+ if (!isAudioRouteEnabled(currentAudioMode,
+ AudioState.ROUTE_BLUETOOTH | AudioState.ROUTE_WIRED_HEADSET)) {
+ mPreVideoAudioMode = currentAudioMode;
+
+ Log.d(this, "Routing audio to speaker");
+ TelecomAdapter.getInstance().setAudioRoute(AudioState.ROUTE_SPEAKER);
+ }
}
}
@@ -886,6 +891,10 @@ public class VideoCallPresenter extends Presenter<VideoCallPresenter.VideoCallUi
ui.setDisplayVideoSize(size.x, size.y);
}
+ private static boolean isAudioRouteEnabled(int audioRoute, int audioRouteMask) {
+ return ((audioRoute & audioRouteMask) != 0);
+ }
+
/**
* Defines the VideoCallUI interactions.
*/