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

Commit 12776a1b authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

Convert mask types from uint32_t to enum type

This applies to the following types:

- audio_gain_mode_t;
- audio_flags_mask_t;
- audio_channel_representation_t;
- audio_channel_mask_t;
- audio_devices_t.

Enum types are distinct thus proper overloading on the type
is possible in C++. Also, assignments to enum types are
less prone to errors.

Bug: 169889714
Test: basic audio functionality
Change-Id: I07e96ae99724f38fe0b40194f4feab7ff68418e7
Merged-In: I07e96ae99724f38fe0b40194f4feab7ff68418e7
parent c86759a1
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -31,7 +31,7 @@ std::string deviceAddressToHal(const DeviceAddress& address) {
    // HAL assumes that the address is NUL-terminated.
    // HAL assumes that the address is NUL-terminated.
    char halAddress[AUDIO_DEVICE_MAX_ADDRESS_LEN];
    char halAddress[AUDIO_DEVICE_MAX_ADDRESS_LEN];
    memset(halAddress, 0, sizeof(halAddress));
    memset(halAddress, 0, sizeof(halAddress));
    uint32_t halDevice = static_cast<uint32_t>(address.device);
    audio_devices_t halDevice = static_cast<audio_devices_t>(address.device);
    if (getAudioDeviceOutAllA2dpSet().count(halDevice) > 0 ||
    if (getAudioDeviceOutAllA2dpSet().count(halDevice) > 0 ||
        halDevice == AUDIO_DEVICE_IN_BLUETOOTH_A2DP) {
        halDevice == AUDIO_DEVICE_IN_BLUETOOTH_A2DP) {
        snprintf(halAddress, sizeof(halAddress), "%02X:%02X:%02X:%02X:%02X:%02X",
        snprintf(halAddress, sizeof(halAddress), "%02X:%02X:%02X:%02X:%02X:%02X",