From fda8d9344036a18cc9c330eed536350953d0340a Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Sun, 10 Nov 2013 14:58:48 +0100 Subject: [PATCH] Moved two function calls so they are only called if needed. If the MotionEvent is not from joystick the return values are not needed. --- android-project/src/org/libsdl/app/SDLActivity.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/android-project/src/org/libsdl/app/SDLActivity.java b/android-project/src/org/libsdl/app/SDLActivity.java index 773ec43bc..426dd971f 100644 --- a/android-project/src/org/libsdl/app/SDLActivity.java +++ b/android-project/src/org/libsdl/app/SDLActivity.java @@ -890,10 +890,9 @@ class SDLGenericMotionHandler_API12 extends Activity implements View.OnGenericMo // We only have joysticks yet @Override public boolean onGenericMotion(View v, MotionEvent event) { - int actionPointerIndex = event.getActionIndex(); - int action = event.getActionMasked(); - if ( (event.getSource() & InputDevice.SOURCE_JOYSTICK) != 0) { + int actionPointerIndex = event.getActionIndex(); + int action = event.getActionMasked(); switch(action) { case MotionEvent.ACTION_MOVE: int id = SDLActivity.getJoyId( event.getDeviceId() ); @@ -906,4 +905,4 @@ class SDLGenericMotionHandler_API12 extends Activity implements View.OnGenericMo } return true; } -} \ No newline at end of file +}