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

Commit b8a4e87c authored by Oscar Azucena's avatar Oscar Azucena
Browse files

Fix audio control device to context test

Added a fix to check if the audio device repeats since the original
change did not correctly add the context to the already set volume
group contexts list.

Bug: 359686069
Test: atest VtsAidlHalAudioControlTest
Flag: EXEMPT HAL interface
Change-Id: Iee3751349d6609c93e383c2b83fc8525e8335cac
parent 3dae6619
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -125,12 +125,13 @@ bool hasValidAudioRoute(const DeviceToContextEntry& entry, std::string& message,
    }
    std::set<std::string> contextInRoute;
    for (const auto& context : entry.contextNames) {
        if (!contextInRoute.contains(ToString(context))) {
            continue;
        }
        message = " Context can not repeat for the same DeviceToContextEntry";
        std::string contextString = ToString(context);
        if (contextInRoute.contains(contextString)) {
            message = " Context " + contextString + " repeats for DeviceToContextEntry";
            return false;
        }
        groupDevices.insert(contextString);
    }
    audiomediacommon::AudioDeviceDescription description;
    if (!testutils::getAudioPortDeviceDescriptor(entry.device, description)) {
        message = " DeviceToContextEntry must have a valid device port";