Home | History | Annotate | Download | only in tests

Lines Matching refs:Device

304     struct Device {
319 Device(uint32_t classes) :
324 KeyedVector<int32_t, Device*> mDevices;
339 Device* device = new Device(classes);
340 device->identifier.name = name;
341 mDevices.add(deviceId, device);
358 Device* device = getDevice(deviceId);
359 device->configuration.addProperty(key, value);
363 Device* device = getDevice(deviceId);
364 device->configuration.addAll(configuration);
369 Device* device = getDevice(deviceId);
378 device->absoluteAxes.add(axis, info);
382 Device* device = getDevice(deviceId);
383 device->relativeAxes.add(axis, true);
387 Device* device = getDevice(deviceId);
388 device->keyCodeStates.replaceValueFor(keyCode, state);
392 Device* device = getDevice(deviceId);
393 device->scanCodeStates.replaceValueFor(scanCode, state);
397 Device* device = getDevice(deviceId);
398 device->switchStates.replaceValueFor(switchCode, state);
402 Device* device = getDevice(deviceId);
403 device->absoluteAxisValue.replaceValueFor(axis, value);
408 Device* device = getDevice(deviceId);
413 device->keysByScanCode.add(scanCode, info);
416 device->keysByUsageCode.add(usageCode, info);
421 Device* device = getDevice(deviceId);
422 device->leds.add(led, initialState);
426 Device* device = getDevice(deviceId);
427 return device->leds.valueFor(led);
435 Device* device = getDevice(deviceId);
436 device->virtualKeys.push(definition);
460 Device* getDevice(int32_t deviceId) const {
466 Device* device = getDevice(deviceId);
467 return device ? device->classes : 0;
471 Device* device = getDevice(deviceId);
472 return device ? device->identifier : InputDeviceIdentifier();
480 Device* device = getDevice(deviceId);
481 if (device) {
482 *outConfiguration = device->configuration;
488 Device* device = getDevice(deviceId);
489 if (device) {
490 ssize_t index = device->absoluteAxes.indexOfKey(axis);
492 *outAxisInfo = device->absoluteAxes.valueAt(index);
501 Device* device = getDevice(deviceId);
502 if (device) {
503 return device->relativeAxes.indexOfKey(axis) >= 0;
514 Device* device = getDevice(deviceId);
515 if (device) {
516 const KeyInfo* key = getKey(device, scanCode, usageCode);
530 const KeyInfo* getKey(Device* device, int32_t scanCode, int32_t usageCode) const {
532 ssize_t index = device->keysByUsageCode.indexOfKey(usageCode);
534 return &device->keysByUsageCode.valueAt(index);
538 ssize_t index = device->keysByScanCode.indexOfKey(scanCode);
540 return &device->keysByScanCode.valueAt(index);
566 Device* device = getDevice(deviceId);
567 if (device) {
568 ssize_t index = device->scanCodeStates.indexOfKey(scanCode);
570 return device->scanCodeStates.valueAt(index);
577 Device* device = getDevice(deviceId);
578 if (device) {
579 ssize_t index = device->keyCodeStates.indexOfKey(keyCode);
581 return device->keyCodeStates.valueAt(index);
588 Device* device = getDevice(deviceId);
589 if (device) {
590 ssize_t index = device->switchStates.indexOfKey(sw);
592 return device->switchStates.valueAt(index);
600 Device* device = getDevice(deviceId);
601 if (device) {
602 ssize_t index = device->absoluteAxisValue.indexOfKey(axis);
604 *outValue = device->absoluteAxisValue.valueAt(index);
615 Device* device = getDevice(deviceId);
616 if (device) {
618 for (size_t j = 0; j < device->keysByScanCode.size(); j++) {
619 if (keyCodes[i] == device->keysByScanCode.valueAt(j).keyCode) {
624 for (size_t j = 0; j < device->keysByUsageCode.size(); j++) {
625 if (keyCodes[i] == device->keysByUsageCode.valueAt(j).keyCode) {
636 Device* device = getDevice(deviceId);
637 if (device) {
638 ssize_t index = device->keysByScanCode.indexOfKey(scanCode);
645 Device* device = getDevice(deviceId);
646 return device && device->leds.indexOfKey(led) >= 0;
650 Device* device = getDevice(deviceId);
651 if (device) {
652 ssize_t index = device->leds.indexOfKey(led);
654 device->leds.replaceValueAt(led, on);
667 Device* device = getDevice(deviceId);
668 if (device) {
669 outVirtualKeys.appendVector(device->virtualKeys);
760 InputDevice* device, int32_t keyCode, int32_t scanCode) {
793 FakeInputMapper(InputDevice* device, uint32_t sources) :
794 InputMapper(device),
931 void setNextDevice(InputDevice* device) {
932 mNextDevice = device;
948 InputDevice* device = mNextDevice;
950 return device;
1000 InputDevice* device = mReader->newDevice(deviceId, controllerNumber, name, classes);
1001 FakeInputMapper* mapper = new FakeInputMapper(device, sources);
1002 device->addMapper(mapper);
1003 mReader->setNextDevice(device);
1013 0, NULL)); // no classes so device will be ignored
1043 << "Should return unknown when the device id is >= 0 but unknown.";
1047 device id is valid but the sources are not supported by the device.";
1051 << "Should return value provided by mapper when device id is valid and the device supports some of the sources.";
1055 << "Should return unknown when the device id is < 0 but the sources are not supported by any device.";
1059 << "Should return value provided by mapper when device id is < 0 and one of the devices supports some of the sources.";
1070 << "Should return unknown when the device id is >= 0 but unknown.";
1074 << "Should return unknown when the device id is valid but the sources are not supported by the device.";
1078 << "Should return value provided by mapper when device id is valid and the device supports some of the sources.";
1082 << "Should return unknown when the device id is < 0 but the sources are not supported by any device.";
1086 << "Should return value provided by mapper when device id is < 0 and one of the devices supports some of the sources.";
1097 << "Should return unknown when the device id is >= 0 but unknown.";
1101 << "Should return unknown when the device id is valid but the sources are not supported by the device.";
1105 << "Should return value provided by mapper when device id is valid and the device supports some of the sources.";
1109 << "Should return unknown when the device id is < 0 but the sources are not supported by any device.";
1113 << "Should return value provided by mapper when device id is < 0 and one of the devices supports some of the sources.";
1127 << "Should return false when device id is >= 0 but unknown.";
1132 << "Should return false when device id is valid but the sources are not supported by the device.";
1137 << "Should return value provided by mapper when device id is valid and the device supports some of the sources.";
1142 << "Should return false when the device id is < 0 but the sources are not supported by any device.";
1147 << "Should return value provided by mapper when device id is < 0 and one of the devices supports some of the sources.";
1219 const char* InputDeviceTest::DEVICE_NAME = "device";
1260 << "Ignored device should return unknown key code state.";
1262 << "Ignored device should return unknown scan code state.";
1264 << "Ignored device should return unknown switch state.";
1269 << "Ignored device should never mark any key codes.";
1299 << "Device should have read configuration during configuration phase.";
1470 const char* InputMapperTest::DEVICE_NAME = "device";
3192 // These calculations are based on the input device calibration documentation.
4445 // These calculations are based on the input device calibration documentation.
4496 // These calculations are based on the input device calibration documentation.
4537 // These calculations are based on the input device calibration documentation.
4538 // Note: We only provide a single common touch/tool value because the device is assumed
4589 // These calculations are based on the input device calibration documentation.
4622 // These calculations are based on the input device calibration documentation.