DO NOT MERGE Selectively show volume UI on first volume change event.

Only show volume dialog on first volume change event if the flags
related to the event are set to show UI.

For example, this allows us to not show the volume dialog if the volume
is changed from sound settings as the first volume change event.

Bug: 145134692
Bug: 145094923
Test: Manual
Change-Id: I9bf7eeb009a792e7205265add2cc6b1b0d542168
This commit is contained in:
Abhijoy Saha
2019-11-25 15:25:48 -08:00
parent d90c8a0f5e
commit 9886a12e2f

View File

@@ -33,6 +33,7 @@ import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.inputmethodservice.InputMethodService;
import android.media.AudioManager;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
@@ -227,7 +228,7 @@ public class CarStatusBar extends StatusBar implements CarBatteryController.Batt
new CarAudioManager.CarVolumeCallback() {
@Override
public void onGroupVolumeChanged(int zoneId, int groupId, int flags) {
if (mVolumeUI == null) {
if (mVolumeUI == null && (flags & AudioManager.FLAG_SHOW_UI) != 0) {
new Handler(Looper.getMainLooper()).post(() -> {
// Initialize Volume UI
mVolumeUI = new VolumeUI();