No need to query the HAL for mmap information if it is older than 7.1.
The HAL API to query MMAP information is not available on HAL 7.1.
Bug: 218979946
Test: make
Change-Id: I28cd7739a8b91c6d9db3c544ade4f3cd178e1f66
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 479906f..eb3c164 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -105,7 +105,7 @@
namespace android {
-#define MAX_AAUDIO_PROPERTY_DEVICE_HAL_VERSION 7.0
+#define MAX_AAUDIO_PROPERTY_DEVICE_HAL_VERSION 7.1
using ::android::base::StringPrintf;
using media::IEffectClient;
@@ -2360,11 +2360,12 @@
if (mDevicesFactoryHal->getHalVersion() > MAX_AAUDIO_PROPERTY_DEVICE_HAL_VERSION) {
if (int32_t mixerBursts = dev->getAAudioMixerBurstCount();
- mixerBursts > mAAudioBurstsPerBuffer) {
+ mixerBursts > 0 && mixerBursts > mAAudioBurstsPerBuffer) {
mAAudioBurstsPerBuffer = mixerBursts;
}
if (int32_t hwBurstMinMicros = dev->getAAudioHardwareBurstMinUsec();
- hwBurstMinMicros < mAAudioHwBurstMinMicros || mAAudioHwBurstMinMicros == 0) {
+ hwBurstMinMicros > 0
+ && (hwBurstMinMicros < mAAudioHwBurstMinMicros || mAAudioHwBurstMinMicros == 0)) {
mAAudioHwBurstMinMicros = hwBurstMinMicros;
}
}