OSDN Git Service

Move HDP reg_counter updates to BTIF thread
authorMatadeen Mishra <matade@codeaurora.org>
Wed, 3 Feb 2016 15:11:26 +0000 (20:41 +0530)
committerAndre Eisenbach <eisenbach@google.com>
Fri, 4 Nov 2016 17:24:29 +0000 (10:24 -0700)
commitf098d057753b1637ab3cb99a2b829aa2406fbc6c
tree8011a941188628e4834a3182a8266a84b09cf592
parent1ee975f50fb6957ef8ba9c08b785b288c9f2c0af
Move HDP reg_counter updates to BTIF thread

Use case: register/unregister HDP from third party APK

Test Steps:

1.Install Any Test APK which internally registers/unregister the HDP.
2.Run Test APK.
3.Do initialization of Test APK which internally registers the HDP.
4.Force stop the Test APK.
5.And rerun the APK by going back test APK menu.
6.Now it never perform the re-register the HDP as part of initialization.

Root Cause: HDP registration related counter write operations are done
in JNI main thread, and it's been referenced in BTIF thread.Sometimes,
if the context switch to BTIF thread doesn't happen immediately after
counter increment/decrement, it may not un-register the app if the
counter becomes 0.

Fix: Fixed it by making all operations related to counter in BTIF
thread, so that de-registration happens for all HDP APPs.

Test: code compilation.

Change-Id: I71ace68a5f3d39d81b646f5f40c02ce56b9e93f0
btif/src/btif_hl.cc