Skip to content

Commit 293e61d

Browse files
committed
feat: upgrade sdl2.30.2
1 parent 104eb19 commit 293e61d

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

project/android/app/src/main/java/org/libsdl/app/SDLActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
6161
private static final String TAG = "SDL";
6262
private static final int SDL_MAJOR_VERSION = 2;
6363
private static final int SDL_MINOR_VERSION = 30;
64-
private static final int SDL_MICRO_VERSION = 0;
64+
private static final int SDL_MICRO_VERSION = 2;
6565
/*
6666
// Display InputType.SOURCE/CLASS of events and devices
6767
//

project/android/app/src/main/java/org/libsdl/app/SDLControllerManager.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -546,13 +546,15 @@ public void pollHapticDevices() {
546546
if (haptic == null) {
547547
InputDevice device = InputDevice.getDevice(deviceIds[i]);
548548
Vibrator vib = device.getVibrator();
549-
if (vib.hasVibrator()) {
550-
haptic = new SDLHaptic();
551-
haptic.device_id = deviceIds[i];
552-
haptic.name = device.getName();
553-
haptic.vib = vib;
554-
mHaptics.add(haptic);
555-
SDLControllerManager.nativeAddHaptic(haptic.device_id, haptic.name);
549+
if (vib != null) {
550+
if (vib.hasVibrator()) {
551+
haptic = new SDLHaptic();
552+
haptic.device_id = deviceIds[i];
553+
haptic.name = device.getName();
554+
haptic.vib = vib;
555+
mHaptics.add(haptic);
556+
SDLControllerManager.nativeAddHaptic(haptic.device_id, haptic.name);
557+
}
556558
}
557559
}
558560
}

0 commit comments

Comments
 (0)