private async void OnBtConnectionStateChangedObservers(Earbuds sendor, BluetoothDevice bluetoothDevice, BluetoothConnectionStatus connectionStatus) { if (sendor != null) { bool result; result = await sendor.ConnectSpp(); Log.D($"PairWithMac(): Request to connect Spp with {LocalBtAddress}, result = {result}"); // FIXME: Retry if failed to connect A2DP over SPP for (int i = 0; i < 10; ++i) { result = await sendor.SppConnectA2DP(LocalBtAddress); Log.D($"PairWithMac(): Request to connect A2DP with {LocalBtAddress}, try={i}, result = {result}"); if (result) { break; } } sendor.DisconnectSpp(); Log.D($"PairWithMac(): Request to Disconnect SPP with {LocalBtAddress}"); sendor.BtConnectionStateChangedObservers -= OnBtConnectionStateChangedObservers; sendor.DisableSppConnection(); } }