From 5c2dac59beb442797dd6a29456068421f9c739bb Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:17 +0100 Subject: ANDROID: Make GPL headers consistent in themselves. --- backends/platform/android/android.cpp | 6 +++--- backends/platform/android/android.h | 6 +++--- backends/platform/android/asset-archive.cpp | 4 ++-- backends/platform/android/asset-archive.h | 4 ++-- backends/platform/android/events.cpp | 6 +++--- backends/platform/android/gfx.cpp | 6 +++--- backends/platform/android/jni.cpp | 6 +++--- backends/platform/android/jni.h | 6 +++--- backends/platform/android/texture.cpp | 6 +++--- backends/platform/android/texture.h | 4 ++-- 10 files changed, 27 insertions(+), 27 deletions(-) (limited to 'backends/platform/android') diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp index 5e3d1d0db6..3ff1b939ef 100644 --- a/backends/platform/android/android.cpp +++ b/backends/platform/android/android.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h index 704ce12f60..28016f5e3e 100644 --- a/backends/platform/android/android.h +++ b/backends/platform/android/android.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/platform/android/asset-archive.cpp b/backends/platform/android/asset-archive.cpp index da378fb082..52c2c084bd 100644 --- a/backends/platform/android/asset-archive.cpp +++ b/backends/platform/android/asset-archive.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/platform/android/asset-archive.h b/backends/platform/android/asset-archive.h index c5e43555e0..6a0033d24e 100644 --- a/backends/platform/android/asset-archive.h +++ b/backends/platform/android/asset-archive.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/platform/android/events.cpp b/backends/platform/android/events.cpp index 5c42db9347..c60626ec36 100644 --- a/backends/platform/android/events.cpp +++ b/backends/platform/android/events.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp index 9f6c759c75..92293493f0 100644 --- a/backends/platform/android/gfx.cpp +++ b/backends/platform/android/gfx.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/platform/android/jni.cpp b/backends/platform/android/jni.cpp index 2b738dd63f..764c84ce1c 100644 --- a/backends/platform/android/jni.cpp +++ b/backends/platform/android/jni.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/platform/android/jni.h b/backends/platform/android/jni.h index 52698e0f35..326869b1ee 100644 --- a/backends/platform/android/jni.h +++ b/backends/platform/android/jni.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp index 87fd2d976c..165396b82b 100644 --- a/backends/platform/android/texture.cpp +++ b/backends/platform/android/texture.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/platform/android/texture.h b/backends/platform/android/texture.h index 67f7343c98..4b05dfd5d4 100644 --- a/backends/platform/android/texture.h +++ b/backends/platform/android/texture.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- cgit v1.2.3 From 0def54a60d8a5c6e63bb5db238bbadf388dede97 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Fri, 21 Feb 2014 16:29:23 +0000 Subject: ANDROID: Fix runtime failure on earlier versions of Android. getAxisValue() is only present from Android 3.1 onwards and usage causes a runtime failure on earlier versions of Android. This bug was introduced by a50ede20 with addition of OUYA support. This solution is as recommended on the Android developer portal. --- .../android/org/scummvm/scummvm/ScummVMEvents.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'backends/platform/android') diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java index 702215341b..eef5d1911b 100644 --- a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java +++ b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java @@ -1,5 +1,6 @@ package org.scummvm.scummvm; +import android.os.Build; import android.os.Handler; import android.os.Message; import android.content.Context; @@ -69,13 +70,16 @@ public class ScummVMEvents implements } public boolean onGenericMotionEvent(final MotionEvent e) { - if((e.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) { - _scummvm.pushEvent(JE_JOYSTICK, e.getAction(), - (int)(e.getAxisValue(MotionEvent.AXIS_X)*100), - (int)(e.getAxisValue(MotionEvent.AXIS_Y)*100), - 0, 0); - return true; - } + // Make sure we're running on Android 3.1 or higher to use getAxisValue() + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) { + if((e.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) { + _scummvm.pushEvent(JE_JOYSTICK, e.getAction(), + (int)(e.getAxisValue(MotionEvent.AXIS_X)*100), + (int)(e.getAxisValue(MotionEvent.AXIS_Y)*100), + 0, 0); + return true; + } + } return false; } -- cgit v1.2.3 From d6a90f610f241b59e63b65088a2acfdd359b1d6d Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 22 Feb 2014 19:47:15 +0100 Subject: ANDROID: Slight formatting fix. --- backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'backends/platform/android') diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java index eef5d1911b..a96bc566eb 100644 --- a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java +++ b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java @@ -70,8 +70,8 @@ public class ScummVMEvents implements } public boolean onGenericMotionEvent(final MotionEvent e) { - // Make sure we're running on Android 3.1 or higher to use getAxisValue() - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) { + // Make sure we're running on Android 3.1 or higher to use getAxisValue() + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) { if((e.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) { _scummvm.pushEvent(JE_JOYSTICK, e.getAction(), (int)(e.getAxisValue(MotionEvent.AXIS_X)*100), @@ -79,7 +79,7 @@ public class ScummVMEvents implements 0, 0); return true; } - } + } return false; } -- cgit v1.2.3 From cbf085287c74e0994fb18fb0830ccdb340b5b0ac Mon Sep 17 00:00:00 2001 From: D G Turner Date: Wed, 26 Feb 2014 15:26:12 +0000 Subject: ANDROID: Fix Android pre3.1 compatibility. This was broken by a50ede203b0424d800d2a1d4460121f9f1de8e7a. --- backends/platform/android/android.mk | 1 + .../org/scummvm/scummvm/ScummVMActivity.java | 10 ++++++++- .../android/org/scummvm/scummvm/ScummVMEvents.java | 14 +----------- .../scummvm/scummvm/ScummVMEventsHoneycomb.java | 25 ++++++++++++++++++++++ 4 files changed, 36 insertions(+), 14 deletions(-) create mode 100644 backends/platform/android/org/scummvm/scummvm/ScummVMEventsHoneycomb.java (limited to 'backends/platform/android') diff --git a/backends/platform/android/android.mk b/backends/platform/android/android.mk index 915bf8ac60..7c4fe01d54 100644 --- a/backends/platform/android/android.mk +++ b/backends/platform/android/android.mk @@ -7,6 +7,7 @@ ANDROID_PLUGIN_VERSIONCODE = 6 JAVA_FILES = \ ScummVM.java \ ScummVMEvents.java \ + ScummVMEventsHoneycomb.java \ ScummVMApplication.java \ ScummVMActivity.java \ EditableSurfaceView.java \ diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java index 5d041dafd2..5964d5bfde 100644 --- a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java +++ b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java @@ -4,6 +4,7 @@ import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.media.AudioManager; +import android.os.Build; import android.os.Bundle; import android.os.Environment; import android.util.DisplayMetrics; @@ -169,7 +170,14 @@ public class ScummVMActivity extends Activity { _mouseHelper.attach(main_surface); } - _events = new ScummVMEvents(this, _scummvm, _mouseHelper); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB_MR1) + { + _events = new ScummVMEvents(this, _scummvm, _mouseHelper); + } + else + { + _events = new ScummVMEventsHoneycomb(this, _scummvm, _mouseHelper); + } main_surface.setOnKeyListener(_events); main_surface.setOnTouchListener(_events); diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java index a96bc566eb..32c65d3395 100644 --- a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java +++ b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java @@ -1,6 +1,5 @@ package org.scummvm.scummvm; -import android.os.Build; import android.os.Handler; import android.os.Message; import android.content.Context; @@ -69,18 +68,7 @@ public class ScummVMEvents implements return true; } - public boolean onGenericMotionEvent(final MotionEvent e) { - // Make sure we're running on Android 3.1 or higher to use getAxisValue() - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) { - if((e.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) { - _scummvm.pushEvent(JE_JOYSTICK, e.getAction(), - (int)(e.getAxisValue(MotionEvent.AXIS_X)*100), - (int)(e.getAxisValue(MotionEvent.AXIS_Y)*100), - 0, 0); - return true; - } - } - + public boolean onGenericMotionEvent(MotionEvent e) { return false; } diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMEventsHoneycomb.java b/backends/platform/android/org/scummvm/scummvm/ScummVMEventsHoneycomb.java new file mode 100644 index 0000000000..ab85429040 --- /dev/null +++ b/backends/platform/android/org/scummvm/scummvm/ScummVMEventsHoneycomb.java @@ -0,0 +1,25 @@ +package org.scummvm.scummvm; + +import android.content.Context; +import android.view.MotionEvent; +import android.view.InputDevice; + +public class ScummVMEventsHoneycomb extends ScummVMEvents { + + public ScummVMEventsHoneycomb(Context context, ScummVM scummvm, MouseHelper mouseHelper) { + super(context, scummvm, mouseHelper); + } + + @Override + public boolean onGenericMotionEvent(MotionEvent e) { + if((e.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) { + _scummvm.pushEvent(JE_JOYSTICK, e.getAction(), + (int)(e.getAxisValue(MotionEvent.AXIS_X)*100), + (int)(e.getAxisValue(MotionEvent.AXIS_Y)*100), + 0, 0); + return true; + } + + return false; + } +} -- cgit v1.2.3