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

Commit cb9c039f authored by Eric Laurent's avatar Eric Laurent Committed by Automerger Merge Worker
Browse files

Merge "[BUG] audiopolicy: engineconfigurable: prevent illegal map access" am:...

Merge "[BUG] audiopolicy: engineconfigurable: prevent illegal map access" am: e3556718 am: e9ea3ceb am: b7027173

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1409790

Change-Id: Ia4ad8b3ed7dff36ee7cf90c5995c09b45ba4a056
parents 584bd689 b7027173
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -299,8 +299,13 @@ DeviceVector Engine::getOutputDevicesForAttributes(const audio_attributes_t &att
    if (device != nullptr) {
        return DeviceVector(device);
    }
    return fromCache? getCachedDevices(strategy) : getDevicesForProductStrategy(strategy);
}

    return fromCache? mDevicesForStrategies.at(strategy) : getDevicesForProductStrategy(strategy);
DeviceVector Engine::getCachedDevices(product_strategy_t ps) const
{
    return mDevicesForStrategies.find(ps) != mDevicesForStrategies.end() ?
                mDevicesForStrategies.at(ps) : DeviceVector{};
}

DeviceVector Engine::getOutputDevicesForStream(audio_stream_type_t stream, bool fromCache) const
+1 −0
Original line number Diff line number Diff line
@@ -126,6 +126,7 @@ private:
    status_t loadAudioPolicyEngineConfig();

    DeviceVector getDevicesForProductStrategy(product_strategy_t strategy) const;
    DeviceVector getCachedDevices(product_strategy_t ps) const;

    /**
     * Policy Parameter Manager hidden through a wrapper.