Merge "CEC: Implement handleReportArcTermination method" am: 9026f587b7

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1589692

Change-Id: I1fcd93a1f411dada4d9fd3b552cb97a314e3342b
This commit is contained in:
Treehugger Robot
2021-04-13 14:57:42 +00:00
committed by Automerger Merge Worker
2 changed files with 10 additions and 6 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

@@ -570,8 +570,7 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
@ServiceThreadOnly
protected boolean handleReportArcTermination(HdmiCecMessage message) {
assertRunOnServiceThread();
// TODO(amyjojo): implement report arc terminate handler
HdmiLogger.debug(TAG + "Stub handleReportArcTermination");
processArcTermination();
return true;
}
@@ -916,6 +915,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) {