Merge changes I0579b3af,If7ecd588 into tm-dev am: f7b504cece
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18230085 Change-Id: I58e58555390fe34e59c1628a47e1839703c225c7 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -235,13 +235,7 @@ public class AudioDeviceVolumeManager {
|
||||
mDeviceVolumeDispatcherStub = new DeviceVolumeDispatcherStub();
|
||||
}
|
||||
} else {
|
||||
for (ListenerInfo info : mDeviceVolumeListeners) {
|
||||
if (info.mListener == vclistener) {
|
||||
throw new IllegalArgumentException(
|
||||
"attempt to call setDeviceAbsoluteMultiVolumeBehavior() "
|
||||
+ "on a previously registered listener");
|
||||
}
|
||||
}
|
||||
mDeviceVolumeListeners.removeIf(info -> info.mDevice.equalTypeAddress(device));
|
||||
}
|
||||
mDeviceVolumeListeners.add(listenerInfo);
|
||||
mDeviceVolumeDispatcherStub.register(true, device, volumes, handlesVolumeAdjustment);
|
||||
|
||||
@@ -4146,19 +4146,8 @@ public class AudioService extends IAudioService.Stub
|
||||
{
|
||||
streamType = mStreamVolumeAlias[streamType];
|
||||
|
||||
if (streamType == AudioSystem.STREAM_MUSIC) {
|
||||
flags = updateFlagsForTvPlatform(flags);
|
||||
synchronized (mHdmiClientLock) {
|
||||
// Don't display volume UI on a TV Playback device when using absolute volume
|
||||
if (mHdmiCecVolumeControlEnabled && mHdmiPlaybackClient != null
|
||||
&& (isAbsoluteVolumeDevice(device)
|
||||
|| isA2dpAbsoluteVolumeDevice(device))) {
|
||||
flags &= ~AudioManager.FLAG_SHOW_UI;
|
||||
}
|
||||
}
|
||||
if (isFullVolumeDevice(device)) {
|
||||
flags &= ~AudioManager.FLAG_SHOW_UI;
|
||||
}
|
||||
if (streamType == AudioSystem.STREAM_MUSIC && isFullVolumeDevice(device)) {
|
||||
flags &= ~AudioManager.FLAG_SHOW_UI;
|
||||
}
|
||||
mVolumeController.postVolumeChanged(streamType, flags);
|
||||
}
|
||||
|
||||
@@ -4176,7 +4176,11 @@ public class HdmiControlService extends SystemService {
|
||||
List<AudioDeviceAttributes> streamMusicDevices =
|
||||
getAudioManager().getDevicesForAttributes(STREAM_MUSIC_ATTRIBUTES);
|
||||
if (streamMusicDevices.contains(getAvcAudioOutputDevice())) {
|
||||
setStreamMusicVolume(volume, AudioManager.FLAG_ABSOLUTE_VOLUME);
|
||||
int flags = AudioManager.FLAG_ABSOLUTE_VOLUME;
|
||||
if (isTvDevice()) {
|
||||
flags |= AudioManager.FLAG_SHOW_UI;
|
||||
}
|
||||
setStreamMusicVolume(volume, flags);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4190,8 +4194,11 @@ public class HdmiControlService extends SystemService {
|
||||
getAudioManager().getDevicesForAttributes(STREAM_MUSIC_ATTRIBUTES);
|
||||
if (streamMusicDevices.contains(getAvcAudioOutputDevice())) {
|
||||
int direction = mute ? AudioManager.ADJUST_MUTE : AudioManager.ADJUST_UNMUTE;
|
||||
getAudioManager().adjustStreamVolume(AudioManager.STREAM_MUSIC, direction,
|
||||
AudioManager.FLAG_ABSOLUTE_VOLUME);
|
||||
int flags = AudioManager.FLAG_ABSOLUTE_VOLUME;
|
||||
if (isTvDevice()) {
|
||||
flags |= AudioManager.FLAG_SHOW_UI;
|
||||
}
|
||||
getAudioManager().adjustStreamVolume(AudioManager.STREAM_MUSIC, direction, flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user