summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator.cpp
diff options
context:
space:
mode:
authorSnild Dolkow <snild@sony.com>2017-06-14 09:57:36 +0200
committerTodd Kennedy <toddke@google.com>2017-08-01 12:47:00 -0700
commite2612eb3f59b2586273fd52a211ee430b0ccf8c2 (patch)
treee077c766ea85f093af591758c645eae7ae588ac7 /tools/aapt2/java/JavaClassGenerator.cpp
parentb3d487da64b143d00755404663a3e2a645954721 (diff)
Fix deadlock between AMS and EphemeralResolverConnection
The ActivityManagerService lock may be taken when calling into ERC through ActivityStarter.startActivityMayWait(). At the same time, a PackageManagerService.getLastChosenActivity() call could take the ERC lock and call unbindService(), requesting the AMS lock. Deadlock. Solved by making sure to drop the ERC lock before calling into AMS. This necessitated an extra state to prevent multiple callers from clobbering the binding, so mIsBinding became mBindState. The IDLE state means that nothing is currently binding. The BINDING state means someone is initiating a bind, including the wait() call thereafter. The PENDING state means that bindService() has been called, but the caller's timeout expired (i.e. the new caller may want to rebind). Fixes: 63150916 Test: for x in $(seq 100); do adb shell am start http://127.0.0.1/does-not-exist.html; adb shell input keyevent 3; done Change-Id: I2cb5610a2277ef641f8e2d7f5ad1c4a72bb4f026
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
0 files changed, 0 insertions, 0 deletions