Methods Summary |
---|
static com.android.server.hdmi.DevicePowerStatusAction | create(HdmiCecLocalDevice source, int targetAddress, android.hardware.hdmi.IHdmiControlCallback callback)
if (source == null || callback == null) {
Slog.e(TAG, "Wrong arguments");
return null;
}
return new DevicePowerStatusAction(source, targetAddress, callback);
|
void | handleTimerEvent(int state)
if (mState != state) {
return;
}
if (state == STATE_WAITING_FOR_REPORT_POWER_STATUS) {
// Got no response from TV. Report status 'unknown'.
invokeCallback(HdmiControlManager.POWER_STATUS_UNKNOWN);
finish();
}
|
private void | invokeCallback(int result)
try {
mCallback.onComplete(result);
} catch (RemoteException e) {
Slog.e(TAG, "Callback failed:" + e);
}
|
boolean | processCommand(HdmiCecMessage cmd)
if (mState != STATE_WAITING_FOR_REPORT_POWER_STATUS
|| mTargetAddress != cmd.getSource()) {
return false;
}
if (cmd.getOpcode() == Constants.MESSAGE_REPORT_POWER_STATUS) {
int status = cmd.getParams()[0];
invokeCallback(status);
finish();
return true;
}
return false;
|
private void | queryDevicePowerStatus()
sendCommand(HdmiCecMessageBuilder.buildGiveDevicePowerStatus(getSourceAddress(),
mTargetAddress));
|
boolean | start()
queryDevicePowerStatus();
mState = STATE_WAITING_FOR_REPORT_POWER_STATUS;
addTimer(mState, HdmiConfig.TIMEOUT_MS);
return true;
|