# HG changeset patch # User Jordan Christiansen # Date 1610069592 21600 # Thu Jan 07 19:33:12 2021 -0600 # Node ID a8e6474302eac727b5092ab9bdbd2458dc26c2db # Parent 6ec80d45949cc610f1f51e9b1177f3a6b9bfa295 Disabled Bluetooth if BLE is not supported BluetoothManager is supported for Android API 18+. On older versions, skip Bluetooth instead of crashing. diff -r 6ec80d45949c -r a8e6474302ea android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java --- a/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java Mon Jan 04 19:51:56 2021 -0600 +++ b/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java Thu Jan 07 19:33:12 2021 -0600 @@ -7,6 +7,7 @@ import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothManager; import android.bluetooth.BluetoothProfile; +import android.os.Build; import android.util.Log; import android.content.BroadcastReceiver; import android.content.Context; @@ -382,6 +383,11 @@ return; } + if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE) || (Build.VERSION.SDK_INT < 18)) { + Log.d(TAG, "Couldn't initialize Bluetooth, this version of Android does not support Bluetooth LE"); + return; + } + // Find bonded bluetooth controllers and create SteamControllers for them mBluetoothManager = (BluetoothManager)mContext.getSystemService(Context.BLUETOOTH_SERVICE); if (mBluetoothManager == null) {