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

Commit aaa935dc authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "BatteryService: don't use autoconnect with opportunistic connections"...

Merge "BatteryService: don't use autoconnect with opportunistic connections" am: 8d26041b am: e9e7b166

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2051248



Change-Id: I96d03ce918d722ad9cc500c8e612acbd16201b49
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 44e7aa29 e9e7b166
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -223,14 +223,13 @@ public class BatteryStateMachine extends StateMachine {
            return false;
        }

        if (mBluetoothGatt != null) {
            mBluetoothGatt.connect();
        } else {
        if (mBluetoothGatt == null) {
            mGattCallback = new GattCallback();
            mBluetoothGatt = mDevice.connectGatt(service, /*autoConnect=*/true,
            mBluetoothGatt = mDevice.connectGatt(service, /*autoConnect=*/false,
                    mGattCallback, TRANSPORT_AUTO, /*opportunistic=*/true,
                    PHY_LE_1M_MASK | PHY_LE_2M_MASK, getHandler());
        }
        // opportunistic client will reconnect itself, no need to call mBluetoothGatt.connect()
        return mBluetoothGatt != null;
    }