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

Unverified Commit adc655ef 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 965dff3f
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -294,6 +294,9 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,

    private int mWindowGravity;

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

    @VisibleForTesting
    final int mVolumeRingerIconDrawableId = R.drawable.ic_speaker_on;
    @VisibleForTesting
@@ -1477,6 +1480,10 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
            mConfigChanged = false;
        }

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

        initSettingsH(lockTaskModeState);
        mShowing = true;
        mIsAnimatingDismiss = false;
@@ -1578,6 +1585,7 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
                        mDialog.dismiss();
                    }
                    tryToRemoveCaptionsTooltip();
                    mDefaultRow = null;
                    mIsAnimatingDismiss = false;

                    hideRingerDrawer();
@@ -1624,11 +1632,14 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
                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);
            }