diff options
author | Jeff Brown <jeffbrown@google.com> | 2010-06-16 01:53:36 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2010-06-17 13:27:16 -0700 |
commit | 5c225b1680e696ae8bbf505a1997d6f720672f74 (patch) | |
tree | 932326fd02ee91d8a64adfcc9415027646c56563 /services/jni/com_android_server_InputManager.cpp | |
parent | 3a0146cd29fae3c5bc29d8d535d67826284f8cc9 (diff) | |
download | frameworks_base-5c225b1680e696ae8bbf505a1997d6f720672f74.zip frameworks_base-5c225b1680e696ae8bbf505a1997d6f720672f74.tar.gz frameworks_base-5c225b1680e696ae8bbf505a1997d6f720672f74.tar.bz2 |
Even more native input dispatch work in progress.
Added more tests.
Fixed a regression in Vector.
Fixed bugs in pointer tracking.
Fixed a starvation issue in PollLoop when setting or removing callbacks.
Fixed a couple of policy nits.
Modified the internal representation of MotionEvent to be more
efficient and more consistent.
Added code to skip/cancel virtual key processing when there are multiple
pointers down. This helps to better disambiguate virtual key presses
from stray touches (such as cheek presses).
Change-Id: I2a7d2cce0195afb9125b23378baa94fd2fc6671c
Diffstat (limited to 'services/jni/com_android_server_InputManager.cpp')
-rw-r--r-- | services/jni/com_android_server_InputManager.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/services/jni/com_android_server_InputManager.cpp b/services/jni/com_android_server_InputManager.cpp index a988a96..ab3922f 100644 --- a/services/jni/com_android_server_InputManager.cpp +++ b/services/jni/com_android_server_InputManager.cpp @@ -294,9 +294,7 @@ int32_t NativeInputManager::interceptKey(nsecs_t when, if (wmActions & WM_ACTION_PASS_TO_USER) { actions |= InputReaderPolicyInterface::ACTION_DISPATCH; - } - if (! (wmActions & WM_ACTION_PASS_TO_USER)) { if (down && isAppSwitchKey(keyCode)) { env->CallVoidMethod(mCallbacksObj, gCallbacksClassInfo.notifyAppSwitchComing); checkExceptionFromCallback(env, "notifyAppSwitchComing"); @@ -312,12 +310,18 @@ int32_t NativeInputManager::interceptTouch(nsecs_t when) { LOGD("interceptTouch - when=%lld", when); #endif - if (! isScreenOn()) { - // Touch events do not wake the device. - return InputReaderPolicyInterface::ACTION_NONE; + int32_t actions = InputReaderPolicyInterface::ACTION_NONE; + if (isScreenOn()) { + // Only dispatch touch events when the device is awake. + actions |= InputReaderPolicyInterface::ACTION_DISPATCH; } - return InputReaderPolicyInterface::ACTION_DISPATCH; + if (! isScreenBright()) { + // Brighten the screen if dimmed. + actions |= InputReaderPolicyInterface::ACTION_BRIGHT_HERE; + } + + return actions; } int32_t NativeInputManager::interceptTrackball(nsecs_t when, @@ -327,12 +331,18 @@ int32_t NativeInputManager::interceptTrackball(nsecs_t when, when, buttonChanged, buttonDown, rolled); #endif - if (! isScreenOn()) { - // Trackball motions and button presses do not wake the device. - return InputReaderPolicyInterface::ACTION_NONE; + int32_t actions = InputReaderPolicyInterface::ACTION_NONE; + if (isScreenOn()) { + // Only dispatch trackball events when the device is awake. + actions |= InputReaderPolicyInterface::ACTION_DISPATCH; } - return InputReaderPolicyInterface::ACTION_DISPATCH; + if (! isScreenBright()) { + // Brighten the screen if dimmed. + actions |= InputReaderPolicyInterface::ACTION_BRIGHT_HERE; + } + + return actions; } int32_t NativeInputManager::interceptSwitch(nsecs_t when, int32_t switchCode, |