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

Commit f60abcea authored by Andy Hung's avatar Andy Hung
Browse files

Do not park the FastMixer on AudioPatch changes

Can be turned on again by property af.patch_park.

Bug: 30952714
Change-Id: Id7f7750e28ecf950d110379309d18819e169e999
parent 7b960a5d
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;
}