Loading services/core/java/com/android/server/hdmi/Constants.java +4 −1 Original line number Diff line number Diff line Loading @@ -629,9 +629,12 @@ final class Constants { static final String DEVICE_CONFIG_FEATURE_FLAG_SOUNDBAR_MODE = "enable_soundbar_mode"; static final String DEVICE_CONFIG_FEATURE_FLAG_ENABLE_EARC_TX = "enable_earc_tx"; static final String DEVICE_CONFIG_FEATURE_FLAG_TRANSITION_ARC_TO_EARC_TX = "transition_arc_to_earc_tx"; @StringDef({ DEVICE_CONFIG_FEATURE_FLAG_SOUNDBAR_MODE, DEVICE_CONFIG_FEATURE_FLAG_ENABLE_EARC_TX DEVICE_CONFIG_FEATURE_FLAG_ENABLE_EARC_TX, DEVICE_CONFIG_FEATURE_FLAG_TRANSITION_ARC_TO_EARC_TX }) @interface FeatureFlag {} Loading services/core/java/com/android/server/hdmi/HdmiControlService.java +20 −0 Original line number Diff line number Diff line Loading @@ -457,6 +457,9 @@ public class HdmiControlService extends SystemService { @ServiceThreadOnly private boolean mEarcTxFeatureFlagEnabled = false; @ServiceThreadOnly private boolean mTransitionFromArcToEarcTxEnabled = false; @ServiceThreadOnly private int mActivePortId = Constants.INVALID_PORT_ID; Loading Loading @@ -675,6 +678,8 @@ public class HdmiControlService extends SystemService { Constants.DEVICE_CONFIG_FEATURE_FLAG_SOUNDBAR_MODE, false); mEarcTxFeatureFlagEnabled = mDeviceConfig.getBoolean( Constants.DEVICE_CONFIG_FEATURE_FLAG_ENABLE_EARC_TX, false); mTransitionFromArcToEarcTxEnabled = mDeviceConfig.getBoolean( Constants.DEVICE_CONFIG_FEATURE_FLAG_TRANSITION_ARC_TO_EARC_TX, false); synchronized (mLock) { mEarcEnabled = (mHdmiCecConfig.getIntValue( Loading Loading @@ -886,6 +891,16 @@ public class HdmiControlService extends SystemService { ? SOUNDBAR_MODE_ENABLED : SOUNDBAR_MODE_DISABLED); } }, mServiceThreadExecutor); mDeviceConfig.addOnPropertiesChangedListener(getContext().getMainExecutor(), new DeviceConfig.OnPropertiesChangedListener() { @Override public void onPropertiesChanged(DeviceConfig.Properties properties) { mTransitionFromArcToEarcTxEnabled = properties.getBoolean( Constants.DEVICE_CONFIG_FEATURE_FLAG_TRANSITION_ARC_TO_EARC_TX, false); } }); } /** Returns true if the device screen is off */ boolean isScreenOff() { Loading Loading @@ -1618,6 +1633,11 @@ public class HdmiControlService extends SystemService { } void enableAudioReturnChannel(int portId, boolean enabled) { if (!mTransitionFromArcToEarcTxEnabled && enabled && mEarcController != null) { // If the feature flag is set to false, prevent eARC from establishing if ARC is already // established. setEarcEnabledInHal(false, false); } mCecController.enableAudioReturnChannel(portId, enabled); } Loading Loading
services/core/java/com/android/server/hdmi/Constants.java +4 −1 Original line number Diff line number Diff line Loading @@ -629,9 +629,12 @@ final class Constants { static final String DEVICE_CONFIG_FEATURE_FLAG_SOUNDBAR_MODE = "enable_soundbar_mode"; static final String DEVICE_CONFIG_FEATURE_FLAG_ENABLE_EARC_TX = "enable_earc_tx"; static final String DEVICE_CONFIG_FEATURE_FLAG_TRANSITION_ARC_TO_EARC_TX = "transition_arc_to_earc_tx"; @StringDef({ DEVICE_CONFIG_FEATURE_FLAG_SOUNDBAR_MODE, DEVICE_CONFIG_FEATURE_FLAG_ENABLE_EARC_TX DEVICE_CONFIG_FEATURE_FLAG_ENABLE_EARC_TX, DEVICE_CONFIG_FEATURE_FLAG_TRANSITION_ARC_TO_EARC_TX }) @interface FeatureFlag {} Loading
services/core/java/com/android/server/hdmi/HdmiControlService.java +20 −0 Original line number Diff line number Diff line Loading @@ -457,6 +457,9 @@ public class HdmiControlService extends SystemService { @ServiceThreadOnly private boolean mEarcTxFeatureFlagEnabled = false; @ServiceThreadOnly private boolean mTransitionFromArcToEarcTxEnabled = false; @ServiceThreadOnly private int mActivePortId = Constants.INVALID_PORT_ID; Loading Loading @@ -675,6 +678,8 @@ public class HdmiControlService extends SystemService { Constants.DEVICE_CONFIG_FEATURE_FLAG_SOUNDBAR_MODE, false); mEarcTxFeatureFlagEnabled = mDeviceConfig.getBoolean( Constants.DEVICE_CONFIG_FEATURE_FLAG_ENABLE_EARC_TX, false); mTransitionFromArcToEarcTxEnabled = mDeviceConfig.getBoolean( Constants.DEVICE_CONFIG_FEATURE_FLAG_TRANSITION_ARC_TO_EARC_TX, false); synchronized (mLock) { mEarcEnabled = (mHdmiCecConfig.getIntValue( Loading Loading @@ -886,6 +891,16 @@ public class HdmiControlService extends SystemService { ? SOUNDBAR_MODE_ENABLED : SOUNDBAR_MODE_DISABLED); } }, mServiceThreadExecutor); mDeviceConfig.addOnPropertiesChangedListener(getContext().getMainExecutor(), new DeviceConfig.OnPropertiesChangedListener() { @Override public void onPropertiesChanged(DeviceConfig.Properties properties) { mTransitionFromArcToEarcTxEnabled = properties.getBoolean( Constants.DEVICE_CONFIG_FEATURE_FLAG_TRANSITION_ARC_TO_EARC_TX, false); } }); } /** Returns true if the device screen is off */ boolean isScreenOff() { Loading Loading @@ -1618,6 +1633,11 @@ public class HdmiControlService extends SystemService { } void enableAudioReturnChannel(int portId, boolean enabled) { if (!mTransitionFromArcToEarcTxEnabled && enabled && mEarcController != null) { // If the feature flag is set to false, prevent eARC from establishing if ARC is already // established. setEarcEnabledInHal(false, false); } mCecController.enableAudioReturnChannel(portId, enabled); } Loading