Skip to content

Commit 39a331c

Browse files
ArianK16abgcngm
authored andcommitted
VolumeDialog: Prevent hiding the ally stream
* There is a rare case that the ally stream is one of the streams we add at the expanded panel. In this case while collapsing we would remove the ally stream which results in not showing a stream at all. (Steps to reproduce: While receiving a call, open the volume panel, expand it and collapse it again.) * Fix that by testing if the stream to hide while collapsing is the ally stream and if it is, do not hide it. Change-Id: Iab4c57ab3ded2c61124594320d5109a52c77f167
1 parent 5076c06 commit 39a331c

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -557,16 +557,22 @@ private static boolean isBluetoothA2dpConnected() {
557557
== BluetoothProfile.STATE_CONNECTED;
558558
}
559559

560+
private void setVisOrGone(int stream, boolean vis) {
561+
if (!vis && stream == mAllyStream) {
562+
return;
563+
}
564+
Util.setVisOrGone(findRow(stream).view, vis);
565+
}
566+
560567
private void updateExpandedRows(boolean expand) {
561568
if (!expand) mController.setActiveStream(mAllyStream);
562569
if (mMusicHidden) {
563-
Util.setVisOrGone(findRow(AudioManager.STREAM_MUSIC).view, expand);
570+
setVisOrGone(AudioManager.STREAM_MUSIC, expand);
564571
}
565-
Util.setVisOrGone(findRow(AudioManager.STREAM_RING).view, expand);
566-
Util.setVisOrGone(findRow(STREAM_ALARM).view, expand);
572+
setVisOrGone(AudioManager.STREAM_RING, expand);
573+
setVisOrGone(STREAM_ALARM, expand);
567574
if (!isNotificationVolumeLinked()) {
568-
Util.setVisOrGone(
569-
findRow(AudioManager.STREAM_NOTIFICATION).view, expand);
575+
setVisOrGone(AudioManager.STREAM_NOTIFICATION, expand);
570576
}
571577
}
572578

0 commit comments

Comments
 (0)