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

Commit 927fefa8 authored by Andy Hung's avatar Andy Hung Committed by android-build-merger
Browse files

Do not park the FastMixer on AudioPatch changes

am: f60abcea

Change-Id: I13df7b17ee238b14b7db7448a7ae1bd320fab693
parents ffd7edc6 f60abcea
Loading
Loading
Loading
Loading
+18 −8
Original line number Diff line number Diff line
@@ -3447,10 +3447,15 @@ status_t AudioFlinger::PlaybackThread::getTimestamp_l(AudioTimestamp& timestamp)
status_t AudioFlinger::MixerThread::createAudioPatch_l(const struct audio_patch *patch,
                                                          audio_patch_handle_t *handle)
{
    status_t status;
    if (property_get_bool("af.patch_park", false /* default_value */)) {
        // Park FastMixer to avoid potential DOS issues with writing to the HAL
        // or if HAL does not properly lock against access.
        AutoPark<FastMixer> park(mFastMixer);

    status_t status = PlaybackThread::createAudioPatch_l(patch, handle);

        status = PlaybackThread::createAudioPatch_l(patch, handle);
    } else {
        status = PlaybackThread::createAudioPatch_l(patch, handle);
    }
    return status;
}

@@ -3532,10 +3537,15 @@ status_t AudioFlinger::PlaybackThread::createAudioPatch_l(const struct audio_pat

status_t AudioFlinger::MixerThread::releaseAudioPatch_l(const audio_patch_handle_t handle)
{
    status_t status;
    if (property_get_bool("af.patch_park", false /* default_value */)) {
        // Park FastMixer to avoid potential DOS issues with writing to the HAL
        // or if HAL does not properly lock against access.
        AutoPark<FastMixer> park(mFastMixer);

    status_t status = PlaybackThread::releaseAudioPatch_l(handle);

        status = PlaybackThread::releaseAudioPatch_l(handle);
    } else {
        status = PlaybackThread::releaseAudioPatch_l(handle);
    }
    return status;
}