Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee6c04e4 authored by Kyunglyul Hyun's avatar Kyunglyul Hyun
Browse files

BAS: connect gatt service when device is reconnected

As we explictly call BluetoothGatt#disconnect when
the bluetooth device is disconnected, we need to
call BluetoothGatt#connect explictly to make it
reconnect.

Bug:228793905
Tag: #feature

Test: atest BluetoothInstrumentationTests and manually
connect/disconnect LE Audio device repeatedly

Change-Id: Ifd9976329fa9d6734a16f3a3d706e64dc0afda63
parent 8cb769a2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -228,8 +228,9 @@ public class BatteryStateMachine extends StateMachine {
            mBluetoothGatt = mDevice.connectGatt(service, /*autoConnect=*/false,
                    mGattCallback, TRANSPORT_AUTO, /*opportunistic=*/true,
                    PHY_LE_1M_MASK | PHY_LE_2M_MASK, getHandler());
        } else {
            mBluetoothGatt.connect();
        }
        // opportunistic client will reconnect itself, no need to call mBluetoothGatt.connect()
        return mBluetoothGatt != null;
    }