Lines Matching full:device
369 struct Device {
378 Device(const String8& name, uint32_t classes) :
383 KeyedVector<int32_t, Device*> mDevices;
398 Device* device = new Device(name, classes);
399 mDevices.add(deviceId, device);
417 Device* device = getDevice(deviceId);
425 device->axes.add(axis, info);
429 Device* device = getDevice(deviceId);
430 device->keyCodeStates.replaceValueFor(keyCode, state);
434 Device* device = getDevice(deviceId);
435 device->scanCodeStates.replaceValueFor(scanCode, state);
439 Device* device = getDevice(deviceId);
440 device->switchStates.replaceValueFor(switchCode, state);
444 Device* device = getDevice(deviceId);
448 device->keys.add(scanCode, info);
474 Device* getDevice(int32_t deviceId) const {
480 Device* device = getDevice(deviceId);
481 return device ? device->classes : 0;
485 Device* device = getDevice(deviceId);
486 return device ? device->name : String8("unknown");
491 Device* device = getDevice(deviceId);
492 if (device) {
493 ssize_t index = device->axes.indexOfKey(axis);
495 *outAxisInfo = device->axes.valueAt(index);
504 Device* device = getDevice(deviceId);
505 if (device) {
506 ssize_t index = device->keys.indexOfKey(scancode);
509 *outKeycode = device->keys.valueAt(index).keyCode;
512 *outFlags = device->keys.valueAt(index).flags;
535 Device* device = getDevice(deviceId);
536 if (device) {
537 ssize_t index = device->scanCodeStates.indexOfKey(scanCode);
539 return device->scanCodeStates.valueAt(index);
546 Device* device = getDevice(deviceId);
547 if (device) {
548 ssize_t index = device->keyCodeStates.indexOfKey(keyCode);
550 return device->keyCodeStates.valueAt(index);
557 Device* device = getDevice(deviceId);
558 if (device) {
559 ssize_t index = device->switchStates.indexOfKey(sw);
561 return device->switchStates.valueAt(index);
570 Device* device = getDevice(deviceId);
571 if (device) {
573 for (size_t j = 0; j < device->keys.size(); j++) {
574 if (keyCodes[i] == device->keys.valueAt(j).keyCode) {
643 InputDevice* device, int32_t keyCode, int32_t scanCode) {
666 FakeInputMapper(InputDevice* device, uint32_t sources) :
667 InputMapper(device),
799 void setNextDevice(InputDevice* device) {
800 mNextDevice = device;
806 InputDevice* device = mNextDevice;
808 return device;
852 InputDevice* device = new InputDevice(mReader.get(), deviceId, name);
853 FakeInputMapper* mapper = new FakeInputMapper(device, sources);
854 device->addMapper(mapper);
855 mReader->setNextDevice(device);
941 addDevice(1, String8("ignored"), 0); // no classes so device will be ignored
971 << "Should return unknown when the device id is >= 0 but unknown.";
975 << "Should return unknown when the device id is valid but the sources are not supported by the device.";
979 << "Should return value provided by mapper when device id is valid and the device supports some of the sources.";
983 << "Should return unknown when the device id is < 0 but the sources are not supported by any device.";
987 << "Should return value provided by mapper when device id is < 0 and one of the devices supports some of the sources.";
998 << "Should return unknown when the device id is >= 0 but unknown.";
1002 << "Should return unknown when the device id is valid but the sources are not supported by the device.";
1006 << "Should return value provided by mapper when device id is valid and the device supports some of the sources.";
1010 << "Should return unknown when the device id is < 0 but the sources are not supported by any device.";
1014 << "Should return value provided by mapper when device id is < 0 and one of the devices supports some of the sources.";
1025 << "Should return unknown when the device id is >= 0 but unknown.";
1029 << "Should return unknown when the device id is valid but the sources are not supported by the device.";
1033 << "Should return value provided by mapper when device id is valid and the device supports some of the sources.";
1037 << "Should return unknown when the device id is < 0 but the sources are not supported by any device.";
1041 << "Should return value provided by mapper when device id is < 0 and one of the devices supports some of the sources.";
1055 << "Should return false when device id is >= 0 but unknown.";
1060 << "Should return false when device id is valid but the sources are not supported by the device.";
1065 << "Should return value provided by mapper when device id is valid and the device supports some of the sources.";
1070 << "Should return false when the device id is < 0 but the sources are not supported by any device.";
1075 << "Should return value provided by mapper when device id is < 0 and one of the devices supports some of the sources.";
1141 const char* InputDeviceTest::DEVICE_NAME = "device";
1168 << "Ignored device should return unknown key code state.";
1170 << "Ignored device should return unknown scan code state.";
1172 << "Ignored device should return unknown switch state.";
1177 << "Ignored device should never mark any key codes.";
1211 << "Device should have read calibration during configuration phase.";
1357 const char* InputMapperTest::DEVICE_NAME = "device";
2222 // with up and this will only happen if a device is forcibly removed.
2661 // These calculations are based on the input device calibration documentation.
3204 // These calculations are based on the input device calibration documentation.
3251 // These calculations are based on the input device calibration documentation.
3298 // These calculations are based on the input device calibration documentation.
3299 // Note: We only provide a single common touch/tool value because the device is assumed
3355 // These calculations are based on the input device calibration documentation.