use of android.hardware.hdmi.HdmiDeviceInfo in project android_frameworks_base by ResurrectionRemix.
the class HdmiCecLocalDeviceTv method updateArcFeatureStatus.
@ServiceThreadOnly
private void updateArcFeatureStatus(int portId, boolean isConnected) {
assertRunOnServiceThread();
HdmiPortInfo portInfo = mService.getPortInfo(portId);
if (!portInfo.isArcSupported()) {
return;
}
HdmiDeviceInfo avr = getAvrDeviceInfo();
if (avr == null) {
if (isConnected) {
// Update the status (since TV may not have seen AVR yet) so
// that ARC can be initiated after discovery.
mArcFeatureEnabled.put(portId, isConnected);
}
return;
}
// Should not activate ARC if +5V status is false.
if (avr.getPortId() == portId) {
changeArcFeatureEnabled(portId, isConnected);
}
}
use of android.hardware.hdmi.HdmiDeviceInfo in project android_frameworks_base by ResurrectionRemix.
the class HdmiCecLocalDeviceTv method updateActiveInput.
@ServiceThreadOnly
void updateActiveInput(int path, boolean notifyInputChange) {
assertRunOnServiceThread();
// Seq #15
setActivePath(path);
// Show OSD port change banner
if (notifyInputChange) {
ActiveSource activeSource = getActiveSource();
HdmiDeviceInfo info = getCecDeviceInfo(activeSource.logicalAddress);
if (info == null) {
info = mService.getDeviceInfoByPort(getActivePortId());
if (info == null) {
// No CEC/MHL device is present at the port. Attempt to switch to
// the hardware port itself for non-CEC devices that may be connected.
info = new HdmiDeviceInfo(path, getActivePortId());
}
}
mService.invokeInputChangeListener(info);
}
}
use of android.hardware.hdmi.HdmiDeviceInfo in project android_frameworks_base by ResurrectionRemix.
the class HdmiCecLocalDeviceTv method handleActiveSource.
@Override
@ServiceThreadOnly
protected boolean handleActiveSource(HdmiCecMessage message) {
assertRunOnServiceThread();
int logicalAddress = message.getSource();
int physicalAddress = HdmiUtils.twoBytesToInt(message.getParams());
HdmiDeviceInfo info = getCecDeviceInfo(logicalAddress);
if (info == null) {
if (!handleNewDeviceAtTheTailOfActivePath(physicalAddress)) {
HdmiLogger.debug("Device info %X not found; buffering the command", logicalAddress);
mDelayedMessageBuffer.add(message);
}
} else if (isInputReady(info.getId()) || info.getDeviceType() == HdmiDeviceInfo.DEVICE_AUDIO_SYSTEM) {
updateDevicePowerStatus(logicalAddress, HdmiControlManager.POWER_STATUS_ON);
ActiveSource activeSource = ActiveSource.of(logicalAddress, physicalAddress);
ActiveSourceHandler.create(this, null).process(activeSource, info.getDeviceType());
} else {
HdmiLogger.debug("Input not ready for device: %X; buffering the command", info.getId());
mDelayedMessageBuffer.add(message);
}
return true;
}
use of android.hardware.hdmi.HdmiDeviceInfo in project android_frameworks_base by ResurrectionRemix.
the class HdmiCecLocalDeviceTv method handleInactiveSource.
@Override
@ServiceThreadOnly
protected boolean handleInactiveSource(HdmiCecMessage message) {
assertRunOnServiceThread();
// Ignore <Inactive Source> from non-active source device.
if (getActiveSource().logicalAddress != message.getSource()) {
return true;
}
if (isProhibitMode()) {
return true;
}
int portId = getPrevPortId();
if (portId != Constants.INVALID_PORT_ID) {
// TODO: Do this only if TV is not showing multiview like PIP/PAP.
HdmiDeviceInfo inactiveSource = getCecDeviceInfo(message.getSource());
if (inactiveSource == null) {
return true;
}
if (mService.pathToPortId(inactiveSource.getPhysicalAddress()) == portId) {
return true;
}
// TODO: Switch the TV freeze mode off
doManualPortSwitching(portId, null);
setPrevPortId(Constants.INVALID_PORT_ID);
} else {
// No HDMI port to switch to was found. Notify the input change listers to
// switch to the lastly shown internal input.
mActiveSource.invalidate();
setActivePath(Constants.INVALID_PHYSICAL_ADDRESS);
mService.invokeInputChangeListener(HdmiDeviceInfo.INACTIVE_DEVICE);
}
return true;
}
use of android.hardware.hdmi.HdmiDeviceInfo in project android_frameworks_base by ResurrectionRemix.
the class HdmiCecLocalDeviceTv method addDeviceInfo.
/**
* Add a new {@link HdmiDeviceInfo}. It returns old device info which has the same
* logical address as new device info's.
*
* <p>Declared as package-private. accessed by {@link HdmiControlService} only.
*
* @param deviceInfo a new {@link HdmiDeviceInfo} to be added.
* @return {@code null} if it is new device. Otherwise, returns old {@HdmiDeviceInfo}
* that has the same logical address as new one has.
*/
@ServiceThreadOnly
private HdmiDeviceInfo addDeviceInfo(HdmiDeviceInfo deviceInfo) {
assertRunOnServiceThread();
HdmiDeviceInfo oldDeviceInfo = getCecDeviceInfo(deviceInfo.getLogicalAddress());
if (oldDeviceInfo != null) {
removeDeviceInfo(deviceInfo.getId());
}
mDeviceInfos.append(deviceInfo.getId(), deviceInfo);
updateSafeDeviceInfoList();
return oldDeviceInfo;
}
Aggregations