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

Commit be578199 authored by Anton Potapov's avatar Anton Potapov
Browse files

Fix calling forceVolumeControlStream when Volume Dialog hides

Flag: com.android.systemui.use_volume_controller
Fixes: 365875912
Test: atest VolumeDialogControllerImplTest
Test: manual on the foldable. Start call, end call, adjust volume
Change-Id: Iaa53b95bbe98a5a991410c5f4d47e4a5b30a3af6
parent 5620e115
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -391,12 +391,8 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa
    }

    public void notifyVisible(boolean visible) {
        if (Flags.useVolumeController()) {
            mVolumeControllerAdapter.notifyVolumeControllerVisible(visible);
        } else {
        mWorker.obtainMessage(W.NOTIFY_VISIBLE, visible ? 1 : 0, 0).sendToTarget();
    }
    }

    public void userActivity() {
        mWorker.removeMessages(W.USER_ACTIVITY);
@@ -457,7 +453,11 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa
    }

    private void onNotifyVisibleW(boolean visible) {
        if (Flags.useVolumeController()) {
            mVolumeControllerAdapter.notifyVolumeControllerVisible(visible);
        } else {
            mAudio.notifyVolumeControllerVisible(mVolumeController, visible);
        }
        if (!visible) {
            if (updateActiveStreamW(-1)) {
                mCallbacks.onStateChanged(mState);