From cae4b3ae7e92ee6243dbed83ff2ffcf2c7a78915 Mon Sep 17 00:00:00 2001 From: Prabir Pradhan Date: Tue, 5 Feb 2019 18:51:32 -0800 Subject: Remove EventHub header from include dir Since the EventHub header does not need to be exported, this removes the header from the include directory. This also moves the reserved input device ids from EventHub to input/InputDevice.h. Bug: None Test: None Change-Id: I272878245ee60c85e4539b381a20962ca9236cfd --- services/inputflinger/EventHub.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'services/inputflinger/EventHub.cpp') diff --git a/services/inputflinger/EventHub.cpp b/services/inputflinger/EventHub.cpp index cf9d3c7aa5..c13bac6a12 100644 --- a/services/inputflinger/EventHub.cpp +++ b/services/inputflinger/EventHub.cpp @@ -763,7 +763,7 @@ EventHub::Device* EventHub::getDeviceByDescriptorLocked(const std::string& descr } EventHub::Device* EventHub::getDeviceLocked(int32_t deviceId) const { - if (deviceId == BUILT_IN_KEYBOARD_ID) { + if (deviceId == ReservedInputDeviceId::BUILT_IN_KEYBOARD_ID) { deviceId = mBuiltInKeyboardId; } ssize_t index = mDevices.indexOfKey(deviceId); @@ -835,7 +835,8 @@ size_t EventHub::getEvents(int timeoutMillis, RawEvent* buffer, size_t bufferSiz device->id, device->path.c_str()); mClosingDevices = device->next; event->when = now; - event->deviceId = device->id == mBuiltInKeyboardId ? BUILT_IN_KEYBOARD_ID : device->id; + event->deviceId = (device->id == mBuiltInKeyboardId) ? + ReservedInputDeviceId::BUILT_IN_KEYBOARD_ID : device->id; event->type = DEVICE_REMOVED; event += 1; delete device; @@ -1081,7 +1082,7 @@ void EventHub::scanDevicesLocked() { ALOGE("scan video dir failed for %s", VIDEO_DEVICE_PATH); } } - if (mDevices.indexOfKey(VIRTUAL_KEYBOARD_ID) < 0) { + if (mDevices.indexOfKey(ReservedInputDeviceId::VIRTUAL_KEYBOARD_ID) < 0) { createVirtualKeyboardLocked(); } } @@ -1580,7 +1581,8 @@ void EventHub::createVirtualKeyboardLocked() { identifier.uniqueId = ""; assignDescriptorLocked(identifier); - Device* device = new Device(-1, VIRTUAL_KEYBOARD_ID, "", identifier); + Device* device = new Device(-1, ReservedInputDeviceId::VIRTUAL_KEYBOARD_ID, "", + identifier); device->classes = INPUT_DEVICE_CLASS_KEYBOARD | INPUT_DEVICE_CLASS_ALPHAKEY | INPUT_DEVICE_CLASS_DPAD -- cgit v1.2.3-59-g8ed1b