diff options
author | c457 <android.c357@gmail.com> | 2016-01-05 21:06:56 -0600 |
---|---|---|
committer | Ethan Chen <intervigil@gmail.com> | 2016-03-10 14:05:40 -0800 |
commit | ba3877845ec7b34fd13393aeed7ad74dcb727a4c (patch) | |
tree | 034f6cc5a111c9e1b6b8a2bf199d5492a296875d | |
parent | 2fd815ffc3cac5655d0809bf762400e452734114 (diff) | |
download | frameworks_av-ba3877845ec7b34fd13393aeed7ad74dcb727a4c.zip frameworks_av-ba3877845ec7b34fd13393aeed7ad74dcb727a4c.tar.gz frameworks_av-ba3877845ec7b34fd13393aeed7ad74dcb727a4c.tar.bz2 |
audiopolicy: squashed support for pre-kitkat audio blobs
Squash of the following:
commit 40c41a743a4345ad26b6eab41755c5b474f75853
Author: chrmhoffmann <chrmhoffmann@gmail.com>
Date: Sat Nov 29 19:32:27 2014 +0100
pre kitkat audio legacy policy fix for hotword (ok google)
Change-Id: I5bb90fb90f373461a98609226a5cea50ac5266e9
commit d47b306954b96142323c79b976edeb3eaa3b46dd
Author: chrmhoffmann <chrmhoffmann@gmail.com>
Date: Sun Nov 23 18:22:35 2014 +0100
commit d47b306954b96142323c79b976edeb3eaa3b46dd
Author: chrmhoffmann <chrmhoffmann@gmail.com>
Date: Sun Nov 23 18:22:35 2014 +0100
pre-kitkat audio policy blobs re-activated.
Change-Id: Idfcb03d0a4aa0a099bf5a17b7bf592ab402e3255
Change-Id: Iae65c6ccb6dcb120a6fc20978b8a69e6af39a51a
-rw-r--r-- | services/audiopolicy/Android.mk | 4 | ||||
-rw-r--r-- | services/audiopolicy/service/AudioPolicyClientImplLegacy.cpp | 5 | ||||
-rw-r--r-- | services/audiopolicy/service/AudioPolicyInterfaceImplLegacy.cpp | 9 |
3 files changed, 18 insertions, 0 deletions
diff --git a/services/audiopolicy/Android.mk b/services/audiopolicy/Android.mk index 5b38e1c..69fc0e8 100644 --- a/services/audiopolicy/Android.mk +++ b/services/audiopolicy/Android.mk @@ -40,6 +40,10 @@ LOCAL_SHARED_LIBRARIES += \ libaudiopolicymanager endif +ifeq ($(BOARD_HAVE_PRE_KITKAT_AUDIO_POLICY_BLOB),true) + LOCAL_CFLAGS += -DHAVE_PRE_KITKAT_AUDIO_POLICY_BLOB +endif + LOCAL_STATIC_LIBRARIES := \ libmedia_helper \ libaudiopolicycomponents diff --git a/services/audiopolicy/service/AudioPolicyClientImplLegacy.cpp b/services/audiopolicy/service/AudioPolicyClientImplLegacy.cpp index a79f8ae..36c85f1 100644 --- a/services/audiopolicy/service/AudioPolicyClientImplLegacy.cpp +++ b/services/audiopolicy/service/AudioPolicyClientImplLegacy.cpp @@ -125,8 +125,13 @@ audio_io_handle_t aps_open_output_on_module(void *service __unused, audio_output_flags_t flags, const audio_offload_info_t *offloadInfo) { +#ifdef HAVE_PRE_KITKAT_AUDIO_POLICY_BLOB + return open_output(module, pDevices, pSamplingRate, pFormat, pChannelMask, + pLatencyMs, flags, NULL); +#else return open_output(module, pDevices, pSamplingRate, pFormat, pChannelMask, pLatencyMs, flags, offloadInfo); +#endif } audio_io_handle_t aps_open_dup_output(void *service __unused, diff --git a/services/audiopolicy/service/AudioPolicyInterfaceImplLegacy.cpp b/services/audiopolicy/service/AudioPolicyInterfaceImplLegacy.cpp index f76b5c8..318c6d2 100644 --- a/services/audiopolicy/service/AudioPolicyInterfaceImplLegacy.cpp +++ b/services/audiopolicy/service/AudioPolicyInterfaceImplLegacy.cpp @@ -275,6 +275,11 @@ status_t AudioPolicyService::getInputForAttr(const audio_attributes_t *attr, return BAD_VALUE; } +#ifdef HAVE_PRE_KITKAT_AUDIO_POLICY_BLOB + if (inputSource == AUDIO_SOURCE_HOTWORD) + inputSource = AUDIO_SOURCE_VOICE_RECOGNITION; +#endif + sp<AudioPolicyEffects>audioPolicyEffects; { Mutex::Autolock _l(mLock); @@ -524,6 +529,9 @@ status_t AudioPolicyService::queryDefaultPreProcessing(int audioSession, bool AudioPolicyService::isOffloadSupported(const audio_offload_info_t& info) { +#ifdef HAVE_PRE_KITKAT_AUDIO_POLICY_BLOB + return false; +#else if (mpAudioPolicy == NULL) { ALOGV("mpAudioPolicy == NULL"); return false; @@ -535,6 +543,7 @@ bool AudioPolicyService::isOffloadSupported(const audio_offload_info_t& info) } return mpAudioPolicy->is_offload_supported(mpAudioPolicy, &info); +#endif } status_t AudioPolicyService::listAudioPorts(audio_port_role_t role __unused, |