Initialize btif_max_hf_clients with proper value
btif_max_hf_clients which is an unsigned 16bit integer is initialized with -1(0xFFFF) in btif_hf.c. Later on, when application calls init with max_hf_clients as 1, btif_max_hf_clients will be set to 1. But, before this happens, context switch happened from application context to btif context with btif_max_hf_clients as -1. In the btif context, BTA_AgRegister gets called in for loop for 0xFFFF times. We are running out of scbs due to this. Initialize btif_max_hf_clients with 1. Assign it to max_hf_clients before context switch happens. Change-Id: Ibde1bebbab2eb64442027164236f1d82e4269d23
Loading
Please register or sign in to comment