From 0af60cd8a96d8e60c312288e2ee163be5f4532f0 Mon Sep 17 00:00:00 2001 From: Kavish Devar Date: Fri, 24 Apr 2026 17:34:19 +0530 Subject: [PATCH] android: fix ATT on A16QPR3+ --- .../java/me/kavishdevar/librepods/bluetooth/ATTManager.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/java/me/kavishdevar/librepods/bluetooth/ATTManager.kt b/android/app/src/main/java/me/kavishdevar/librepods/bluetooth/ATTManager.kt index 41c1483..6df4b71 100644 --- a/android/app/src/main/java/me/kavishdevar/librepods/bluetooth/ATTManager.kt +++ b/android/app/src/main/java/me/kavishdevar/librepods/bluetooth/ATTManager.kt @@ -72,7 +72,11 @@ class ATTManager(private val adapter: BluetoothAdapter, private val device: Blue fun connect() { val uuid = ParcelUuid.fromString("00000000-0000-0000-0000-000000000000") - socket = createBluetoothSocket(adapter, device, uuid) + try { + socket = createBluetoothSocket(adapter, device, uuid) + } catch (e: Exception) { + Log.w(TAG, "Failed to create socket") + } try { socket!!.connect() } catch (e: Exception) { @@ -203,7 +207,7 @@ class ATTManager(private val adapter: BluetoothAdapter, private val device: Blue private fun createBluetoothSocket(adapter: BluetoothAdapter, device: BluetoothDevice, uuid: ParcelUuid): BluetoothSocket { val type = 3 // L2CAP val constructorSpecs = listOf( - arrayOf(adapter, device, type, true, 31, uuid), + arrayOf(adapter, device, type, true, true, 31, uuid), arrayOf(device, type, true, true, 31, uuid), arrayOf(device, type, 1, true, true, 31, uuid), arrayOf(type, 1, true, true, device, 31, uuid),