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

Unverified Commit ae83ed03 authored by Arian's avatar Arian Committed by Michael Bestas
Browse files

VolumeDialogImpl: Don't hide the default stream when adjusting the music stream

If there are two visible rows and the user touches the default (music)
row, the other row disappears immediately. Avoid this behaviour by
tracking the row with which this panel was created and keep showing
that row if the user adjusts the music stream.

Test: While receiving a call both rows are touchable and the additional
      row does not disappear when adjusting the music stream.
Change-Id: I4e14a0ea50c5cc41cb279c6fbfc8a7d6e6d1ba61
parent c8120ff0
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -273,6 +273,9 @@ public class VolumeDialogImpl implements VolumeDialog,
    private BackgroundBlurDrawable mDialogRowsViewBackground;
    private final InteractionJankMonitor mInteractionJankMonitor;

    // Variable to track the default row with which the panel is initially shown
    private VolumeRow mDefaultRow = null;

    public VolumeDialogImpl(
            Context context,
            VolumeDialogController volumeDialogController,
@@ -1316,6 +1319,10 @@ public class VolumeDialogImpl implements VolumeDialog,
            mConfigChanged = false;
        }

        if (mDefaultRow == null) {
            mDefaultRow = getActiveRow();
        }

        initSettingsH(lockTaskModeState);
        mShowing = true;
        mIsAnimatingDismiss = false;
@@ -1385,6 +1392,7 @@ public class VolumeDialogImpl implements VolumeDialog,
                .withEndAction(() -> mHandler.postDelayed(() -> {
                    mDialog.dismiss();
                    tryToRemoveCaptionsTooltip();
                    mDefaultRow = null;
                    mIsAnimatingDismiss = false;

                    hideRingerDrawer();
@@ -1427,11 +1435,14 @@ public class VolumeDialogImpl implements VolumeDialog,
                return true;
            }

            if (row.defaultStream) {
            // if the row is the default stream or the row with which this panel was created,
            // show it additonally to the active row if it is one of the following streams
            if (row.defaultStream || mDefaultRow == row) {
                return activeRow.stream == STREAM_RING
                        || activeRow.stream == STREAM_NOTIFICATION
                        || activeRow.stream == STREAM_ALARM
                        || activeRow.stream == STREAM_VOICE_CALL
                        || activeRow.stream == STREAM_MUSIC
                        || activeRow.stream == STREAM_ACCESSIBILITY
                        || mDynamic.get(activeRow.stream);
            }