use of android.hardware.hdmi.HdmiDeviceInfo in project android_frameworks_base by DirtyUnicorns.
the class PowerStatusMonitorAction method queryPowerStatus.
private void queryPowerStatus() {
List<HdmiDeviceInfo> deviceInfos = tv().getDeviceInfoList(false);
resetPowerStatus(deviceInfos);
for (HdmiDeviceInfo info : deviceInfos) {
final int logicalAddress = info.getLogicalAddress();
sendCommand(HdmiCecMessageBuilder.buildGiveDevicePowerStatus(getSourceAddress(), logicalAddress), new SendMessageCallback() {
@Override
public void onSendCompleted(int error) {
// update power status into UNKNOWN.
if (error != Constants.SEND_RESULT_SUCCESS) {
updatePowerStatus(logicalAddress, POWER_STATUS_UNKNOWN, true);
}
}
});
}
mState = STATE_WAIT_FOR_REPORT_POWER_STATUS;
// Add both timers, monitoring and timeout.
addTimer(STATE_WAIT_FOR_NEXT_MONITORING, MONITIROING_INTERNAL_MS);
addTimer(STATE_WAIT_FOR_REPORT_POWER_STATUS, REPORT_POWER_STATUS_TIMEOUT_MS);
}
use of android.hardware.hdmi.HdmiDeviceInfo in project android_frameworks_base by DirtyUnicorns.
the class ActiveSourceHandler method process.
/**
* Handles the incoming active source command.
*
* @param newActive new active source information
* @param deviceType device type of the new active source
*/
void process(ActiveSource newActive, int deviceType) {
// Seq #17
HdmiCecLocalDeviceTv tv = mSource;
HdmiDeviceInfo device = mService.getDeviceInfo(newActive.logicalAddress);
if (device == null) {
tv.startNewDeviceAction(newActive, deviceType);
}
if (!tv.isProhibitMode()) {
ActiveSource old = ActiveSource.of(tv.getActiveSource());
tv.updateActiveSource(newActive);
boolean notifyInputChange = (mCallback == null);
if (!old.equals(newActive)) {
tv.setPrevPortId(tv.getActivePortId());
}
tv.updateActiveInput(newActive.physicalAddress, notifyInputChange);
invokeCallback(HdmiControlManager.RESULT_SUCCESS);
} else {
// TV is in a mode that should keep its current source/input from
// being changed for its operation. Reclaim the active source
// or switch the port back to the one used for the current mode.
ActiveSource current = tv.getActiveSource();
if (current.logicalAddress == getSourceAddress()) {
HdmiCecMessage activeSourceCommand = HdmiCecMessageBuilder.buildActiveSource(current.logicalAddress, current.physicalAddress);
mService.sendCecCommand(activeSourceCommand);
tv.updateActiveSource(current);
invokeCallback(HdmiControlManager.RESULT_SUCCESS);
} else {
tv.startRoutingControl(newActive.physicalAddress, current.physicalAddress, true, mCallback);
}
}
}
use of android.hardware.hdmi.HdmiDeviceInfo in project android_frameworks_base by AOSPA.
the class HdmiCecLocalDeviceTv method dump.
@Override
protected void dump(final IndentingPrintWriter pw) {
super.dump(pw);
pw.println("mArcEstablished: " + mArcEstablished);
pw.println("mArcFeatureEnabled: " + mArcFeatureEnabled);
pw.println("mSystemAudioActivated: " + mSystemAudioActivated);
pw.println("mSystemAudioMute: " + mSystemAudioMute);
pw.println("mAutoDeviceOff: " + mAutoDeviceOff);
pw.println("mAutoWakeup: " + mAutoWakeup);
pw.println("mSkipRoutingControl: " + mSkipRoutingControl);
pw.println("mPrevPortId: " + mPrevPortId);
pw.println("CEC devices:");
pw.increaseIndent();
for (HdmiDeviceInfo info : mSafeAllDeviceInfos) {
pw.println(info);
}
pw.decreaseIndent();
}
use of android.hardware.hdmi.HdmiDeviceInfo in project android_frameworks_base by AOSPA.
the class HdmiCecLocalDeviceTv method sendStandby.
@Override
protected void sendStandby(int deviceId) {
HdmiDeviceInfo targetDevice = mDeviceInfos.get(deviceId);
if (targetDevice == null) {
return;
}
int targetAddress = targetDevice.getLogicalAddress();
mService.sendCecCommand(HdmiCecMessageBuilder.buildStandby(mAddress, targetAddress));
}
use of android.hardware.hdmi.HdmiDeviceInfo in project android_frameworks_base by AOSPA.
the class HdmiCecLocalDeviceTv method disableArcIfExist.
@ServiceThreadOnly
private void disableArcIfExist() {
assertRunOnServiceThread();
HdmiDeviceInfo avr = getAvrDeviceInfo();
if (avr == null) {
return;
}
// Seq #44.
removeAction(RequestArcInitiationAction.class);
if (!hasAction(RequestArcTerminationAction.class) && isArcEstablished()) {
addAndStartAction(new RequestArcTerminationAction(this, avr.getLogicalAddress()));
}
}
Aggregations