mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-04-30 10:05:28 +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() {
|
fun connect() {
|
||||||
val uuid = ParcelUuid.fromString("00000000-0000-0000-0000-000000000000")
|
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 {
|
try {
|
||||||
socket!!.connect()
|
socket!!.connect()
|
||||||
} catch (e: Exception) {
|
} 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 {
|
private fun createBluetoothSocket(adapter: BluetoothAdapter, device: BluetoothDevice, uuid: ParcelUuid): BluetoothSocket {
|
||||||
val type = 3 // L2CAP
|
val type = 3 // L2CAP
|
||||||
val constructorSpecs = listOf(
|
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, true, true, 31, uuid),
|
||||||
arrayOf(device, type, 1, true, true, 31, uuid),
|
arrayOf(device, type, 1, true, true, 31, uuid),
|
||||||
arrayOf(type, 1, true, true, device, 31, uuid),
|
arrayOf(type, 1, true, true, device, 31, uuid),
|
||||||
|
|||||||
Reference in New Issue
Block a user