Merge changes I0d22678f,Ibdff6d2c into sc-dev

* changes:
  CEC: Implement handleReportArcTermination method
  CEC: Implement handleReportArcInitiate method
This commit is contained in:
TreeHugger Robot
2021-04-09 16:27:03 +00:00
committed by Android (Google) Code Review
2 changed files with 16 additions and 8 deletions

View File

@@ -49,10 +49,7 @@ public class ArcTerminationActionFromAvr extends HdmiCecFeatureAction {
switch (cmd.getOpcode()) {
case Constants.MESSAGE_REPORT_ARC_TERMINATED:
mState = STATE_ARC_TERMINATED;
audioSystem().setArcStatus(false);
if (audioSystem().getLocalActivePort() == Constants.CEC_SWITCH_ARC) {
audioSystem().routeToInputFromPortId(audioSystem().getRoutingPort());
}
audioSystem().processArcTermination();
finish();
return true;
}

View File

@@ -358,8 +358,12 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
@Constants.HandleMessageResult
protected int handleReportArcInitiate(HdmiCecMessage message) {
assertRunOnServiceThread();
// TODO(amyjojo): implement report arc initiate handler
HdmiLogger.debug(TAG + "Stub handleReportArcInitiate");
/*
* Ideally, we should have got this response before the {@link ArcInitiationActionFromAvr}
* has timed out. Even if the response is late, {@link ArcInitiationActionFromAvr
* #handleInitiateArcTimeout()} would not have disabled ARC. So nothing needs to be done
* here.
*/
return Constants.HANDLED;
}
@@ -368,8 +372,7 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
@Constants.HandleMessageResult
protected int handleReportArcTermination(HdmiCecMessage message) {
assertRunOnServiceThread();
// TODO(amyjojo): implement report arc terminate handler
HdmiLogger.debug(TAG + "Stub handleReportArcTermination");
processArcTermination();
return Constants.HANDLED;
}
@@ -712,6 +715,14 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
mArcEstablished = enabled;
}
void processArcTermination() {
setArcStatus(false);
// Switch away from ARC input when ARC is terminated.
if (getLocalActivePort() == Constants.CEC_SWITCH_ARC) {
routeToInputFromPortId(getRoutingPort());
}
}
/** Switch hardware ARC circuit in the system. */
@ServiceThreadOnly
private void enableAudioReturnChannel(boolean enabled) {