diff options
author | Emilio López <turl@tuxfamily.org> | 2011-11-01 16:11:00 +0000 |
---|---|---|
committer | Emilio López <turl@tuxfamily.org> | 2011-11-14 01:39:46 +0000 |
commit | 8531e8451f566b81d1ccf8cfef807fef8d78173b (patch) | |
tree | 1cf420f4f902d65200026310f540b3a9b395f97d /services | |
parent | c6a04fa7e67316bceea7818c73cd478b6edddbe7 (diff) | |
download | frameworks_base-8531e8451f566b81d1ccf8cfef807fef8d78173b.zip frameworks_base-8531e8451f566b81d1ccf8cfef807fef8d78173b.tar.gz frameworks_base-8531e8451f566b81d1ccf8cfef807fef8d78173b.tar.bz2 |
Implement hack to enable audio thru docks on Motorola phones
This allows us to pass a routing parameter to io 1 while sending
the DockState parameter to io 0 simultaneously. This is required
to enable the correct audio routing when docking/undocking and
allows audio on docks to work when combined with the DockAudio
package.
Change-Id: I443f6a44c9f222773b830e17aa6779882d8f9300
Diffstat (limited to 'services')
-rw-r--r-- | services/audioflinger/Android.mk | 4 | ||||
-rw-r--r-- | services/audioflinger/AudioFlinger.cpp | 13 |
2 files changed, 17 insertions, 0 deletions
diff --git a/services/audioflinger/Android.mk b/services/audioflinger/Android.mk index d9507c9..b33c2a8 100644 --- a/services/audioflinger/Android.mk +++ b/services/audioflinger/Android.mk @@ -142,4 +142,8 @@ ifeq ($(BOARD_USE_LVMX),true) # LOCAL_SHARED_LIBRARIES += liblvmxipc endif +ifeq ($(BOARD_USE_MOTO_DOCK_HACK),true) + LOCAL_CFLAGS += -DMOTO_DOCK_HACK +endif + include $(BUILD_SHARED_LIBRARY) diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index cf424be..8ff2df6 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -722,7 +722,20 @@ status_t AudioFlinger::setParameters(int ioHandle, const String8& keyValuePairs) } #endif mHardwareStatus = AUDIO_HW_IDLE; +#ifdef MOTO_DOCK_HACK + AudioParameter param = AudioParameter(keyValuePairs); + String8 key = String8("DockState"); + int device; + if (NO_ERROR != param.getInt(key, device)) { + LOGD("setParameters(): DockState not present"); + } else { + /* We also need to pass routing=int */ + ioHandle = 1; + LOGD("setParameters(): DockState %d trick done!", device); + } +#else return result; +#endif } // hold a strong ref on thread in case closeOutput() or closeInput() is called |