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

Commit 43330375 authored by Yuyang Huang's avatar Yuyang Huang
Browse files

change BAS connectGatt from TRANSPORT_AUTO to TRANSPORT_LE

This fixes dual mode earbud's battery level does not show up issue

Bug: 249689130
Test: manual
Change-Id: I5bba8800922d58acce29bcf2ab9bf6069d2c6dc5
(cherry picked from commit f4d24cb2)
Merged-In: I5bba8800922d58acce29bcf2ab9bf6069d2c6dc5
parent e62e68a3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ package com.android.bluetooth.bas;

import static android.bluetooth.BluetoothDevice.PHY_LE_1M_MASK;
import static android.bluetooth.BluetoothDevice.PHY_LE_2M_MASK;
import static android.bluetooth.BluetoothDevice.TRANSPORT_AUTO;
import static android.bluetooth.BluetoothDevice.TRANSPORT_LE;

import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
@@ -233,7 +233,7 @@ public class BatteryStateMachine extends StateMachine {
            mBluetoothGatt.close();
        }
        mBluetoothGatt = mDevice.connectGatt(service, /*autoConnect=*/false,
                mGattCallback, TRANSPORT_AUTO, /*opportunistic=*/true,
                mGattCallback, TRANSPORT_LE, /*opportunistic=*/true,
                PHY_LE_1M_MASK | PHY_LE_2M_MASK, getHandler());
        return mBluetoothGatt != null;
    }