Browse Source

General Android upgrades

* SDL2 to 2.30.2 bugfix
* Gradle to 8.7
* Android Gradle plugin to 8.3.2

Playtested to my Google Pixel 2, Android 11
pull/7104/head
Oleksandr Kalko 2 years ago committed by Anders Jenbo
parent
commit
1b29ade394
  1. 4
      3rdParty/SDL2/CMakeLists.txt
  2. 6
      android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java
  3. 2
      android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
  4. 16
      android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java
  5. 2
      android-project/build.gradle
  6. 4
      android-project/gradle/wrapper/gradle-wrapper.properties

4
3rdParty/SDL2/CMakeLists.txt vendored

@ -15,7 +15,7 @@ set(SDL_TEST_ENABLED_BY_DEFAULT OFF)
include(functions/FetchContent_MakeAvailableExcludeFromAll)
include(FetchContent)
FetchContent_Declare(SDL2
URL https://github.com/libsdl-org/SDL/releases/download/release-2.30.0/SDL2-2.30.0.tar.gz
URL_HASH SHA256=36e2e41557e0fa4a1519315c0f5958a87ccb27e25c51776beb6f1239526447b0
URL https://github.com/libsdl-org/SDL/releases/download/release-2.30.2/SDL2-2.30.2.tar.gz
URL_HASH SHA256=891d66ac8cae51361d3229e3336ebec1c407a8a2a063b61df14f5fdf3ab5ac31
)
FetchContent_MakeAvailableExcludeFromAll(SDL2)

6
android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java

@ -359,6 +359,12 @@ public class HIDDeviceManager {
private void initializeBluetooth() {
Log.d(TAG, "Initializing Bluetooth");
if (Build.VERSION.SDK_INT >= 31 /* Android 12 */ &&
mContext.getPackageManager().checkPermission(android.Manifest.permission.BLUETOOTH_CONNECT, mContext.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
Log.d(TAG, "Couldn't initialize Bluetooth, missing android.permission.BLUETOOTH_CONNECT");
return;
}
if (Build.VERSION.SDK_INT <= 30 /* Android 11.0 (R) */ &&
mContext.getPackageManager().checkPermission(android.Manifest.permission.BLUETOOTH, mContext.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
Log.d(TAG, "Couldn't initialize Bluetooth, missing android.permission.BLUETOOTH");

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

@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
private static final String TAG = "SDL";
private static final int SDL_MAJOR_VERSION = 2;
private static final int SDL_MINOR_VERSION = 30;
private static final int SDL_MICRO_VERSION = 0;
private static final int SDL_MICRO_VERSION = 2;
/*
// Display InputType.SOURCE/CLASS of events and devices
//

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

@ -546,13 +546,15 @@ class SDLHapticHandler {
if (haptic == null) {
InputDevice device = InputDevice.getDevice(deviceIds[i]);
Vibrator vib = device.getVibrator();
if (vib.hasVibrator()) {
haptic = new SDLHaptic();
haptic.device_id = deviceIds[i];
haptic.name = device.getName();
haptic.vib = vib;
mHaptics.add(haptic);
SDLControllerManager.nativeAddHaptic(haptic.device_id, haptic.name);
if (vib != null) {
if (vib.hasVibrator()) {
haptic = new SDLHaptic();
haptic.device_id = deviceIds[i];
haptic.name = device.getName();
haptic.vib = vib;
mHaptics.add(haptic);
SDLControllerManager.nativeAddHaptic(haptic.device_id, haptic.name);
}
}
}
}

2
android-project/build.gradle

@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.2.2'
classpath 'com.android.tools.build:gradle:8.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

4
android-project/gradle/wrapper/gradle-wrapper.properties vendored

@ -1,6 +1,6 @@
#Wed Dec 13 13:49:58 EET 2023
#Mon Apr 29 13:42:12 EEST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

Loading…
Cancel
Save