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

Commit 32ebb5b3 authored by Srinu Jella's avatar Srinu Jella Committed by Andre Eisenbach
Browse files

Don't process pair request when controller is not ready

Use case: when one application is trying to pair and
other application is turning off Bluetooth.

Steps: when one application is trying to pair and
other application is turning off Bluetooth.

Failure: Bluetooth process crashed.

Root Cause: Bluetooth process crashed due to assertion,
as controller module is not ready.

Fix: Made a checks for controller module is ready or not, If
it is ready then only go for pairing.

Change-Id: I72c72f6b5545c845e79874212359854023ffad98
parent 7117dc3e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -994,6 +994,12 @@ tBTM_STATUS btm_sec_bond_by_transport (BD_ADDR bd_addr, tBT_TRANSPORT transport,
        return(BTM_NO_RESOURCES);
    }

    if (!controller_get_interface()->get_is_ready())
    {
        BTM_TRACE_ERROR ("%s controller module is not ready", __func__);
        return(BTM_NO_RESOURCES);
    }

    BTM_TRACE_DEBUG ("before update sec_flags=0x%x", p_dev_rec->sec_flags);

    /* Finished if connection is active and already paired */