am f88be2c7: Merge "Adjust volume bar visibility in HDMI-CEC system audio mode" into lmp-dev
* commit 'f88be2c79ab5cb980fee2fff22c41d62100f4165':
Adjust volume bar visibility in HDMI-CEC system audio mode
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index 40d45ea..71a05ab 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -1351,6 +1351,16 @@
streamType = AudioSystem.STREAM_NOTIFICATION;
}
+ // If Hdmi-CEC system audio mode is on, show volume bar
+ // only when TV receives volume notification from Audio Receiver.
+ if (mHdmiTvClient != null && streamType == AudioSystem.STREAM_MUSIC) {
+ synchronized (mHdmiTvClient) {
+ if (mHdmiSystemAudioSupported &&
+ ((flags & AudioManager.FLAG_HDMI_SYSTEM_AUDIO_VOLUME) == 0)) {
+ flags &= ~AudioManager.FLAG_SHOW_UI;
+ }
+ }
+ }
mVolumeController.postVolumeChanged(streamType, flags);
if ((flags & AudioManager.FLAG_FIXED_VOLUME) == 0) {
diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java
index 9a34047..4d9b4e9 100644
--- a/services/core/java/com/android/server/hdmi/HdmiControlService.java
+++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java
@@ -798,7 +798,7 @@
// FLAG_HDMI_SYSTEM_AUDIO_VOLUME prevents audio manager from announcing
// volume change notification back to hdmi control service.
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, volume,
- AudioManager.FLAG_HDMI_SYSTEM_AUDIO_VOLUME);
+ AudioManager.FLAG_SHOW_UI | AudioManager.FLAG_HDMI_SYSTEM_AUDIO_VOLUME);
}
}