mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-04-29 09:33:04 +00:00
android: fix ATT on A16QPR3+
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user