Lines Matching refs:deviceId
35 void FakeEventHub::addDevice(int32_t deviceId, const std::string& name, in addDevice() argument
40 mDevices.add(deviceId, device); in addDevice()
42 enqueueEvent(ARBITRARY_TIME, READ_TIME, deviceId, EventHubInterface::DEVICE_ADDED, 0, 0); in addDevice()
45 void FakeEventHub::removeDevice(int32_t deviceId) { in removeDevice() argument
46 delete mDevices.valueFor(deviceId); in removeDevice()
47 mDevices.removeItem(deviceId); in removeDevice()
49 enqueueEvent(ARBITRARY_TIME, READ_TIME, deviceId, EventHubInterface::DEVICE_REMOVED, 0, 0); in removeDevice()
52 bool FakeEventHub::isDeviceEnabled(int32_t deviceId) const { in isDeviceEnabled()
53 Device* device = getDevice(deviceId); in isDeviceEnabled()
55 ALOGE("Incorrect device id=%" PRId32 " provided to %s", deviceId, __func__); in isDeviceEnabled()
61 status_t FakeEventHub::enableDevice(int32_t deviceId) { in enableDevice() argument
63 Device* device = getDevice(deviceId); in enableDevice()
65 ALOGE("Incorrect device id=%" PRId32 " provided to %s", deviceId, __func__); in enableDevice()
69 ALOGW("Duplicate call to %s, device %" PRId32 " already enabled", __func__, deviceId); in enableDevice()
76 status_t FakeEventHub::disableDevice(int32_t deviceId) { in disableDevice() argument
77 Device* device = getDevice(deviceId); in disableDevice()
79 ALOGE("Incorrect device id=%" PRId32 " provided to %s", deviceId, __func__); in disableDevice()
83 ALOGW("Duplicate call to %s, device %" PRId32 " already disabled", __func__, deviceId); in disableDevice()
93 void FakeEventHub::addConfigurationProperty(int32_t deviceId, const char* key, const char* value) { in addConfigurationProperty() argument
94 getDevice(deviceId)->configuration.addProperty(key, value); in addConfigurationProperty()
97 void FakeEventHub::addConfigurationMap(int32_t deviceId, const PropertyMap* configuration) { in addConfigurationMap() argument
98 getDevice(deviceId)->configuration.addAll(configuration); in addConfigurationMap()
101 void FakeEventHub::addAbsoluteAxis(int32_t deviceId, int axis, int32_t minValue, int32_t maxValue, in addAbsoluteAxis() argument
103 Device* device = getDevice(deviceId); in addAbsoluteAxis()
115 void FakeEventHub::addRelativeAxis(int32_t deviceId, int32_t axis) { in addRelativeAxis() argument
116 getDevice(deviceId)->relativeAxes.add(axis, true); in addRelativeAxis()
119 void FakeEventHub::setKeyCodeState(int32_t deviceId, int32_t keyCode, int32_t state) { in setKeyCodeState() argument
120 getDevice(deviceId)->keyCodeStates.replaceValueFor(keyCode, state); in setKeyCodeState()
123 void FakeEventHub::setRawLayoutInfo(int32_t deviceId, RawLayoutInfo info) { in setRawLayoutInfo() argument
124 getDevice(deviceId)->layoutInfo = info; in setRawLayoutInfo()
127 void FakeEventHub::setScanCodeState(int32_t deviceId, int32_t scanCode, int32_t state) { in setScanCodeState() argument
128 getDevice(deviceId)->scanCodeStates.replaceValueFor(scanCode, state); in setScanCodeState()
131 void FakeEventHub::setSwitchState(int32_t deviceId, int32_t switchCode, int32_t state) { in setSwitchState() argument
132 getDevice(deviceId)->switchStates.replaceValueFor(switchCode, state); in setSwitchState()
135 void FakeEventHub::setAbsoluteAxisValue(int32_t deviceId, int32_t axis, int32_t value) { in setAbsoluteAxisValue() argument
136 getDevice(deviceId)->absoluteAxisValue.replaceValueFor(axis, value); in setAbsoluteAxisValue()
139 void FakeEventHub::addKey(int32_t deviceId, int32_t scanCode, int32_t usageCode, int32_t keyCode, in addKey() argument
141 Device* device = getDevice(deviceId); in addKey()
153 void FakeEventHub::addKeyCodeMapping(int32_t deviceId, int32_t fromKeyCode, int32_t toKeyCode) { in addKeyCodeMapping() argument
154 getDevice(deviceId)->keyCodeMapping.insert_or_assign(fromKeyCode, toKeyCode); in addKeyCodeMapping()
157 void FakeEventHub::addKeyRemapping(int32_t deviceId, int32_t fromKeyCode, int32_t toKeyCode) const { in addKeyRemapping() argument
158 Device* device = getDevice(deviceId); in addKeyRemapping()
162 void FakeEventHub::addLed(int32_t deviceId, int32_t led, bool initialState) { in addLed() argument
163 getDevice(deviceId)->leds.add(led, initialState); in addLed()
166 void FakeEventHub::addSensorAxis(int32_t deviceId, int32_t absCode, in addSensorAxis() argument
171 getDevice(deviceId)->sensorsByAbsCode.emplace(absCode, info); in addSensorAxis()
174 void FakeEventHub::setMscEvent(int32_t deviceId, int32_t mscEvent) { in setMscEvent() argument
177 getDevice(deviceId)->mscBitmask.loadFromBuffer(buffer); in setMscEvent()
193 bool FakeEventHub::getLedState(int32_t deviceId, int32_t led) { in getLedState() argument
194 return getDevice(deviceId)->leds.valueFor(led); in getLedState()
201 void FakeEventHub::addVirtualKeyDefinition(int32_t deviceId, in addVirtualKeyDefinition() argument
203 getDevice(deviceId)->virtualKeys.push_back(definition); in addVirtualKeyDefinition()
206 void FakeEventHub::enqueueEvent(nsecs_t when, nsecs_t readTime, int32_t deviceId, int32_t type, in enqueueEvent() argument
212 event.deviceId = deviceId; in enqueueEvent()
219 setAbsoluteAxisValue(deviceId, code, value); in enqueueEvent()
239 FakeEventHub::Device* FakeEventHub::getDevice(int32_t deviceId) const { in getDevice()
240 ssize_t index = mDevices.indexOfKey(deviceId); in getDevice()
244 ftl::Flags<InputDeviceClass> FakeEventHub::getDeviceClasses(int32_t deviceId) const { in getDeviceClasses()
245 Device* device = getDevice(deviceId); in getDeviceClasses()
249 InputDeviceIdentifier FakeEventHub::getDeviceIdentifier(int32_t deviceId) const { in getDeviceIdentifier()
250 Device* device = getDevice(deviceId); in getDeviceIdentifier()
258 std::optional<PropertyMap> FakeEventHub::getConfiguration(int32_t deviceId) const { in getConfiguration()
259 Device* device = getDevice(deviceId); in getConfiguration()
266 status_t FakeEventHub::getAbsoluteAxisInfo(int32_t deviceId, int axis, in getAbsoluteAxisInfo() argument
268 Device* device = getDevice(deviceId); in getAbsoluteAxisInfo()
280 bool FakeEventHub::hasRelativeAxis(int32_t deviceId, int axis) const { in hasRelativeAxis() argument
281 Device* device = getDevice(deviceId); in hasRelativeAxis()
292 bool FakeEventHub::hasMscEvent(int32_t deviceId, int mscEvent) const { in hasMscEvent() argument
293 Device* device = getDevice(deviceId); in hasMscEvent()
300 status_t FakeEventHub::mapKey(int32_t deviceId, int32_t scanCode, int32_t usageCode, in mapKey() argument
303 Device* device = getDevice(deviceId); in mapKey()
345 int32_t deviceId, int32_t absCode) const { in mapSensor() argument
346 Device* device = getDevice(deviceId); in mapSensor()
372 std::vector<TouchVideoFrame> FakeEventHub::getVideoFrames(int32_t deviceId) { in getVideoFrames() argument
373 auto it = mVideoFrames.find(deviceId); in getVideoFrames()
376 mVideoFrames.erase(deviceId); in getVideoFrames()
382 int32_t FakeEventHub::getScanCodeState(int32_t deviceId, int32_t scanCode) const { in getScanCodeState() argument
383 Device* device = getDevice(deviceId); in getScanCodeState()
393 std::optional<RawLayoutInfo> FakeEventHub::getRawLayoutInfo(int32_t deviceId) const { in getRawLayoutInfo()
394 Device* device = getDevice(deviceId); in getRawLayoutInfo()
398 int32_t FakeEventHub::getKeyCodeState(int32_t deviceId, int32_t keyCode) const { in getKeyCodeState() argument
399 Device* device = getDevice(deviceId); in getKeyCodeState()
409 int32_t FakeEventHub::getSwitchState(int32_t deviceId, int32_t sw) const { in getSwitchState() argument
410 Device* device = getDevice(deviceId); in getSwitchState()
420 status_t FakeEventHub::getAbsoluteAxisValue(int32_t deviceId, int32_t axis, in getAbsoluteAxisValue() argument
422 Device* device = getDevice(deviceId); in getAbsoluteAxisValue()
434 int32_t FakeEventHub::getKeyCodeForKeyLocation(int32_t deviceId, int32_t locationKeyCode) const { in getKeyCodeForKeyLocation() argument
435 Device* device = getDevice(deviceId); in getKeyCodeForKeyLocation()
444 bool FakeEventHub::markSupportedKeyCodes(int32_t deviceId, const std::vector<int32_t>& keyCodes, in markSupportedKeyCodes() argument
446 Device* device = getDevice(deviceId); in markSupportedKeyCodes()
465 bool FakeEventHub::hasScanCode(int32_t deviceId, int32_t scanCode) const { in hasScanCode() argument
466 Device* device = getDevice(deviceId); in hasScanCode()
474 bool FakeEventHub::hasKeyCode(int32_t deviceId, int32_t keyCode) const { in hasKeyCode() argument
475 Device* device = getDevice(deviceId); in hasKeyCode()
492 bool FakeEventHub::hasLed(int32_t deviceId, int32_t led) const { in hasLed() argument
493 Device* device = getDevice(deviceId); in hasLed()
497 void FakeEventHub::setLedState(int32_t deviceId, int32_t led, bool on) { in setLedState() argument
498 Device* device = getDevice(deviceId); in setLedState()
512 int32_t deviceId, std::vector<VirtualKeyDefinition>& outVirtualKeys) const { in getVirtualKeyDefinitions() argument
515 Device* device = getDevice(deviceId); in getVirtualKeyDefinitions()
529 std::vector<int32_t> FakeEventHub::getVibratorIds(int32_t deviceId) const { in getVibratorIds()
541 std::vector<int32_t> FakeEventHub::getRawBatteryIds(int32_t deviceId) const { in getRawBatteryIds()
545 std::optional<RawBatteryInfo> FakeEventHub::getRawBatteryInfo(int32_t deviceId, in getRawBatteryInfo() argument
555 std::vector<int32_t> FakeEventHub::getRawLightIds(int32_t deviceId) const { in getRawLightIds()
563 std::optional<RawLightInfo> FakeEventHub::getRawLightInfo(int32_t deviceId, int32_t lightId) const { in getRawLightInfo() argument
571 void FakeEventHub::setLightBrightness(int32_t deviceId, int32_t lightId, int32_t brightness) { in setLightBrightness() argument
575 void FakeEventHub::setLightIntensities(int32_t deviceId, int32_t lightId, in setLightIntensities() argument
580 std::optional<int32_t> FakeEventHub::getLightBrightness(int32_t deviceId, int32_t lightId) const { in getLightBrightness() argument
589 int32_t deviceId, int32_t lightId) const { in getLightIntensities() argument
597 void FakeEventHub::setSysfsRootPath(int32_t deviceId, std::string sysfsRootPath) const { in setSysfsRootPath() argument
598 Device* device = getDevice(deviceId); in setSysfsRootPath()