diff options
author | Jeff Brown <jeffbrown@google.com> | 2011-03-02 19:23:13 -0800 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2011-03-02 19:57:07 -0800 |
commit | 56194ebec6212e229f4ccdaa4b187166d20013ef (patch) | |
tree | 51276000061ba703b6ddda32ecce3ce10a06f4f5 /core/jni/android_view_MotionEvent.cpp | |
parent | 05dc66ada6b61a6bdf806ffaa62617ac5394695d (diff) | |
download | frameworks_base-56194ebec6212e229f4ccdaa4b187166d20013ef.zip frameworks_base-56194ebec6212e229f4ccdaa4b187166d20013ef.tar.gz frameworks_base-56194ebec6212e229f4ccdaa4b187166d20013ef.tar.bz2 |
Wake screen from external HID peripherals.
Added some plumbing to enable the policy to intercept motion
events when the screen is off to handle wakeup if needed.
Added a basic concept of an external device to limit the scope
of the wakeup policy to external devices only. The wakeup policy
for internal devices should be based on explicit rules such as
policy flags in key layout files.
Moved isTouchEvent to native.
Ensure the dispatcher sends the right event type to userActivity
for non-touch pointer events like HOVER_MOVE and SCROLL.
Bug: 3193114
Change-Id: I15dbd48a16810dfaf226ff7ad117d46908ca4f86
Diffstat (limited to 'core/jni/android_view_MotionEvent.cpp')
-rw-r--r-- | core/jni/android_view_MotionEvent.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/jni/android_view_MotionEvent.cpp b/core/jni/android_view_MotionEvent.cpp index b014006..97cba23 100644 --- a/core/jni/android_view_MotionEvent.cpp +++ b/core/jni/android_view_MotionEvent.cpp @@ -429,6 +429,12 @@ static void android_view_MotionEvent_nativeSetAction(JNIEnv* env, jclass clazz, event->setAction(action); } +static jboolean android_view_MotionEvent_nativeIsTouchEvent(JNIEnv* env, jclass clazz, + jint nativePtr) { + MotionEvent* event = reinterpret_cast<MotionEvent*>(nativePtr); + return event->isTouchEvent(); +} + static jint android_view_MotionEvent_nativeGetFlags(JNIEnv* env, jclass clazz, jint nativePtr) { MotionEvent* event = reinterpret_cast<MotionEvent*>(nativePtr); @@ -661,6 +667,9 @@ static JNINativeMethod gMotionEventMethods[] = { { "nativeSetAction", "(II)V", (void*)android_view_MotionEvent_nativeSetAction }, + { "nativeIsTouchEvent", + "(I)Z", + (void*)android_view_MotionEvent_nativeIsTouchEvent }, { "nativeGetFlags", "(I)I", (void*)android_view_MotionEvent_nativeGetFlags }, |