Merge "CEC: Switch ARC hardware circuit before device update"

This commit is contained in:
Jinsuk Kim
2015-02-23 03:33:38 +00:00
committed by Android (Google) Code Review
2 changed files with 14 additions and 1 deletions

View File

@@ -881,7 +881,7 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
HdmiLogger.debug("Set Arc Status[old:%b new:%b]", mArcEstablished, enabled);
boolean oldStatus = mArcEstablished;
// 1. Enable/disable ARC circuit.
mService.setAudioReturnChannel(getAvrDeviceInfo().getPortId(), enabled);
setAudioReturnChannel(enabled);
// 2. Notify arc status to audio service.
notifyArcStatusToAudioService(enabled);
// 3. Update arc status;
@@ -889,6 +889,18 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
return oldStatus;
}
/**
* Switch hardware ARC circuit in the system.
*/
@ServiceThreadOnly
void setAudioReturnChannel(boolean enabled) {
assertRunOnServiceThread();
HdmiDeviceInfo avr = getAvrDeviceInfo();
if (avr != null) {
mService.setAudioReturnChannel(avr.getPortId(), enabled);
}
}
@ServiceThreadOnly
private void updateArcFeatureStatus(int portId, boolean isConnected) {
assertRunOnServiceThread();

View File

@@ -262,6 +262,7 @@ final class HotplugDetectionAction extends HdmiCecFeatureAction {
// Turn off system audio mode and update settings.
tv().setSystemAudioMode(false, true);
if (tv().isArcEstabilished()) {
tv().setAudioReturnChannel(false);
addAndStartAction(new RequestArcTerminationAction(localDevice(), address));
}
}