Skip to content

Commit 9164325

Browse files
ArianK16abgcngm
authored andcommitted
VolumeDialog: Treat ring volume the same as others on icon tap
* We don't need to treat the ring volume different here, if it's set to 0 it already sets the ringer mode to vibration on supported devices. * This makes sure that the row still displays the correct volume after tapping the icon, previously it only changed the ringer mode but left the slider at the previous value. Change-Id: Iabd18246c41c102ad0c1f49b7525cd188b01a7c4 Signed-off-by: Jesse Chan <jc@lineageos.org>
1 parent 03d78c2 commit 9164325

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

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

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -530,27 +530,9 @@ private void initRow(final VolumeRow row, final int stream, int iconRes, int ico
530530
rescheduleTimeoutH();
531531
Events.writeEvent(mContext, Events.EVENT_ICON_CLICK, row.stream, row.iconState);
532532
mController.setActiveStream(row.stream);
533-
if (row.stream == AudioManager.STREAM_RING) {
534-
final boolean hasVibrator = mController.hasVibrator();
535-
if (mState.ringerModeInternal == AudioManager.RINGER_MODE_NORMAL) {
536-
if (hasVibrator) {
537-
mController.setRingerMode(AudioManager.RINGER_MODE_VIBRATE, false);
538-
} else {
539-
final boolean wasZero = row.ss.level == 0;
540-
mController.setStreamVolume(stream,
541-
wasZero ? row.lastAudibleLevel : 0);
542-
}
543-
} else {
544-
mController.setRingerMode(AudioManager.RINGER_MODE_NORMAL, false);
545-
if (row.ss.level == 0) {
546-
mController.setStreamVolume(stream, 1);
547-
}
548-
}
549-
} else {
550-
final boolean vmute = row.ss.level == row.ss.levelMin;
551-
mController.setStreamVolume(stream,
552-
vmute ? row.lastAudibleLevel : row.ss.levelMin);
553-
}
533+
final boolean vmute = row.ss.level == row.ss.levelMin;
534+
mController.setStreamVolume(stream,
535+
vmute ? row.lastAudibleLevel : row.ss.levelMin);
554536
row.userAttempt = 0; // reset the grace period, slider updates immediately
555537
});
556538
} else {

0 commit comments

Comments
 (0)