CEC: Allow no parameters with <System Audio Mode Request>.
Bug: 18266992
Change-Id: I4399e34d1178f3d4b17b4749ca543c2bb14c0765
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecMessageValidator.java b/services/core/java/com/android/server/hdmi/HdmiCecMessageValidator.java
index f1529a7..53740fe 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecMessageValidator.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecMessageValidator.java
@@ -79,7 +79,7 @@
addValidationInfo(Constants.MESSAGE_SET_STREAM_PATH,
physicalAddressValidator, DEST_BROADCAST);
addValidationInfo(Constants.MESSAGE_SYSTEM_AUDIO_MODE_REQUEST,
- physicalAddressValidator, DEST_DIRECT);
+ new SystemAudioModeRequestValidator(), DEST_DIRECT);
// Messages have no parameter.
FixedLengthValidator noneValidator = new FixedLengthValidator(0);
@@ -303,6 +303,17 @@
}
}
+ private class SystemAudioModeRequestValidator extends PhysicalAddressValidator {
+ @Override
+ public int isValid(byte[] params) {
+ // TV can send <System Audio Mode Request> with no parameters to terminate system audio.
+ if (params.length == 0) {
+ return OK;
+ }
+ return super.isValid(params);
+ }
+ }
+
private class ReportPhysicalAddressValidator implements ParameterValidator {
@Override
public int isValid(byte[] params) {