use of com.android.server.hdmi.HdmiControlService.SendMessageCallback in project android_frameworks_base by AOSPA.
the class HdmiCecLocalDeviceTv method sendClearTimerMessage.
private void sendClearTimerMessage(final int recorderAddress, int sourceType, byte[] recordSource) {
HdmiCecMessage message = null;
switch(sourceType) {
case TIMER_RECORDING_TYPE_DIGITAL:
message = HdmiCecMessageBuilder.buildClearDigitalTimer(mAddress, recorderAddress, recordSource);
break;
case TIMER_RECORDING_TYPE_ANALOGUE:
message = HdmiCecMessageBuilder.buildClearAnalogueTimer(mAddress, recorderAddress, recordSource);
break;
case TIMER_RECORDING_TYPE_EXTERNAL:
message = HdmiCecMessageBuilder.buildClearExternalTimer(mAddress, recorderAddress, recordSource);
break;
default:
Slog.w(TAG, "Invalid source type:" + recorderAddress);
announceClearTimerRecordingResult(recorderAddress, CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
return;
}
mService.sendCecCommand(message, new SendMessageCallback() {
@Override
public void onSendCompleted(int error) {
if (error != Constants.SEND_RESULT_SUCCESS) {
announceClearTimerRecordingResult(recorderAddress, CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
}
}
});
}
use of com.android.server.hdmi.HdmiControlService.SendMessageCallback in project android_frameworks_base by AOSPA.
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);
}
use of com.android.server.hdmi.HdmiControlService.SendMessageCallback in project android_frameworks_base by ResurrectionRemix.
the class HdmiCecLocalDeviceTv method sendClearTimerMessage.
private void sendClearTimerMessage(final int recorderAddress, int sourceType, byte[] recordSource) {
HdmiCecMessage message = null;
switch(sourceType) {
case TIMER_RECORDING_TYPE_DIGITAL:
message = HdmiCecMessageBuilder.buildClearDigitalTimer(mAddress, recorderAddress, recordSource);
break;
case TIMER_RECORDING_TYPE_ANALOGUE:
message = HdmiCecMessageBuilder.buildClearAnalogueTimer(mAddress, recorderAddress, recordSource);
break;
case TIMER_RECORDING_TYPE_EXTERNAL:
message = HdmiCecMessageBuilder.buildClearExternalTimer(mAddress, recorderAddress, recordSource);
break;
default:
Slog.w(TAG, "Invalid source type:" + recorderAddress);
announceClearTimerRecordingResult(recorderAddress, CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
return;
}
mService.sendCecCommand(message, new SendMessageCallback() {
@Override
public void onSendCompleted(int error) {
if (error != Constants.SEND_RESULT_SUCCESS) {
announceClearTimerRecordingResult(recorderAddress, CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
}
}
});
}
use of com.android.server.hdmi.HdmiControlService.SendMessageCallback in project android_frameworks_base by ResurrectionRemix.
the class RoutingControlAction method handleTimerEvent.
@Override
public void handleTimerEvent(int timeoutState) {
if (mState != timeoutState || mState == STATE_NONE) {
Slog.w("CEC", "Timer in a wrong state. Ignored.");
return;
}
switch(timeoutState) {
case STATE_WAIT_FOR_ROUTING_INFORMATION:
HdmiDeviceInfo device = tv().getDeviceInfoByPath(mCurrentRoutingPath);
if (device != null && mQueryDevicePowerStatus) {
int deviceLogicalAddress = device.getLogicalAddress();
queryDevicePowerStatus(deviceLogicalAddress, new SendMessageCallback() {
@Override
public void onSendCompleted(int error) {
handlDevicePowerStatusAckResult(error == HdmiControlManager.RESULT_SUCCESS);
}
});
} else {
updateActiveInput();
finishWithCallback(HdmiControlManager.RESULT_SUCCESS);
}
return;
case STATE_WAIT_FOR_REPORT_POWER_STATUS:
if (isPowerOnOrTransient(getTvPowerStatus())) {
updateActiveInput();
sendSetStreamPath();
}
finishWithCallback(HdmiControlManager.RESULT_SUCCESS);
return;
}
}
use of com.android.server.hdmi.HdmiControlService.SendMessageCallback in project android_frameworks_base by ResurrectionRemix.
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);
}
});
}
Aggregations