Loading core/jni/android_view_InputEventReceiver.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -380,8 +380,8 @@ status_t NativeInputEventReceiver::consumeEvents(JNIEnv* env, if (kDebugDispatchCycle) { ALOGD("channel '%s' ~ Received motion event.", getInputChannelName().c_str()); } MotionEvent* motionEvent = static_cast<MotionEvent*>(inputEvent); if ((motionEvent->getAction() & AMOTION_EVENT_ACTION_MOVE) && outConsumedBatch) { const MotionEvent& motionEvent = static_cast<const MotionEvent&>(*inputEvent); if ((motionEvent.getAction() & AMOTION_EVENT_ACTION_MOVE) && outConsumedBatch) { *outConsumedBatch = true; } inputEventObj = android_view_MotionEvent_obtainAsCopy(env, motionEvent); Loading core/jni/android_view_MotionEvent.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ static void android_view_MotionEvent_setNativePtr(JNIEnv* env, jobject eventObj, reinterpret_cast<jlong>(event)); } jobject android_view_MotionEvent_obtainAsCopy(JNIEnv* env, const MotionEvent* event) { jobject android_view_MotionEvent_obtainAsCopy(JNIEnv* env, const MotionEvent& event) { jobject eventObj = env->CallStaticObjectMethod(gMotionEventClassInfo.clazz, gMotionEventClassInfo.obtain); if (env->ExceptionCheck() || !eventObj) { Loading @@ -98,7 +98,7 @@ jobject android_view_MotionEvent_obtainAsCopy(JNIEnv* env, const MotionEvent* ev android_view_MotionEvent_setNativePtr(env, eventObj, destEvent); } destEvent->copyFrom(event, true); destEvent->copyFrom(&event, true); return eventObj; } Loading core/jni/android_view_MotionEvent.h +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ class MotionEvent; /* Obtains an instance of a DVM MotionEvent object as a copy of a native MotionEvent instance. * Returns NULL on error. */ extern jobject android_view_MotionEvent_obtainAsCopy(JNIEnv* env, const MotionEvent* event); extern jobject android_view_MotionEvent_obtainAsCopy(JNIEnv* env, const MotionEvent& event); /* Gets the underlying native MotionEvent instance within a DVM MotionEvent object. * Returns NULL if the event is NULL or if it is uninitialized. */ Loading services/core/jni/com_android_server_input_InputManagerService.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -1191,8 +1191,9 @@ bool NativeInputManager::filterInputEvent(const InputEvent* inputEvent, uint32_t static_cast<const KeyEvent*>(inputEvent)); break; case AINPUT_EVENT_TYPE_MOTION: inputEventObj = android_view_MotionEvent_obtainAsCopy(env, static_cast<const MotionEvent*>(inputEvent)); inputEventObj = android_view_MotionEvent_obtainAsCopy(env, static_cast<const MotionEvent&>(*inputEvent)); break; default: return true; // dispatch the event normally Loading Loading
core/jni/android_view_InputEventReceiver.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -380,8 +380,8 @@ status_t NativeInputEventReceiver::consumeEvents(JNIEnv* env, if (kDebugDispatchCycle) { ALOGD("channel '%s' ~ Received motion event.", getInputChannelName().c_str()); } MotionEvent* motionEvent = static_cast<MotionEvent*>(inputEvent); if ((motionEvent->getAction() & AMOTION_EVENT_ACTION_MOVE) && outConsumedBatch) { const MotionEvent& motionEvent = static_cast<const MotionEvent&>(*inputEvent); if ((motionEvent.getAction() & AMOTION_EVENT_ACTION_MOVE) && outConsumedBatch) { *outConsumedBatch = true; } inputEventObj = android_view_MotionEvent_obtainAsCopy(env, motionEvent); Loading
core/jni/android_view_MotionEvent.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ static void android_view_MotionEvent_setNativePtr(JNIEnv* env, jobject eventObj, reinterpret_cast<jlong>(event)); } jobject android_view_MotionEvent_obtainAsCopy(JNIEnv* env, const MotionEvent* event) { jobject android_view_MotionEvent_obtainAsCopy(JNIEnv* env, const MotionEvent& event) { jobject eventObj = env->CallStaticObjectMethod(gMotionEventClassInfo.clazz, gMotionEventClassInfo.obtain); if (env->ExceptionCheck() || !eventObj) { Loading @@ -98,7 +98,7 @@ jobject android_view_MotionEvent_obtainAsCopy(JNIEnv* env, const MotionEvent* ev android_view_MotionEvent_setNativePtr(env, eventObj, destEvent); } destEvent->copyFrom(event, true); destEvent->copyFrom(&event, true); return eventObj; } Loading
core/jni/android_view_MotionEvent.h +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ class MotionEvent; /* Obtains an instance of a DVM MotionEvent object as a copy of a native MotionEvent instance. * Returns NULL on error. */ extern jobject android_view_MotionEvent_obtainAsCopy(JNIEnv* env, const MotionEvent* event); extern jobject android_view_MotionEvent_obtainAsCopy(JNIEnv* env, const MotionEvent& event); /* Gets the underlying native MotionEvent instance within a DVM MotionEvent object. * Returns NULL if the event is NULL or if it is uninitialized. */ Loading
services/core/jni/com_android_server_input_InputManagerService.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -1191,8 +1191,9 @@ bool NativeInputManager::filterInputEvent(const InputEvent* inputEvent, uint32_t static_cast<const KeyEvent*>(inputEvent)); break; case AINPUT_EVENT_TYPE_MOTION: inputEventObj = android_view_MotionEvent_obtainAsCopy(env, static_cast<const MotionEvent*>(inputEvent)); inputEventObj = android_view_MotionEvent_obtainAsCopy(env, static_cast<const MotionEvent&>(*inputEvent)); break; default: return true; // dispatch the event normally Loading