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

Commit 231d0611 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix profiles being marked as FORBIDDEN before bonding is attempted."...

Merge "Fix profiles being marked as FORBIDDEN before bonding is attempted." into main am: d89bc51c am: 44cf2153

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3198971



Change-Id: I0488bc7f503748ef6ddb557bb3b531f00068d6a6
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents c0ac7968 44cf2153
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ final class BondStateMachine extends StateMachine {
                        Log.e(
                                TAG,
                                "In stable state, received invalid newState: "
                                        + state2str(newState));
                                        + bondStateToString(newState));
                    }
                    break;
                case BONDED_INTENT_DELAY:
@@ -599,9 +599,9 @@ final class BondStateMachine extends StateMachine {
                "Bond State Change Intent:"
                        + device
                        + " "
                        + state2str(oldState)
                        + bondStateToString(oldState)
                        + " => "
                        + state2str(newState));
                        + bondStateToString(newState));
    }

    void bondStateChangeCallback(int status, byte[] address, int newState, int hciReason) {
@@ -803,7 +803,7 @@ final class BondStateMachine extends StateMachine {
        }
    }

    private String state2str(int state) {
    public static String bondStateToString(int state) {
        if (state == BluetoothDevice.BOND_NONE) {
            return "BOND_NONE";
        } else if (state == BluetoothDevice.BOND_BONDING) {
+12 −2
Original line number Diff line number Diff line
@@ -1125,9 +1125,19 @@ public class PhonePolicy implements AdapterService.BluetoothStateCallback {
     * @param uuids are the services supported by the remote device
     */
    void onUuidsDiscovered(BluetoothDevice device, ParcelUuid[] uuids) {
        debugLog("onUuidsDiscovered: discovered services for device " + device);
        int bondState = mAdapterService.getBondState(device);
        debugLog(
                "onUuidsDiscovered: discovered services for device "
                        + device
                        + " ("
                        + BondStateMachine.bondStateToString(bondState)
                        + ")");
        if (uuids != null) {
            if (!Flags.unbondedProfileForbidFix() || bondState != BluetoothDevice.BOND_NONE) {
                processInitProfilePriorities(device, uuids);
            } else {
                debugLog("Device in BOND_NONE state, won't connect profiles" + device);
            }
        } else {
            warnLog("onUuidsDiscovered: uuids is null for device " + device);
        }