Merge "CEC: Prevent premature standby process completion"
This commit is contained in:
@@ -176,6 +176,7 @@ abstract class HdmiCecLocalDevice {
|
||||
void init() {
|
||||
assertRunOnServiceThread();
|
||||
mPreferredAddress = getPreferredAddress();
|
||||
mPendingActionClearedCallback = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -837,16 +838,16 @@ abstract class HdmiCecLocalDevice {
|
||||
*
|
||||
* @param initiatedByCec true if this sequence is initiated
|
||||
* by the reception the CEC messages like <Standby>
|
||||
* @param origialCallback callback interface to get notified when all pending actions are
|
||||
* @param originalCallback callback interface to get notified when all pending actions are
|
||||
* cleared
|
||||
*/
|
||||
protected void disableDevice(boolean initiatedByCec,
|
||||
final PendingActionClearedCallback origialCallback) {
|
||||
final PendingActionClearedCallback originalCallback) {
|
||||
mPendingActionClearedCallback = new PendingActionClearedCallback() {
|
||||
@Override
|
||||
public void onCleared(HdmiCecLocalDevice device) {
|
||||
mHandler.removeMessages(MSG_DISABLE_DEVICE_TIMEOUT);
|
||||
origialCallback.onCleared(device);
|
||||
originalCallback.onCleared(device);
|
||||
}
|
||||
};
|
||||
mHandler.sendMessageDelayed(Message.obtain(mHandler, MSG_DISABLE_DEVICE_TIMEOUT),
|
||||
@@ -865,6 +866,9 @@ abstract class HdmiCecLocalDevice {
|
||||
action.finish(false);
|
||||
iter.remove();
|
||||
}
|
||||
if (mPendingActionClearedCallback != null) {
|
||||
mPendingActionClearedCallback.onCleared(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1109,11 +1109,13 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
|
||||
@ServiceThreadOnly
|
||||
protected boolean handleTerminateArc(HdmiCecMessage message) {
|
||||
assertRunOnServiceThread();
|
||||
// In cast of termination, do not check ARC configuration in that AVR device
|
||||
// might be removed already.
|
||||
|
||||
// In case where <Terminate Arc> is started by <Request ARC Termination>
|
||||
// need to clean up RequestArcInitiationAction.
|
||||
if (mService .isPowerStandbyOrTransient()) {
|
||||
setArcStatus(false);
|
||||
return true;
|
||||
}
|
||||
// Do not check ARC configuration since the AVR might have been already removed.
|
||||
// Clean up RequestArcTerminationAction in case <Terminate Arc> was started by
|
||||
// <Request ARC Termination>.
|
||||
removeAction(RequestArcTerminationAction.class);
|
||||
SetArcTransmissionStateAction action = new SetArcTransmissionStateAction(this,
|
||||
message.getSource(), false);
|
||||
|
||||
Reference in New Issue
Block a user