diff options
author | Jeff Brown <jeffbrown@google.com> | 2010-06-17 13:32:45 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-06-17 13:32:45 -0700 |
commit | 4e74ae3d5b27d917ea26d0929015f9fdc64af412 (patch) | |
tree | 228cc5893a99c7def050024be582e53ad644a3d3 /services/jni | |
parent | 733c6f2e9bff13e24dcb468dd05219ec6ea8aa96 (diff) | |
parent | 42bb545a54d89f0ddbb230d7a01ea4210c0f6c00 (diff) | |
download | frameworks_base-4e74ae3d5b27d917ea26d0929015f9fdc64af412.zip frameworks_base-4e74ae3d5b27d917ea26d0929015f9fdc64af412.tar.gz frameworks_base-4e74ae3d5b27d917ea26d0929015f9fdc64af412.tar.bz2 |
am 42bb545a: am 5c225b16: Even more native input dispatch work in progress.
Merge commit '42bb545a54d89f0ddbb230d7a01ea4210c0f6c00'
* commit '42bb545a54d89f0ddbb230d7a01ea4210c0f6c00':
Even more native input dispatch work in progress.
Diffstat (limited to 'services/jni')
-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, |