Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4ff38fd authored by jiabin's avatar jiabin
Browse files

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
parent 35b216e6
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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 @@ audio_module_handle_t AudioFlinger::loadHwModule_l(const char *name)

    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;
        }
    }