Improve reliability of soundbar volume UI on TVs.
Currently, volume behavior can switch from adjust-only AVB to full volume behavior multiple times shortly after plugging in a soundbar. This causes volume UI to stop working intermittently, and adds noise to volume behavior listeners. This CL makes two changes to make this less likely: 1. When switching from adjust-only AVB to regular AVB, don't switch to full volume while waiting for the change to take place. Staying with adjust-only AVB is fine because it provides a subset of the features of regular AVB. 2. When <SAVL> support becomes unknown, don't switch to full volume behavior from adjust-only absolute volume behavior. It's unnecessary because adjust-only absolute volume behavior may be used regardless of <SAVL> support. Test: manual with falcon and atom Bug: 282012994 Change-Id: Ibf99fb67788441d5257c63b64a4b6683c9336798
This commit is contained in:
@@ -1013,11 +1013,10 @@ abstract class HdmiCecLocalDevice extends HdmiLocalDevice {
|
||||
}
|
||||
|
||||
@ServiceThreadOnly
|
||||
void addAvbAudioStatusAction(int targetAddress) {
|
||||
void startNewAvbAudioStatusAction(int targetAddress) {
|
||||
assertRunOnServiceThread();
|
||||
if (!hasAction(AbsoluteVolumeAudioStatusAction.class)) {
|
||||
addAndStartAction(new AbsoluteVolumeAudioStatusAction(this, targetAddress));
|
||||
}
|
||||
removeAction(AbsoluteVolumeAudioStatusAction.class);
|
||||
addAndStartAction(new AbsoluteVolumeAudioStatusAction(this, targetAddress));
|
||||
}
|
||||
|
||||
@ServiceThreadOnly
|
||||
|
||||
@@ -4341,12 +4341,9 @@ public class HdmiControlService extends SystemService {
|
||||
switch (systemAudioDeviceInfo.getDeviceFeatures().getSetAudioVolumeLevelSupport()) {
|
||||
case DeviceFeatures.FEATURE_SUPPORTED:
|
||||
if (currentVolumeBehavior != AudioManager.DEVICE_VOLUME_BEHAVIOR_ABSOLUTE) {
|
||||
// If we're currently using adjust-only absolute volume behavior, switch to
|
||||
// full volume behavior until we successfully adopt absolute volume behavior
|
||||
switchToFullVolumeBehavior();
|
||||
// Start an action that will call enableAbsoluteVolumeBehavior
|
||||
// once the System Audio device sends <Report Audio Status>
|
||||
localCecDevice.addAvbAudioStatusAction(
|
||||
localCecDevice.startNewAvbAudioStatusAction(
|
||||
systemAudioDeviceInfo.getLogicalAddress());
|
||||
}
|
||||
return;
|
||||
@@ -4358,10 +4355,13 @@ public class HdmiControlService extends SystemService {
|
||||
!= AudioManager.DEVICE_VOLUME_BEHAVIOR_ABSOLUTE_ADJUST_ONLY) {
|
||||
// If we're currently using absolute volume behavior, switch to full volume
|
||||
// behavior until we successfully adopt adjust-only absolute volume behavior
|
||||
switchToFullVolumeBehavior();
|
||||
if (currentVolumeBehavior == AudioManager.DEVICE_VOLUME_BEHAVIOR_ABSOLUTE) {
|
||||
getAudioManager().setDeviceVolumeBehavior(getAvbAudioOutputDevice(),
|
||||
AudioManager.DEVICE_VOLUME_BEHAVIOR_FULL);
|
||||
}
|
||||
// Start an action that will call enableAbsoluteVolumeBehavior
|
||||
// once the System Audio device sends <Report Audio Status>
|
||||
localCecDevice.addAvbAudioStatusAction(
|
||||
localCecDevice.startNewAvbAudioStatusAction(
|
||||
systemAudioDeviceInfo.getLogicalAddress());
|
||||
}
|
||||
} else {
|
||||
@@ -4369,7 +4369,9 @@ public class HdmiControlService extends SystemService {
|
||||
}
|
||||
return;
|
||||
case DeviceFeatures.FEATURE_SUPPORT_UNKNOWN:
|
||||
switchToFullVolumeBehavior();
|
||||
if (currentVolumeBehavior == AudioManager.DEVICE_VOLUME_BEHAVIOR_ABSOLUTE) {
|
||||
switchToFullVolumeBehavior();
|
||||
}
|
||||
localCecDevice.querySetAudioVolumeLevelSupport(
|
||||
systemAudioDeviceInfo.getLogicalAddress());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user