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

Commit baf35fee authored by Eric Laurent's avatar Eric Laurent
Browse files

audio policy: fixed delayed voice volume commands

Apply same rule as for stream volume in case of delayed voice volume
command: this prevents a delayed command to cancel a non delayed
command sent after.

Bug: 30421096
Change-Id: I576db5eba9498c811c3a6493b3c17e1f02b1b1a1
parent ca8cc535
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -987,6 +987,18 @@ void AudioPolicyService::AudioCommandThread::insertCommand_l(sp<AudioCommand>& c
            delayMs = 1;
        } break;

        case SET_VOICE_VOLUME: {
            VoiceVolumeData *data = (VoiceVolumeData *)command->mParam.get();
            VoiceVolumeData *data2 = (VoiceVolumeData *)command2->mParam.get();
            ALOGV("Filtering out voice volume command value %f replaced by %f",
                  data2->mVolume, data->mVolume);
            removedCommands.add(command2);
            command->mTime = command2->mTime;
            // force delayMs to non 0 so that code below does not request to wait for
            // command status as the command is now delayed
            delayMs = 1;
        } break;

        case CREATE_AUDIO_PATCH:
        case RELEASE_AUDIO_PATCH: {
            audio_patch_handle_t handle;