use of com.android.server.hdmi.HdmiAnnotations.ServiceThreadOnly in project platform_frameworks_base by android.
the class HdmiControlService method disableHdmiControlService.
@ServiceThreadOnly
private void disableHdmiControlService() {
disableDevices(new PendingActionClearedCallback() {
@Override
public void onCleared(HdmiCecLocalDevice device) {
assertRunOnServiceThread();
mCecController.flush(new Runnable() {
@Override
public void run() {
mCecController.setOption(OPTION_CEC_ENABLE, DISABLED);
mMhlController.setOption(OPTION_MHL_ENABLE, DISABLED);
clearLocalDevices();
}
});
}
});
}
use of com.android.server.hdmi.HdmiAnnotations.ServiceThreadOnly in project platform_frameworks_base by android.
the class HdmiControlService method updateSafeMhlInput.
@ServiceThreadOnly
private void updateSafeMhlInput() {
assertRunOnServiceThread();
List<HdmiDeviceInfo> inputs = Collections.emptyList();
SparseArray<HdmiMhlLocalDeviceStub> devices = mMhlController.getAllLocalDevices();
for (int i = 0; i < devices.size(); ++i) {
HdmiMhlLocalDeviceStub device = devices.valueAt(i);
HdmiDeviceInfo info = device.getInfo();
if (info != null) {
if (inputs.isEmpty()) {
inputs = new ArrayList<>();
}
inputs.add(device.getInfo());
}
}
synchronized (mLock) {
mMhlDevices = inputs;
}
}
use of com.android.server.hdmi.HdmiAnnotations.ServiceThreadOnly in project platform_frameworks_base by android.
the class HdmiCecLocalDeviceTv method onAddressAllocated.
@Override
@ServiceThreadOnly
protected void onAddressAllocated(int logicalAddress, int reason) {
assertRunOnServiceThread();
List<HdmiPortInfo> ports = mService.getPortInfo();
for (HdmiPortInfo port : ports) {
mArcFeatureEnabled.put(port.getId(), port.isArcSupported());
}
mService.registerTvInputCallback(mTvInputCallback);
mService.sendCecCommand(HdmiCecMessageBuilder.buildReportPhysicalAddressCommand(mAddress, mService.getPhysicalAddress(), mDeviceType));
mService.sendCecCommand(HdmiCecMessageBuilder.buildDeviceVendorIdCommand(mAddress, mService.getVendorId()));
// TV is a CEC switch too.
mCecSwitches.add(mService.getPhysicalAddress());
mTvInputs.clear();
mSkipRoutingControl = (reason == HdmiControlService.INITIATED_BY_WAKE_UP_MESSAGE);
launchRoutingControl(reason != HdmiControlService.INITIATED_BY_ENABLE_CEC && reason != HdmiControlService.INITIATED_BY_BOOT_UP);
mLocalDeviceAddresses = initLocalDeviceAddresses();
resetSelectRequestBuffer();
launchDeviceDiscovery();
}
use of com.android.server.hdmi.HdmiAnnotations.ServiceThreadOnly in project platform_frameworks_base by android.
the class HdmiCecLocalDeviceTv method handleSetOsdName.
@Override
@ServiceThreadOnly
protected boolean handleSetOsdName(HdmiCecMessage message) {
int source = message.getSource();
HdmiDeviceInfo deviceInfo = getCecDeviceInfo(source);
// If the device is not in device list, ignore it.
if (deviceInfo == null) {
Slog.e(TAG, "No source device info for <Set Osd Name>." + message);
return true;
}
String osdName = null;
try {
osdName = new String(message.getParams(), "US-ASCII");
} catch (UnsupportedEncodingException e) {
Slog.e(TAG, "Invalid <Set Osd Name> request:" + message, e);
return true;
}
if (deviceInfo.getDisplayName().equals(osdName)) {
Slog.i(TAG, "Ignore incoming <Set Osd Name> having same osd name:" + message);
return true;
}
addCecDevice(new HdmiDeviceInfo(deviceInfo.getLogicalAddress(), deviceInfo.getPhysicalAddress(), deviceInfo.getPortId(), deviceInfo.getDeviceType(), deviceInfo.getVendorId(), osdName));
return true;
}
use of com.android.server.hdmi.HdmiAnnotations.ServiceThreadOnly in project platform_frameworks_base by android.
the class HdmiCecLocalDeviceTv method updateActiveInput.
@ServiceThreadOnly
void updateActiveInput(int path, boolean notifyInputChange) {
assertRunOnServiceThread();
// Seq #15
setActivePath(path);
// Show OSD port change banner
if (notifyInputChange) {
ActiveSource activeSource = getActiveSource();
HdmiDeviceInfo info = getCecDeviceInfo(activeSource.logicalAddress);
if (info == null) {
info = mService.getDeviceInfoByPort(getActivePortId());
if (info == null) {
// No CEC/MHL device is present at the port. Attempt to switch to
// the hardware port itself for non-CEC devices that may be connected.
info = new HdmiDeviceInfo(path, getActivePortId());
}
}
mService.invokeInputChangeListener(info);
}
}
Aggregations