summaryrefslogtreecommitdiffstats
path: root/services/jni
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2010-11-29 17:37:49 -0800
committerJeff Brown <jeffbrown@google.com>2010-11-30 17:15:49 -0800
commit47e6b1b5eef8ee99872f278f66bc498c4fcca0d8 (patch)
treeef5a7c87b8dca433ea9707c1289ae7c8d2ba3787 /services/jni
parent735206f121cb2a11b3397870e6565178627e0aa3 (diff)
downloadframeworks_base-47e6b1b5eef8ee99872f278f66bc498c4fcca0d8.zip
frameworks_base-47e6b1b5eef8ee99872f278f66bc498c4fcca0d8.tar.gz
frameworks_base-47e6b1b5eef8ee99872f278f66bc498c4fcca0d8.tar.bz2
Support non-orientation aware keyboards and other devices.
Fixed a bug with dpad keys on external keyboards being rotated according to the display orientation by adding a new input device configuration property called "keyboard.orientationAware". Added a mechanism for overriding the key layout and key character map in the input device configuration file using the new "keyboard.layout" and "keyboard.characterMap" properties. Also added "trackball.orientationAware", "touch.orientationAware" and "touch.deviceType" configuration properties. Rewrote the configuration property reading code in native code so that it can be used by EventHub and other components. Added basic support for installable idc, kl, and kcm files in /data/system/devices. However, there is no provision for copying files there yet. Disabled long-press character pickers on full keyboards so that key repeating works as expected. Change-Id: I1bd9f0c3d344421db444e7d271eb09bc8bab4791
Diffstat (limited to 'services/jni')
-rw-r--r--services/jni/com_android_server_InputManager.cpp67
1 files changed, 0 insertions, 67 deletions
diff --git a/services/jni/com_android_server_InputManager.cpp b/services/jni/com_android_server_InputManager.cpp
index 3fd6965..d0760c0 100644
--- a/services/jni/com_android_server_InputManager.cpp
+++ b/services/jni/com_android_server_InputManager.cpp
@@ -57,7 +57,6 @@ static struct {
jmethodID filterTouchEvents;
jmethodID filterJumpyTouchEvents;
jmethodID getVirtualKeyDefinitions;
- jmethodID getInputDeviceCalibration;
jmethodID getExcludedDeviceNames;
jmethodID getMaxEventsPerSecond;
} gCallbacksClassInfo;
@@ -75,13 +74,6 @@ static struct {
static struct {
jclass clazz;
- jfieldID keys;
- jfieldID values;
-} gInputDeviceCalibrationClassInfo;
-
-static struct {
- jclass clazz;
-
jfieldID inputChannel;
jfieldID name;
jfieldID layoutParamsFlags;
@@ -186,8 +178,6 @@ public:
virtual bool filterJumpyTouchEvents();
virtual void getVirtualKeyDefinitions(const String8& deviceName,
Vector<VirtualKeyDefinition>& outVirtualKeyDefinitions);
- virtual void getInputDeviceCalibration(const String8& deviceName,
- InputDeviceCalibration& outCalibration);
virtual void getExcludedDeviceNames(Vector<String8>& outExcludedDeviceNames);
/* --- InputDispatcherPolicyInterface implementation --- */
@@ -489,48 +479,6 @@ void NativeInputManager::getVirtualKeyDefinitions(const String8& deviceName,
}
}
-void NativeInputManager::getInputDeviceCalibration(const String8& deviceName,
- InputDeviceCalibration& outCalibration) {
- outCalibration.clear();
-
- JNIEnv* env = jniEnv();
-
- jstring deviceNameStr = env->NewStringUTF(deviceName.string());
- if (! checkAndClearExceptionFromCallback(env, "getInputDeviceCalibration")) {
- jobject result = env->CallObjectMethod(mCallbacksObj,
- gCallbacksClassInfo.getInputDeviceCalibration, deviceNameStr);
- if (! checkAndClearExceptionFromCallback(env, "getInputDeviceCalibration") && result) {
- jobjectArray keys = jobjectArray(env->GetObjectField(result,
- gInputDeviceCalibrationClassInfo.keys));
- jobjectArray values = jobjectArray(env->GetObjectField(result,
- gInputDeviceCalibrationClassInfo.values));
-
- jsize length = env->GetArrayLength(keys);
- for (jsize i = 0; i < length; i++) {
- jstring keyStr = jstring(env->GetObjectArrayElement(keys, i));
- jstring valueStr = jstring(env->GetObjectArrayElement(values, i));
-
- const char* keyChars = env->GetStringUTFChars(keyStr, NULL);
- String8 key(keyChars);
- env->ReleaseStringUTFChars(keyStr, keyChars);
-
- const char* valueChars = env->GetStringUTFChars(valueStr, NULL);
- String8 value(valueChars);
- env->ReleaseStringUTFChars(valueStr, valueChars);
-
- outCalibration.addProperty(key, value);
-
- env->DeleteLocalRef(keyStr);
- env->DeleteLocalRef(valueStr);
- }
- env->DeleteLocalRef(keys);
- env->DeleteLocalRef(values);
- env->DeleteLocalRef(result);
- }
- env->DeleteLocalRef(deviceNameStr);
- }
-}
-
void NativeInputManager::getExcludedDeviceNames(Vector<String8>& outExcludedDeviceNames) {
outExcludedDeviceNames.clear();
@@ -1405,10 +1353,6 @@ int register_android_server_InputManager(JNIEnv* env) {
"getVirtualKeyDefinitions",
"(Ljava/lang/String;)[Lcom/android/server/InputManager$VirtualKeyDefinition;");
- GET_METHOD_ID(gCallbacksClassInfo.getInputDeviceCalibration, gCallbacksClassInfo.clazz,
- "getInputDeviceCalibration",
- "(Ljava/lang/String;)Lcom/android/server/InputManager$InputDeviceCalibration;");
-
GET_METHOD_ID(gCallbacksClassInfo.getExcludedDeviceNames, gCallbacksClassInfo.clazz,
"getExcludedDeviceNames", "()[Ljava/lang/String;");
@@ -1435,17 +1379,6 @@ int register_android_server_InputManager(JNIEnv* env) {
GET_FIELD_ID(gVirtualKeyDefinitionClassInfo.height, gVirtualKeyDefinitionClassInfo.clazz,
"height", "I");
- // InputDeviceCalibration
-
- FIND_CLASS(gInputDeviceCalibrationClassInfo.clazz,
- "com/android/server/InputManager$InputDeviceCalibration");
-
- GET_FIELD_ID(gInputDeviceCalibrationClassInfo.keys, gInputDeviceCalibrationClassInfo.clazz,
- "keys", "[Ljava/lang/String;");
-
- GET_FIELD_ID(gInputDeviceCalibrationClassInfo.values, gInputDeviceCalibrationClassInfo.clazz,
- "values", "[Ljava/lang/String;");
-
// InputWindow
FIND_CLASS(gInputWindowClassInfo.clazz, "com/android/server/InputWindow");