Methods Summary |
---|
protected boolean | canGoToStandby()
return !getWakeLock().isHeld();
|
protected void | disableDevice(boolean initiatedByCec, PendingActionClearedCallback callback)
super.disableDevice(initiatedByCec, callback);
assertRunOnServiceThread();
if (!initiatedByCec && mIsActiveSource) {
mService.sendCecCommand(HdmiCecMessageBuilder.buildInactiveSource(
mAddress, mService.getPhysicalAddress()));
}
setActiveSource(false);
checkIfPendingActionsCleared();
|
protected void | dump(com.android.internal.util.IndentingPrintWriter pw)
super.dump(pw);
pw.println("mIsActiveSource: " + mIsActiveSource);
|
protected int | getPreferredAddress()
assertRunOnServiceThread();
return SystemProperties.getInt(Constants.PROPERTY_PREFERRED_ADDRESS_PLAYBACK,
Constants.ADDR_UNREGISTERED);
|
private android.os.PowerManager.WakeLock | getWakeLock()
assertRunOnServiceThread();
if (mWakeLock == null) {
mWakeLock = mService.getPowerManager().newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
mWakeLock.setReferenceCounted(false);
}
return mWakeLock;
|
protected boolean | handleActiveSource(HdmiCecMessage message)
assertRunOnServiceThread();
int physicalAddress = HdmiUtils.twoBytesToInt(message.getParams());
mayResetActiveSource(physicalAddress);
return true; // Broadcast message.
|
protected boolean | handleRequestActiveSource(HdmiCecMessage message)
assertRunOnServiceThread();
maySendActiveSource(message.getSource());
return true; // Broadcast message.
|
protected boolean | handleRoutingChange(HdmiCecMessage message)
assertRunOnServiceThread();
int newPath = HdmiUtils.twoBytesToInt(message.getParams(), 2);
maySetActiveSource(newPath);
return true; // Broadcast message.
|
protected boolean | handleRoutingInformation(HdmiCecMessage message)
assertRunOnServiceThread();
int physicalAddress = HdmiUtils.twoBytesToInt(message.getParams());
maySetActiveSource(physicalAddress);
return true; // Broadcast message.
|
protected boolean | handleSetStreamPath(HdmiCecMessage message)
assertRunOnServiceThread();
int physicalAddress = HdmiUtils.twoBytesToInt(message.getParams());
maySetActiveSource(physicalAddress);
maySendActiveSource(message.getSource());
wakeUpIfActiveSource();
return true; // Broadcast message.
|
private void | invokeCallback(android.hardware.hdmi.IHdmiControlCallback callback, int result)
assertRunOnServiceThread();
try {
callback.onComplete(result);
} catch (RemoteException e) {
Slog.e(TAG, "Invoking callback failed:" + e);
}
|
private void | mayResetActiveSource(int physicalAddress)
if (physicalAddress != mService.getPhysicalAddress()) {
setActiveSource(false);
}
|
private void | maySendActiveSource(int dest)
if (mIsActiveSource) {
mService.sendCecCommand(HdmiCecMessageBuilder.buildActiveSource(
mAddress, mService.getPhysicalAddress()));
// Always reports menu-status active to receive RCP.
mService.sendCecCommand(HdmiCecMessageBuilder.buildReportMenuStatus(
mAddress, dest, Constants.MENU_STATE_ACTIVATED));
}
|
private void | maySetActiveSource(int physicalAddress)
setActiveSource(physicalAddress == mService.getPhysicalAddress());
|
protected void | onAddressAllocated(int logicalAddress, int reason)
assertRunOnServiceThread();
mService.sendCecCommand(HdmiCecMessageBuilder.buildReportPhysicalAddressCommand(
mAddress, mService.getPhysicalAddress(), mDeviceType));
mService.sendCecCommand(HdmiCecMessageBuilder.buildDeviceVendorIdCommand(
mAddress, mService.getVendorId()));
startQueuedActions();
|
void | onHotplug(int portId, boolean connected)
assertRunOnServiceThread();
mCecMessageCache.flushAll();
// We'll not clear mIsActiveSource on the hotplug event to pass CETC 11.2.2-2 ~ 3.
if (connected && mService.isPowerStandbyOrTransient()) {
mService.wakeUp();
}
if (!connected) {
getWakeLock().release();
}
|
void | oneTouchPlay(android.hardware.hdmi.IHdmiControlCallback callback)
assertRunOnServiceThread();
if (hasAction(OneTouchPlayAction.class)) {
Slog.w(TAG, "oneTouchPlay already in progress");
invokeCallback(callback, HdmiControlManager.RESULT_ALREADY_IN_PROGRESS);
return;
}
// TODO: Consider the case of multiple TV sets. For now we always direct the command
// to the primary one.
OneTouchPlayAction action = OneTouchPlayAction.create(this, Constants.ADDR_TV,
callback);
if (action == null) {
Slog.w(TAG, "Cannot initiate oneTouchPlay");
invokeCallback(callback, HdmiControlManager.RESULT_EXCEPTION);
return;
}
addAndStartAction(action);
|
void | queryDisplayStatus(android.hardware.hdmi.IHdmiControlCallback callback)
assertRunOnServiceThread();
if (hasAction(DevicePowerStatusAction.class)) {
Slog.w(TAG, "queryDisplayStatus already in progress");
invokeCallback(callback, HdmiControlManager.RESULT_ALREADY_IN_PROGRESS);
return;
}
DevicePowerStatusAction action = DevicePowerStatusAction.create(this,
Constants.ADDR_TV, callback);
if (action == null) {
Slog.w(TAG, "Cannot initiate queryDisplayStatus");
invokeCallback(callback, HdmiControlManager.RESULT_EXCEPTION);
return;
}
addAndStartAction(action);
|
void | setActiveSource(boolean on)
assertRunOnServiceThread();
mIsActiveSource = on;
if (on) {
getWakeLock().acquire();
HdmiLogger.debug("active source: %b. Wake lock acquired", mIsActiveSource);
} else {
getWakeLock().release();
HdmiLogger.debug("Wake lock released");
}
|
protected void | setPreferredAddress(int addr)
assertRunOnServiceThread();
SystemProperties.set(Constants.PROPERTY_PREFERRED_ADDRESS_PLAYBACK,
String.valueOf(addr));
|
private void | wakeUpIfActiveSource()
if (mIsActiveSource && mService.isPowerStandbyOrTransient()) {
mService.wakeUp();
}
|