From 07ed99cece9820b4913f3a3064fc66cf3b72f7c2 Mon Sep 17 00:00:00 2001 From: Amy Date: Tue, 22 Oct 2019 18:33:53 -0700 Subject: [PATCH] Set SAM false when the AVR is standby to prevent reawaken the AVR Test: manual Bug: 140128102 Change-Id: Ibb5fb3e4c19c25ccaaf1dd91bffc98a8b8cd5430 --- .../android/server/hdmi/HdmiCecLocalDeviceTv.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java index 9a85f952446bf..a702ce517f404 100644 --- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java +++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java @@ -1557,6 +1557,18 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice { if (!connected) { removeCecSwitches(portId); } + + // Turning System Audio Mode off when the AVR is unlugged or standby. + // When the device is not unplugged but reawaken from standby, we check if the System + // Audio Control Feature is enabled or not then decide if turning SAM on/off accordingly. + if (getAvrDeviceInfo() != null && portId == getAvrDeviceInfo().getPortId()) { + if (!connected) { + setSystemAudioMode(false); + } else if (mSystemAudioControlFeatureEnabled != mService.isSystemAudioActivated()){ + setSystemAudioMode(mSystemAudioControlFeatureEnabled); + } + } + // Tv device will have permanent HotplugDetectionAction. List hotplugActions = getActions(HotplugDetectionAction.class); if (!hotplugActions.isEmpty()) {