Commit 311ae829c77df3ba7ac7fefcda39ee46086a0b1b

Sylvain Becker 2020-10-28T14:03:05

Android: keep compatibility with older JDK

diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
index 3e7af8c..e7e5a2a 100644
--- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
+++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
@@ -198,7 +198,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
         mTextEdit = null;
         mLayout = null;
         mClipboardHandler = null;
-        mCursors = new Hashtable<>();
+        mCursors = new Hashtable<Integer, PointerIcon>();
         mLastCursorID = 0;
         mSDLThread = null;
         mIsResumedCalled = false;
@@ -1369,7 +1369,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
         int[] buttonIds = args.getIntArray("buttonIds");
         String[] buttonTexts = args.getStringArray("buttonTexts");
 
-        final SparseArray<Button> mapping = new SparseArray<>();
+        final SparseArray<Button> mapping = new SparseArray<Button>();
 
         LinearLayout buttons = new LinearLayout(this);
         buttons.setOrientation(LinearLayout.HORIZONTAL);
diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java b/android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java
index 5ad172c..05e0f0c 100644
--- a/android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java
+++ b/android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java
@@ -176,7 +176,7 @@ class SDLJoystickHandler_API16 extends SDLJoystickHandler {
 
     public SDLJoystickHandler_API16() {
 
-        mJoysticks = new ArrayList<>();
+        mJoysticks = new ArrayList<SDLJoystick>();
     }
 
     @Override
@@ -192,8 +192,8 @@ class SDLJoystickHandler_API16 extends SDLJoystickHandler {
                     joystick.device_id = device_id;
                     joystick.name = joystickDevice.getName();
                     joystick.desc = getJoystickDescriptor(joystickDevice);
-                    joystick.axes = new ArrayList<>();
-                    joystick.hats = new ArrayList<>();
+                    joystick.axes = new ArrayList<InputDevice.MotionRange>();
+                    joystick.hats = new ArrayList<InputDevice.MotionRange>();
 
                     List<InputDevice.MotionRange> ranges = joystickDevice.getMotionRanges();
                     Collections.sort(ranges, new RangeComparator());
@@ -225,7 +225,7 @@ class SDLJoystickHandler_API16 extends SDLJoystickHandler {
             }
             if (i == deviceIds.length) {
                 if (removedDevices == null) {
-                    removedDevices = new ArrayList<>();
+                    removedDevices = new ArrayList<Integer>();
                 }
                 removedDevices.add(device_id);
             }
@@ -447,7 +447,7 @@ class SDLHapticHandler {
     private final ArrayList<SDLHaptic> mHaptics;
 
     public SDLHapticHandler() {
-        mHaptics = new ArrayList<>();
+        mHaptics = new ArrayList<SDLHaptic>();
     }
 
     public void run(int device_id, float intensity, int length) {
@@ -521,7 +521,7 @@ class SDLHapticHandler {
             if (device_id != deviceId_VIBRATOR_SERVICE || !hasVibratorService) {
                 if (i == deviceIds.length) {
                     if (removedDevices == null) {
-                        removedDevices = new ArrayList<>();
+                        removedDevices = new ArrayList<Integer>();
                     }
                     removedDevices.add(device_id);
                 }