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

Commit b88d7399 authored by Vlad Popa's avatar Vlad Popa Committed by Android (Google) Code Review
Browse files

Merge "CSD: Fix resetting the sound dose binder interface" into 24D1-dev

parents ba78fa54 653f18a9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1885,7 +1885,6 @@ public class AudioService extends IAudioService.Stub
        }
        mSpatializerHelper.reset(/* featureEnabled */ mHasSpatializerEffect);
        mSoundDoseHelper.reset();
        // Restore rotation information.
        if (mMonitorRotation) {
@@ -1896,6 +1895,8 @@ public class AudioService extends IAudioService.Stub
        // indicate the end of reconfiguration phase to audio HAL
        AudioSystem.setParameters("restarting=false");
        mSoundDoseHelper.reset(/*resetISoundDose=*/true);
        sendMsg(mAudioHandler, MSG_DISPATCH_AUDIO_SERVER_STATE,
                SENDMSG_QUEUE, 1, 0, null, 0);
+5 −4
Original line number Diff line number Diff line
@@ -856,11 +856,12 @@ public class SoundDoseHelper {
        pw.println();
    }

    /*package*/void  reset() {
    /*package*/void reset(boolean resetISoundDose) {
        Log.d(TAG, "Reset the sound dose helper");

        mSoundDose.compareAndExchange(/*expectedValue=*/null,
                AudioSystem.getSoundDoseInterface(mSoundDoseCallback));
        if (resetISoundDose) {
            mSoundDose.set(AudioSystem.getSoundDoseInterface(mSoundDoseCallback));
        }

        synchronized (mCsdStateLock) {
            try {
@@ -972,7 +973,7 @@ public class SoundDoseHelper {
            }
        }

        reset();
        reset(/*resetISoundDose=*/false);
    }

    private void onConfigureSafeMedia(boolean force, String caller) {