diff options
author | Jeff Brown <jeffbrown@google.com> | 2012-05-01 15:54:03 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2012-05-01 16:34:20 -0700 |
commit | daa3753a04699724d2cfe824ac1f5a266d643a05 (patch) | |
tree | ddc33d395dd0f3d01a95775397356983fb28a076 /services/jni | |
parent | 32c8113510b2774f865e8ac763976b90d9db2706 (diff) | |
download | frameworks_base-daa3753a04699724d2cfe824ac1f5a266d643a05.zip frameworks_base-daa3753a04699724d2cfe824ac1f5a266d643a05.tar.gz frameworks_base-daa3753a04699724d2cfe824ac1f5a266d643a05.tar.bz2 |
Improve handling of built-in keyboard.
The window manager policy made some incorrect assumptions about the
meaning of the Configuration.keyboard field. We need to be more
careful about distinguishing between built-in and external keyboards.
Most of this change is to move the determination of the parts of
the Configuration related to input devices into the WindowManagerService
leveraging new features of the InputManagerService to good effect.
Then we plumb through the flag that indicates whether a device
is internal or external so that we can be more particular about
how the lid switch effects changes to the Configuration.
Bug: 6424373
Change-Id: I36a1c22ade35e578955465a25940a33f227b9763
Diffstat (limited to 'services/jni')
-rw-r--r-- | services/jni/com_android_server_input_InputManagerService.cpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/services/jni/com_android_server_input_InputManagerService.cpp b/services/jni/com_android_server_input_InputManagerService.cpp index b2a2429..b6378bf 100644 --- a/services/jni/com_android_server_input_InputManagerService.cpp +++ b/services/jni/com_android_server_input_InputManagerService.cpp @@ -98,12 +98,6 @@ static struct { jclass clazz; } gMotionEventClassInfo; -static struct { - jfieldID touchscreen; - jfieldID keyboard; - jfieldID navigation; -} gConfigurationClassInfo; - // --- Global functions --- @@ -1228,18 +1222,6 @@ static void nativeSetSystemUiVisibility(JNIEnv* env, im->setSystemUiVisibility(visibility); } -static void nativeGetInputConfiguration(JNIEnv* env, - jclass clazz, jint ptr, jobject configObj) { - NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); - - InputConfiguration config; - im->getInputManager()->getReader()->getInputConfiguration(& config); - - env->SetIntField(configObj, gConfigurationClassInfo.touchscreen, config.touchScreen); - env->SetIntField(configObj, gConfigurationClassInfo.keyboard, config.keyboard); - env->SetIntField(configObj, gConfigurationClassInfo.navigation, config.navigation); -} - static jboolean nativeTransferTouchFocus(JNIEnv* env, jclass clazz, jint ptr, jobject fromChannelObj, jobject toChannelObj) { NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); @@ -1372,8 +1354,6 @@ static JNINativeMethod gInputManagerMethods[] = { (void*) nativeSetInputDispatchMode }, { "nativeSetSystemUiVisibility", "(II)V", (void*) nativeSetSystemUiVisibility }, - { "nativeGetInputConfiguration", "(ILandroid/content/res/Configuration;)V", - (void*) nativeGetInputConfiguration }, { "nativeTransferTouchFocus", "(ILandroid/view/InputChannel;Landroid/view/InputChannel;)Z", (void*) nativeTransferTouchFocus }, { "nativeSetPointerSpeed", "(II)V", @@ -1504,19 +1484,6 @@ int register_android_server_InputManager(JNIEnv* env) { FIND_CLASS(gMotionEventClassInfo.clazz, "android/view/MotionEvent"); gMotionEventClassInfo.clazz = jclass(env->NewGlobalRef(gMotionEventClassInfo.clazz)); - // Configuration - - FIND_CLASS(clazz, "android/content/res/Configuration"); - - GET_FIELD_ID(gConfigurationClassInfo.touchscreen, clazz, - "touchscreen", "I"); - - GET_FIELD_ID(gConfigurationClassInfo.keyboard, clazz, - "keyboard", "I"); - - GET_FIELD_ID(gConfigurationClassInfo.navigation, clazz, - "navigation", "I"); - return 0; } |