Methods Summary |
---|
protected final void | addAndStartAction(com.android.server.hdmi.HdmiCecFeatureAction action)
mSource.addAndStartAction(action);
|
protected final void | addOnFinishedCallback(com.android.server.hdmi.HdmiCecFeatureAction action, java.lang.Runnable runnable)
if (mOnFinishedCallbacks == null) {
mOnFinishedCallbacks = new ArrayList<>();
}
mOnFinishedCallbacks.add(Pair.create(action, runnable));
|
protected void | addTimer(int state, int delayMillis)
mActionTimer.sendTimerMessage(state, delayMillis);
|
void | clear()Clean up action's state.
Declared as package-private. Only {@link HdmiControlService} can access it.
mState = STATE_NONE;
// Clear all timers.
mActionTimer.clearTimerMessage();
|
private com.android.server.hdmi.HdmiCecFeatureAction$ActionTimer | createActionTimer(android.os.Looper looper)
return new ActionTimerHandler(looper);
|
protected void | finish()Finish up the action. Reset the state, and remove itself from the action queue.
finish(true);
|
void | finish(boolean removeSelf)
clear();
if (removeSelf) {
removeAction(this);
}
if (mOnFinishedCallbacks != null) {
for (Pair<HdmiCecFeatureAction, Runnable> actionCallbackPair: mOnFinishedCallbacks) {
if (actionCallbackPair.first.mState != STATE_NONE) {
actionCallbackPair.second.run();
}
}
mOnFinishedCallbacks = null;
}
|
protected final java.util.List | getActions(java.lang.Class clazz)
return mSource.getActions(clazz);
|
protected final HdmiCecMessageCache | getCecMessageCache()
return mSource.getCecMessageCache();
|
protected final int | getSourceAddress()
return mSource.getDeviceInfo().getLogicalAddress();
|
protected final int | getSourcePath()
return mSource.getDeviceInfo().getPhysicalAddress();
|
abstract void | handleTimerEvent(int state)Called when the action should handle the timer event it created before.
CEC standard mandates each command transmission should be responded within
certain period of time. The method is called when the timer it created as it transmitted
a command gets expired. Inner logic should take an appropriate action.
|
protected final HdmiCecLocalDevice | localDevice()
return mSource;
|
protected final HdmiCecLocalDevicePlayback | playback()
return (HdmiCecLocalDevicePlayback) mSource;
|
protected final void | pollDevices(com.android.server.hdmi.HdmiControlService.DevicePollingCallback callback, int pickStrategy, int retryCount)
mService.pollDevices(callback, getSourceAddress(), pickStrategy, retryCount);
|
abstract boolean | processCommand(HdmiCecMessage cmd)Process the command. Called whenever a new command arrives.
|
protected final void | removeAction(com.android.server.hdmi.HdmiCecFeatureAction action)Remove the action from the action queue. This is called after the action finishes
its role.
mSource.removeAction(action);
|
protected final void | removeAction(java.lang.Class clazz)
mSource.removeActionExcept(clazz, null);
|
protected final void | removeActionExcept(java.lang.Class clazz, com.android.server.hdmi.HdmiCecFeatureAction exception)
mSource.removeActionExcept(clazz, exception);
|
protected final void | sendCommand(HdmiCecMessage cmd, HdmiControlService.SendMessageCallback callback)
mService.sendCecCommand(cmd, callback);
|
protected final void | sendCommand(HdmiCecMessage cmd)
mService.sendCecCommand(cmd);
|
protected final void | sendUserControlPressedAndReleased(int targetAddress, int uiCommand)
mSource.sendUserControlPressedAndReleased(targetAddress, uiCommand);
|
void | setActionTimer(com.android.server.hdmi.HdmiCecFeatureAction$ActionTimer actionTimer)
mActionTimer = actionTimer;
|
abstract boolean | start()Called after the action is created. Initialization or first step to take
for the action can be done in this method. Shall update {@code mState} to
indicate that the action has started.
|
boolean | started()
return mState != STATE_NONE;
|
protected final HdmiCecLocalDeviceTv | tv()
return (HdmiCecLocalDeviceTv) mSource;
|