Launch routing control in HdmiControlService at boot up

Change-Id: I918c2a0da26a7cda20ee703dfeeacae276ec8373
This commit is contained in:
Jinsuk Kim
2014-07-03 18:02:01 +09:00
parent 0f94217e90
commit 5344cd98e6
2 changed files with 22 additions and 14 deletions

View File

@@ -98,9 +98,8 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
mAddress, mService.getPhysicalAddress(), mDeviceType));
mService.sendCecCommand(HdmiCecMessageBuilder.buildDeviceVendorIdCommand(
mAddress, mService.getVendorId()));
launchRoutingControl(true);
launchDeviceDiscovery();
// TODO: Start routing control action
}
/**
@@ -945,24 +944,33 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
}
}
/**
* Launch routing control process.
*
* @param routingForBootup true if routing control is initiated due to One Touch Play
* or TV power on
*/
@ServiceThreadOnly
void routingAtEnableTime() {
void launchRoutingControl(boolean routingForBootup) {
assertRunOnServiceThread();
// Seq #24
if (getActivePortId() != HdmiConstants.INVALID_PORT_ID) {
// TODO: Check if TV was not powered on due to <Text/Image View On>,
// TV is not in Preset Installation mode, not in initial setup mode, not
// in Software updating mode, not in service mode, for following actions.
removeAction(RoutingControlAction.class);
int newPath = mService.portIdToPath(getActivePortId());
mService.sendCecCommand(
HdmiCecMessageBuilder.buildRoutingChange(mAddress, getActivePath(), newPath));
addAndStartAction(new RoutingControlAction(this, getActivePortId(), false, null));
if (!routingForBootup && !isProhibitMode()) {
removeAction(RoutingControlAction.class);
int newPath = mService.portIdToPath(getActivePortId());
setActivePath(newPath);
mService.sendCecCommand(HdmiCecMessageBuilder.buildRoutingChange(mAddress,
getActivePath(), newPath));
addAndStartAction(new RoutingControlAction(this, getActivePortId(),
routingForBootup, null));
}
} else {
int activePath = mService.getPhysicalAddress();
setActivePath(activePath);
// TODO: Do following only when TV was not powered on due to <Text/Image View On>.
mService.sendCecCommand(HdmiCecMessageBuilder.buildActiveSource(mAddress, activePath));
if (!routingForBootup) {
mService.sendCecCommand(HdmiCecMessageBuilder.buildActiveSource(mAddress,
activePath));
}
}
}

View File

@@ -828,7 +828,7 @@ public final class HdmiControlService extends SystemService {
if (mMhlController != null) {
mMhlController.setOption(HdmiCec.OPTION_MHL_ENABLE, value);
}
tv.routingAtEnableTime();
tv.launchRoutingControl(false);
}
});
}