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

Commit 5bdd7c8a authored by David Scherba's avatar David Scherba Committed by Steve Kondik
Browse files

Bluetooth: Fix paired state updates during general bonding failures

Adding Android paired state updates based on "Connected: false" property
updates seen during bonding.  General bonding failures (e.g., due to a
lost ACL link) are not explicitly signaled by bluetoothd and need to be
inferred from the "Connected: false" property update.

Change-Id: Ibbc89f95a065c08ef38cb2cd3619a72d7a5530e5
CRs-fixed: 230226
parent dd0d4f36
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2008 The Android Open Source Project
 * Copyright (c) 2010, Code Aurora Forum. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -383,6 +384,13 @@ class BluetoothEventLoop {
            if (propValues[1].equals("true")) {
                intent = new Intent(BluetoothDevice.ACTION_ACL_CONNECTED);
            } else {
                // Check and clean-up if bonding is in progress
                if (mBluetoothService.getBondState().getBondState(address) ==
                        BluetoothDevice.BOND_BONDING) {
                    mBluetoothService.getBondState().setBondState(address,
                          BluetoothDevice.BOND_NONE);
                }

                intent = new Intent(BluetoothDevice.ACTION_ACL_DISCONNECTED);
            }
            intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device);