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

Commit d1a8d4d4 authored by Evan Chen's avatar Evan Chen
Browse files

Make checkBleState a none blocking call.

BluetoothAdapter.isLeEnabled will at some point call
the Bluetooth service on a non-oneway call.

Try to  post to the main thread to avoid the
Outgoing transactions from this process must be FLAG_ONEWAY
warning.

Flag: EXEMPT bugfix
Bug: 341476279
Test: CTS and make
Change-Id: Icc3012f2b6c554caa3a777ff304216f08de71b0f
parent 9cca183f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -241,7 +241,8 @@ class BleDeviceProcessor implements AssociationStore.OnChangeListener {
        final BroadcastReceiver receiver = new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {
                checkBleState();
                // Post to the main thread to make sure it is a Non-Blocking call.
                new Handler(Looper.getMainLooper()).post(() -> checkBleState());
            }
        };