Search in sources :

Example 1 with ActiveSource

use of com.android.server.hdmi.HdmiCecLocalDevice.ActiveSource 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 2 with ActiveSource

use of com.android.server.hdmi.HdmiCecLocalDevice.ActiveSource in project android_frameworks_base by ResurrectionRemix.

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 3 with ActiveSource

use of com.android.server.hdmi.HdmiCecLocalDevice.ActiveSource in project platform_frameworks_base by android.

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 4 with ActiveSource

use of com.android.server.hdmi.HdmiCecLocalDevice.ActiveSource in project android_frameworks_base by AOSPA.

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 5 with ActiveSource

use of com.android.server.hdmi.HdmiCecLocalDevice.ActiveSource in project android_frameworks_base by crdroidandroid.

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)

Aggregations

HdmiDeviceInfo (android.hardware.hdmi.HdmiDeviceInfo)5 ActiveSource (com.android.server.hdmi.HdmiCecLocalDevice.ActiveSource)5