Pbap: Avoid recursive calling during turn off BT
Use case:
1. Turn ON BT
2. Start inquiry
3. Turn OFF BT
4. Repeat steps 1 to 3 for 1000 iterations
Failure:
"Unfortunately, Bluetooth share has stopped" error comes.
Root cause:
Handler is made null by call to closeService() called via
BT_TURNING_OFF -> closeService() -> onDestroye() ->
mSessionStatusHandler made NULL -> closeService()
going to recursive call.
Fix:
Before initiate shutdown msg check closeService API
was called or not using flag which helps to avoid recursive
calling to fix a relevant NPE.
Set PBAP Profile state to disconnected if not already set.
CRs-Fixed: 1045017
Change-Id: I362678772138257510727c6fa2cdb9582aa6e536
1 file changed