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

Commit d648cd05 authored by Jack He's avatar Jack He Committed by Gerrit Code Review
Browse files

Merge "Register connect callback when the service is up"

parents dc39b256 cf1c8860
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -3983,6 +3983,22 @@ public final class BluetoothAdapter {
                                }
                            }
                        }
                        synchronized (mBluetoothConnectionCallbackExecutorMap) {
                            if (!mBluetoothConnectionCallbackExecutorMap.isEmpty()) {
                                try {
                                    final SynchronousResultReceiver recv =
                                            SynchronousResultReceiver.get();
                                    mService.registerBluetoothConnectionCallback(
                                            mConnectionCallback,
                                            mAttributionSource, recv);
                                    recv.awaitResultNoInterrupt(getSyncTimeout())
                                            .getValue(null);
                                } catch (RemoteException | TimeoutException e) {
                                    Log.e(TAG, "onBluetoothServiceUp: Failed to register "
                                            + "bluetooth connection callback", e);
                                }
                            }
                        }
                    } finally {
                        mServiceLock.readLock().unlock();
                    }