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

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

Merge "audio policy: fix volume for unsupported device" into rvc-dev am: afee5576 am: e6ba3267

Change-Id: I8a5607c9d5c0de797b057e02102f7650c82833e0
parents 2b4545ea e6ba3267
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -152,10 +152,16 @@ bool AudioOutputDescriptor::isFixedVolume(const DeviceTypeSet& deviceTypes __unu
bool AudioOutputDescriptor::setVolume(float volumeDb,
                                      VolumeSource volumeSource,
                                      const StreamTypeVector &/*streams*/,
                                      const DeviceTypeSet& /*deviceTypes*/,
                                      const DeviceTypeSet& deviceTypes,
                                      uint32_t delayMs,
                                      bool force)
{

    if (!supportedDevices().containsDeviceAmongTypes(deviceTypes)) {
        ALOGV("%s output ID %d unsupported device %s",
                __func__, getId(), toString(deviceTypes).c_str());
        return false;
    }
    // We actually change the volume if:
    // - the float value returned by computeVolume() changed
    // - the force flag is set