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

Commit d89bc51c authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

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

parents 15bb02b8 7d0f22db
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);
        }