summaryrefslogtreecommitdiff
path: root/services/input/EventHub.cpp
diff options
context:
space:
mode:
author Jeff Brown <jeffbrown@google.com> 2011-11-15 19:17:09 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2011-11-15 19:17:09 -0800
commit3e7497b4eccd3db1d6ff0ce1f1f2db11f9a8eeef (patch)
tree14b19d7f750f12c4168bb582c1cd99e93afd454a /services/input/EventHub.cpp
parentcdec187a27b2acc34cd4df26b836b83362527d6a (diff)
parent1e08fe90df18930691b0c2ec22e5db25d7fcb4cf (diff)
Merge "Eliminate hw.keyboards system properties." into ics-mr1
Diffstat (limited to 'services/input/EventHub.cpp')
-rw-r--r--services/input/EventHub.cpp26
1 files changed, 9 insertions, 17 deletions
diff --git a/services/input/EventHub.cpp b/services/input/EventHub.cpp
index 790b395c7b41..52897417596c 100644
--- a/services/input/EventHub.cpp
+++ b/services/input/EventHub.cpp
@@ -507,6 +507,15 @@ void EventHub::getVirtualKeyDefinitions(int32_t deviceId,
}
}
+String8 EventHub::getKeyCharacterMapFile(int32_t deviceId) const {
+ AutoMutex _l(mLock);
+ Device* device = getDeviceLocked(deviceId);
+ if (device) {
+ return device->keyMap.keyCharacterMapFile;
+ }
+ return String8();
+}
+
EventHub::Device* EventHub::getDeviceLocked(int32_t deviceId) const {
if (deviceId == 0) {
deviceId = mBuiltInKeyboardId;
@@ -1013,16 +1022,12 @@ status_t EventHub::openDeviceLocked(const char *devicePath) {
// Configure the keyboard, gamepad or virtual keyboard.
if (device->classes & INPUT_DEVICE_CLASS_KEYBOARD) {
- // Set system properties for the keyboard.
- setKeyboardPropertiesLocked(device, false);
-
// Register the keyboard as a built-in keyboard if it is eligible.
if (!keyMapStatus
&& mBuiltInKeyboardId == -1
&& isEligibleBuiltInKeyboard(device->identifier,
device->configuration, &device->keyMap)) {
mBuiltInKeyboardId = device->id;
- setKeyboardPropertiesLocked(device, true);
}
// 'Q' key support = cheap test of whether this is an alpha-capable kbd
@@ -1120,17 +1125,6 @@ status_t EventHub::loadKeyMapLocked(Device* device) {
return device->keyMap.load(device->identifier, device->configuration);
}
-void EventHub::setKeyboardPropertiesLocked(Device* device, bool builtInKeyboard) {
- int32_t id = builtInKeyboard ? 0 : device->id;
- android::setKeyboardProperties(id, device->identifier,
- device->keyMap.keyLayoutFile, device->keyMap.keyCharacterMapFile);
-}
-
-void EventHub::clearKeyboardPropertiesLocked(Device* device, bool builtInKeyboard) {
- int32_t id = builtInKeyboard ? 0 : device->id;
- android::clearKeyboardProperties(id);
-}
-
bool EventHub::isExternalDeviceLocked(Device* device) {
if (device->configuration) {
bool value;
@@ -1184,9 +1178,7 @@ void EventHub::closeDeviceLocked(Device* device) {
LOGW("built-in keyboard device %s (id=%d) is closing! the apps will not like this",
device->path.string(), mBuiltInKeyboardId);
mBuiltInKeyboardId = -1;
- clearKeyboardPropertiesLocked(device, true);
}
- clearKeyboardPropertiesLocked(device, false);
if (epoll_ctl(mEpollFd, EPOLL_CTL_DEL, device->fd, NULL)) {
LOGW("Could not remove device fd from epoll instance. errno=%d", errno);