Search in sources :

Example 51 with HdmiDeviceInfo

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);
}
Also used : HdmiDeviceInfo(android.hardware.hdmi.HdmiDeviceInfo) SendMessageCallback(com.android.server.hdmi.HdmiControlService.SendMessageCallback)

Example 52 with HdmiDeviceInfo

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);
        }
    }
}
Also used : HdmiDeviceInfo(android.hardware.hdmi.HdmiDeviceInfo) ActiveSource(com.android.server.hdmi.HdmiCecLocalDevice.ActiveSource)

Example 53 with HdmiDeviceInfo

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();
}
Also used : HdmiDeviceInfo(android.hardware.hdmi.HdmiDeviceInfo)

Example 54 with HdmiDeviceInfo

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));
}
Also used : HdmiDeviceInfo(android.hardware.hdmi.HdmiDeviceInfo)

Example 55 with HdmiDeviceInfo

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()));
    }
}
Also used : HdmiDeviceInfo(android.hardware.hdmi.HdmiDeviceInfo) ServiceThreadOnly(com.android.server.hdmi.HdmiAnnotations.ServiceThreadOnly)

Aggregations

HdmiDeviceInfo (android.hardware.hdmi.HdmiDeviceInfo)172 ServiceThreadOnly (com.android.server.hdmi.HdmiAnnotations.ServiceThreadOnly)110 ArrayList (java.util.ArrayList)15 TvInputHardwareInfo (android.media.tv.TvInputHardwareInfo)12 HdmiPortInfo (android.hardware.hdmi.HdmiPortInfo)10 SendMessageCallback (com.android.server.hdmi.HdmiControlService.SendMessageCallback)10 IHdmiControlCallback (android.hardware.hdmi.IHdmiControlCallback)5 RemoteException (android.os.RemoteException)5 ArraySet (android.util.ArraySet)5 SparseArray (android.util.SparseArray)5 SparseIntArray (android.util.SparseIntArray)5 InputChannel (android.view.InputChannel)5 SomeArgs (com.android.internal.os.SomeArgs)5 DeviceDiscoveryCallback (com.android.server.hdmi.DeviceDiscoveryAction.DeviceDiscoveryCallback)5 AllocateAddressCallback (com.android.server.hdmi.HdmiCecController.AllocateAddressCallback)5 ActiveSource (com.android.server.hdmi.HdmiCecLocalDevice.ActiveSource)5 UnsupportedEncodingException (java.io.UnsupportedEncodingException)5 BitSet (java.util.BitSet)5 TvInputInfo (android.media.tv.TvInputInfo)4 Message (android.os.Message)4