summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorPraveen Bharathi <pbharathi@motorola.com>2010-11-02 19:23:30 -0700
committerIliyan Malchev <malchev@google.com>2010-11-03 15:38:12 -0700
commit26e37349831476d3225570af2dfbf1e459374c6b (patch)
tree2d927c9f6f8989abd6465d5d6725827867e2c55b /media
parentde04e5242ad7d95c392070e1a4f7acdf3809b91a (diff)
downloadframeworks_base-26e37349831476d3225570af2dfbf1e459374c6b.zip
frameworks_base-26e37349831476d3225570af2dfbf1e459374c6b.tar.gz
frameworks_base-26e37349831476d3225570af2dfbf1e459374c6b.tar.bz2
frameworks/base: switch audio to hdmi when cable is plugged in
Change-Id: I01c4ee968bc0ffbb6ce75370935571cc1ff6f8c7 Signed-off-by: Iliyan Malchev <malchev@google.com>
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/AudioService.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index a64158f..3bee906 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -314,6 +314,7 @@ public class AudioService extends IAudioService.Stub {
intentFilter.addAction(Intent.ACTION_DOCK_EVENT);
intentFilter.addAction(Intent.ACTION_USB_ANLG_HEADSET_PLUG);
intentFilter.addAction(Intent.ACTION_USB_DGTL_HEADSET_PLUG);
+ intentFilter.addAction(Intent.ACTION_HDMI_AUDIO_PLUG);
context.registerReceiver(mReceiver, intentFilter);
// Register for media button intent broadcasts.
@@ -1949,7 +1950,8 @@ public class AudioService extends IAudioService.Stub {
AudioSystem.DEVICE_STATE_AVAILABLE, "");
mConnectedDevices.put( new Integer(AudioSystem.DEVICE_OUT_ANLG_DOCK_HEADSET), "");
}
- } else if (action.equals(Intent.ACTION_USB_DGTL_HEADSET_PLUG)) {
+ } else if ( (action.equals(Intent.ACTION_USB_DGTL_HEADSET_PLUG)) ||
+ (action.equals(Intent.ACTION_HDMI_AUDIO_PLUG)) ) {
int state = intent.getIntExtra("state", 0);
Log.v(TAG, "Broadcast Receiver: Got ACTION_USB_DGTL_HEADSET_PLUG, state = "+state);
boolean isConnected = mConnectedDevices.containsKey(AudioSystem.DEVICE_OUT_DGTL_DOCK_HEADSET);