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

Skip to content
Commit b12255cb authored by Etienne Ruffieux's avatar Etienne Ruffieux Committed by William Escande
Browse files

Add Bluetooth state check as service null isn't sufficient.

When verifying if Bluetooth is up in some APIs,
BluetoothDevice was only checking if the service is
null. When the adapter turns off, getState can return
STATE_OFF before the callback to inform the Adapter
of the new state is received, so the service isn't
null but the state is off for a brief period of time.
Adding the state checks along with the service checks
prevents being able to call an API when Bluetooth is off.

Bug: 214056525
Tag: #feature
Test: atest BluetoothDeviceTest
Merged-In: Ic387a19402ec6cd3e06677f554da8a8de695b4fc
Change-Id: Ic387a19402ec6cd3e06677f554da8a8de695b4fc
parent 4397d437
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment