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

Commit 4c0c9193 authored by Jack He's avatar Jack He Committed by Automerger Merge Worker
Browse files

Merge "Register connect callback when the service is up" am: d648cd05 am: 26199761

parents e0f493e2 26199761
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();
                    }