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

Commit df40c962 authored by Francois Gaffie's avatar Francois Gaffie Committed by Eric Laurent
Browse files

libaudiofoundation: get rid of convertion of device type from mask



The limitation of support of devices exceeding 32 and allowing
to store each one as a bit of a bitfield has been removed
(new limitation is 64bits).
The API of the wrapper is now using the DeviceSet type, allowing
to get rid of deviceTypesFromBitMask helper function

Bug: 189469490
Test: make

Signed-off-by: default avatarFrancois Gaffie <francois.gaffie@renault.com>
Change-Id: Ie7aee28b0b60b9e9fee788c291f06a5fb4693f8e
parent a12de218
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -111,26 +111,6 @@ static inline audio_devices_t deviceTypesToBitMask(const DeviceTypeSet& deviceTy
    return types;
}

// FIXME: This is temporary helper function. Remove this when getting rid of all
//  bit mask usages of audio device types.
static inline DeviceTypeSet deviceTypesFromBitMask(audio_devices_t types) {
    DeviceTypeSet deviceTypes;
    if ((types & AUDIO_DEVICE_BIT_IN) == 0) {
        for (auto deviceType : AUDIO_DEVICE_OUT_ALL_ARRAY) {
            if ((types & deviceType) == deviceType) {
                deviceTypes.insert(deviceType);
            }
        }
    } else {
        for (auto deviceType : AUDIO_DEVICE_IN_ALL_ARRAY) {
            if ((types & deviceType) == deviceType) {
                deviceTypes.insert(deviceType);
            }
        }
    }
    return deviceTypes;
}

std::string deviceTypesToString(const DeviceTypeSet& deviceTypes);

bool deviceTypesToString(const DeviceTypeSet& deviceTypes, std::string &str);