Remove pending actions when standby
[Description] Remove action when standby Prevent pending action from blocking sending <Standby> to device 1) Remove NewDeviceAction + all ARC related actions 2) Don't start NewDeviceAction & SystemAudioAutoInitiationAction when power standby or transient to standby Bug: 157444862 [Test Report] AVR : Yamaha RX-V377 / Onkyo HT-R558 DVD : Pioneer CEC DVD player Test CEC Standby off/on over 30 times: PASS Change-Id: I3e4c3faa803afc8c19c33d9340ace098e9d7ed0b
This commit is contained in:
@@ -619,8 +619,10 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
|
||||
}
|
||||
}
|
||||
|
||||
addAndStartAction(new NewDeviceAction(this, activeSource.logicalAddress,
|
||||
activeSource.physicalAddress, deviceType));
|
||||
if (!mService.isPowerStandbyOrTransient()) {
|
||||
addAndStartAction(new NewDeviceAction(this, activeSource.logicalAddress,
|
||||
activeSource.physicalAddress, deviceType));
|
||||
}
|
||||
}
|
||||
|
||||
private boolean handleNewDeviceAtTheTailOfActivePath(int path) {
|
||||
@@ -785,10 +787,12 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
|
||||
@ServiceThreadOnly
|
||||
void onNewAvrAdded(HdmiDeviceInfo avr) {
|
||||
assertRunOnServiceThread();
|
||||
addAndStartAction(new SystemAudioAutoInitiationAction(this, avr.getLogicalAddress()));
|
||||
if (isConnected(avr.getPortId()) && isArcFeatureEnabled(avr.getPortId())
|
||||
&& !hasAction(SetArcTransmissionStateAction.class)) {
|
||||
startArcAction(true);
|
||||
if (!mService.isPowerStandbyOrTransient()) {
|
||||
addAndStartAction(new SystemAudioAutoInitiationAction(this, avr.getLogicalAddress()));
|
||||
if (isConnected(avr.getPortId()) && isArcFeatureEnabled(avr.getPortId())
|
||||
&& !hasAction(SetArcTransmissionStateAction.class)) {
|
||||
startArcAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1631,6 +1635,7 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
|
||||
// Remove recording actions.
|
||||
removeAction(OneTouchRecordAction.class);
|
||||
removeAction(TimerRecordingAction.class);
|
||||
removeAction(NewDeviceAction.class);
|
||||
|
||||
disableSystemAudioIfExist();
|
||||
disableArcIfExist();
|
||||
@@ -1671,12 +1676,20 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
|
||||
setArcStatus(false);
|
||||
|
||||
// Seq #44.
|
||||
removeAction(RequestArcInitiationAction.class);
|
||||
removeAllRunningArcAction();
|
||||
if (!hasAction(RequestArcTerminationAction.class) && isArcEstablished()) {
|
||||
addAndStartAction(new RequestArcTerminationAction(this, avr.getLogicalAddress()));
|
||||
}
|
||||
}
|
||||
|
||||
@ServiceThreadOnly
|
||||
private void removeAllRunningArcAction() {
|
||||
// Running or pending actions make TV fail to broadcast <Standby> to connected devices
|
||||
removeAction(RequestArcTerminationAction.class);
|
||||
removeAction(RequestArcInitiationAction.class);
|
||||
removeAction(SetArcTransmissionStateAction.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ServiceThreadOnly
|
||||
protected void onStandby(boolean initiatedByCec, int standbyAction) {
|
||||
|
||||
Reference in New Issue
Block a user