summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy
diff options
context:
space:
mode:
Diffstat (limited to 'services/audiopolicy')
-rw-r--r--services/audiopolicy/Android.mk4
-rw-r--r--services/audiopolicy/service/AudioPolicyClientImplLegacy.cpp5
-rw-r--r--services/audiopolicy/service/AudioPolicyInterfaceImplLegacy.cpp9
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,