Search in sources :

Example 6 with SendMessageCallback

use of com.android.server.hdmi.HdmiControlService.SendMessageCallback in project android_frameworks_base by ResurrectionRemix.

the class OneTouchRecordAction method sendRecordOn.

private void sendRecordOn() {
    sendCommand(HdmiCecMessageBuilder.buildRecordOn(getSourceAddress(), mRecorderAddress, mRecordSource), new SendMessageCallback() {

        @Override
        public void onSendCompleted(int error) {
            // if failed to send <Record On>, display error message and finish action.
            if (error != Constants.SEND_RESULT_SUCCESS) {
                tv().announceOneTouchRecordResult(mRecorderAddress, ONE_TOUCH_RECORD_CHECK_RECORDER_CONNECTION);
                finish();
                return;
            }
        }
    });
    mState = STATE_WAITING_FOR_RECORD_STATUS;
    addTimer(mState, RECORD_STATUS_TIMEOUT_MS);
}
Also used : SendMessageCallback(com.android.server.hdmi.HdmiControlService.SendMessageCallback)

Example 7 with SendMessageCallback

use of com.android.server.hdmi.HdmiControlService.SendMessageCallback in project android_frameworks_base by ResurrectionRemix.

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 8 with SendMessageCallback

use of com.android.server.hdmi.HdmiControlService.SendMessageCallback in project android_frameworks_base by DirtyUnicorns.

the class DeviceSelectAction method queryDevicePowerStatus.

private void queryDevicePowerStatus() {
    sendCommand(mGivePowerStatus, new SendMessageCallback() {

        @Override
        public void onSendCompleted(int error) {
            if (error != Constants.SEND_RESULT_SUCCESS) {
                invokeCallback(HdmiControlManager.RESULT_COMMUNICATION_FAILED);
                finish();
                return;
            }
        }
    });
    mState = STATE_WAIT_FOR_REPORT_POWER_STATUS;
    addTimer(mState, HdmiConfig.TIMEOUT_MS);
}
Also used : SendMessageCallback(com.android.server.hdmi.HdmiControlService.SendMessageCallback)

Example 9 with SendMessageCallback

use of com.android.server.hdmi.HdmiControlService.SendMessageCallback in project android_frameworks_base by DirtyUnicorns.

the class OneTouchRecordAction method sendRecordOn.

private void sendRecordOn() {
    sendCommand(HdmiCecMessageBuilder.buildRecordOn(getSourceAddress(), mRecorderAddress, mRecordSource), new SendMessageCallback() {

        @Override
        public void onSendCompleted(int error) {
            // if failed to send <Record On>, display error message and finish action.
            if (error != Constants.SEND_RESULT_SUCCESS) {
                tv().announceOneTouchRecordResult(mRecorderAddress, ONE_TOUCH_RECORD_CHECK_RECORDER_CONNECTION);
                finish();
                return;
            }
        }
    });
    mState = STATE_WAITING_FOR_RECORD_STATUS;
    addTimer(mState, RECORD_STATUS_TIMEOUT_MS);
}
Also used : SendMessageCallback(com.android.server.hdmi.HdmiControlService.SendMessageCallback)

Example 10 with SendMessageCallback

use of com.android.server.hdmi.HdmiControlService.SendMessageCallback 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)

Aggregations

SendMessageCallback (com.android.server.hdmi.HdmiControlService.SendMessageCallback)30 HdmiDeviceInfo (android.hardware.hdmi.HdmiDeviceInfo)10