btif: Fix possible races on bluetooth off
Normally it is Java layer having access to btif interface, where calles are binded to the blueototh mainthread. However, some calls e.g. RemoveDevice are called from the bluetooth mainthread. This happens when device got unbonded. If we are unluckly, if during mainthread operation, there is Cleanup scheduled due to Bluetooth being turning OFF, it might happen that RemoveDevice operation will be scheduled, but when it start to execute, services instances are already gone. This will lead to crash. This patch add simple mechism to prevent that. Bug: 226276953 Test: manual testing Tag: #feature Change-Id: Ib226e851981dadcc5b0091a1ac1428adcb7302a2
Loading
Please register or sign in to comment