summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator_test.cpp
diff options
context:
space:
mode:
authorMohammad Samiul Islam <samiul@google.com>2020-06-29 12:31:51 +0100
committerMohammad Samiul Islam <samiul@google.com>2020-07-10 10:02:39 +0100
commit3aa1f5aa168d1e14d8a0a4c54b44aecbfe26cbd2 (patch)
tree7b2e0aef12bae05678a07fc9a6905802b2f0a0cc /tools/aapt2/java/JavaClassGenerator_test.cpp
parent5a293b8eb2f0a57ee5b523872329f5e1378dc05e (diff)
Fix deadlock in StagingManager.getSessions() method
When we stage a session we acquire the PackageInstallerSession#mLock first and then StagingManager#mStagedSessions lock. But in getSessions() method, we acquire the locks in reverse order which can lead to deadlock: we first acquire StagingManager#mStagedSessions in getSessions() and then while checking if session is destroyed, we acquire PackageInstallerSession#mLock in isDestroyed() method. By moving the staged session retrieval logic to PackageInstallerService, we avoid acquiring the StagingManager#mStagedSession lock. This avoids deadlock. Bug: 160113544 Test: atest StagedInstallTest Change-Id: I7a1abf44db27d4673d43e9b0886610a5bd8b41f6 Merged-In: I7a1abf44db27d4673d43e9b0886610a5bd8b41f6 (cherry picked from commit c45b6a146c796ea3a006733d0055b48dc1961edd)
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions