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

Commit 905d5083 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi Committed by Android (Google) Code Review
Browse files

Merge "AudioPolicy: tighter match for device descriptor query" into nyc-dev

parents becc4d86 f7f85438
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -50,15 +50,11 @@ bool DeviceDescriptor::equals(const sp<DeviceDescriptor>& other) const
{
    // Devices are considered equal if they:
    // - are of the same type (a device type cannot be AUDIO_DEVICE_NONE)
    // - have the same address or one device does not specify the address
    // - have the same channel mask or one device does not specify the channel mask
    // - have the same address
    if (other == 0) {
        return false;
    }
    return (mDeviceType == other->mDeviceType) &&
           (mAddress == "" || other->mAddress == "" || mAddress == other->mAddress) &&
           (mChannelMask == 0 || other->mChannelMask == 0 ||
                mChannelMask == other->mChannelMask);
    return (mDeviceType == other->mDeviceType) && (mAddress == other->mAddress);
}

void DeviceVector::refreshTypes()
+0 −6
Original line number Diff line number Diff line
@@ -310,12 +310,6 @@ sp<DeviceDescriptor> HwModuleCollection::getDeviceDescriptor(const audio_device
        if (!deviceList.isEmpty()) {
            return deviceList.itemAt(0);
        }
        deviceList = hwModule->getDeclaredDevices().getDevicesFromType(device);
        if (!deviceList.isEmpty()) {
            deviceList.itemAt(0)->setName(String8(device_name));
            deviceList.itemAt(0)->mAddress = address;
            return deviceList.itemAt(0);
        }
    }

    sp<DeviceDescriptor> devDesc = new DeviceDescriptor(device);