Search in sources :

Example 11 with SendMessageCallback

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

the class TimerRecordingAction method sendTimerMessage.

private void sendTimerMessage() {
    HdmiCecMessage message = null;
    switch(mSourceType) {
        case TIMER_RECORDING_TYPE_DIGITAL:
            message = HdmiCecMessageBuilder.buildSetDigitalTimer(getSourceAddress(), mRecorderAddress, mRecordSource);
            break;
        case TIMER_RECORDING_TYPE_ANALOGUE:
            message = HdmiCecMessageBuilder.buildSetAnalogueTimer(getSourceAddress(), mRecorderAddress, mRecordSource);
            break;
        case TIMER_RECORDING_TYPE_EXTERNAL:
            message = HdmiCecMessageBuilder.buildSetExternalTimer(getSourceAddress(), mRecorderAddress, mRecordSource);
            break;
        default:
            tv().announceTimerRecordingResult(mRecorderAddress, TIMER_RECORDING_RESULT_EXTRA_FAIL_TO_RECORD_SELECTED_SOURCE);
            finish();
            return;
    }
    sendCommand(message, new SendMessageCallback() {

        @Override
        public void onSendCompleted(int error) {
            if (error != Constants.SEND_RESULT_SUCCESS) {
                tv().announceTimerRecordingResult(mRecorderAddress, TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION);
                finish();
                return;
            }
            mState = STATE_WAITING_FOR_TIMER_STATUS;
            addTimer(mState, TIMER_STATUS_TIMEOUT_MS);
        }
    });
}
Also used : SendMessageCallback(com.android.server.hdmi.HdmiControlService.SendMessageCallback)

Example 12 with SendMessageCallback

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

the class TimerRecordingAction method sendTimerMessage.

private void sendTimerMessage() {
    HdmiCecMessage message = null;
    switch(mSourceType) {
        case TIMER_RECORDING_TYPE_DIGITAL:
            message = HdmiCecMessageBuilder.buildSetDigitalTimer(getSourceAddress(), mRecorderAddress, mRecordSource);
            break;
        case TIMER_RECORDING_TYPE_ANALOGUE:
            message = HdmiCecMessageBuilder.buildSetAnalogueTimer(getSourceAddress(), mRecorderAddress, mRecordSource);
            break;
        case TIMER_RECORDING_TYPE_EXTERNAL:
            message = HdmiCecMessageBuilder.buildSetExternalTimer(getSourceAddress(), mRecorderAddress, mRecordSource);
            break;
        default:
            tv().announceTimerRecordingResult(mRecorderAddress, TIMER_RECORDING_RESULT_EXTRA_FAIL_TO_RECORD_SELECTED_SOURCE);
            finish();
            return;
    }
    sendCommand(message, new SendMessageCallback() {

        @Override
        public void onSendCompleted(int error) {
            if (error != Constants.SEND_RESULT_SUCCESS) {
                tv().announceTimerRecordingResult(mRecorderAddress, TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION);
                finish();
                return;
            }
            mState = STATE_WAITING_FOR_TIMER_STATUS;
            addTimer(mState, TIMER_STATUS_TIMEOUT_MS);
        }
    });
}
Also used : SendMessageCallback(com.android.server.hdmi.HdmiControlService.SendMessageCallback)

Example 13 with SendMessageCallback

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

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

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

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

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

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)

Aggregations

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