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
diff --git a/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java b/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java
index 31fb118..db98c36 100644
--- a/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java
+++ b/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java
@@ -33,6 +33,7 @@
 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 @@
             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();