Only show the volume dialog if the AudioManager.FLAG_SHOW_UI bit is set

Bug: 109841417
Test: manual

Change-Id: Icc803a4b22ceccff7d3e788b9164975a8e395a3b
This commit is contained in:
Lin Guo
2018-06-07 17:08:30 -07:00
parent c8cdc59322
commit f37d0ebe8c

View File

@@ -38,6 +38,7 @@ import android.graphics.drawable.ColorDrawable;
import android.graphics.PixelFormat;
import android.graphics.drawable.Drawable;
import android.media.AudioAttributes;
import android.media.AudioManager;
import android.os.Debug;
import android.os.Handler;
import android.os.IBinder;
@@ -536,7 +537,9 @@ public class CarVolumeDialogImpl implements VolumeDialog {
if (value != volumeItem.progress) {
volumeItem.listItem.setProgress(value);
volumeItem.progress = value;
show(Events.SHOW_REASON_VOLUME_CHANGED);
if ((flags & AudioManager.FLAG_SHOW_UI) != 0) {
show(Events.SHOW_REASON_VOLUME_CHANGED);
}
}
}