diff options
author | Daichi Hirono <hirono@google.com> | 2017-03-17 09:12:12 +0900 |
---|---|---|
committer | Daichi Hirono <hirono@google.com> | 2017-03-22 05:06:30 +0000 |
commit | 4010fe49486338f9aa31aba238c60d1837ce1e74 (patch) | |
tree | b4272264579d0867cd7a278850dc47d8fd5c1948 /tools/aapt2/diff/Diff.cpp | |
parent | c7da040f22d56b9b8a4d0ecea959d44b313fa7bb (diff) |
Stop holding mProxyLock while downloading PAC script data.
Holding PacManager#mProxyLock for long time eventually causes ANR when
launching new applications.
1. ActivityThread#handleBindApplication blocks until
ActivityThread#handleBindApplication
-> ConnectivityService#getProxyForNetwork()
-> ConnectivityService#getDefaultProxy()
obtains the lock of ConnectivityService#mProxyLock
2. ConnectivityService#mProxyLock can be held by
ConnectivityService#setGlobalProxy() running on another thread until
ConnectivityService#setGlobalProxy()
-> ConnectivityService#sendProxyBroadcast()
-> PacManager#setCurrentProxyScriptUrl()
obtains the lock of PacManager#mProxyLock
3. Before the CL, PacManager#mProxyLock could be held by
mPacDownloader#run() on mNetThread until downloading a PAC script
completed.
The CL fixes the step 3 so that mPacDownloader#run does not keep the
lock of PacManager#mProxyLock. It eventually fixes long blocking at
ActivityThread#handleBindApplication and ANR when launching an
application.
Bug: 36317236
Test: Build succeeded and manually set PAC script
Change-Id: I864e41e1142178681f8f1b4fb7750d37e3ab2076
Diffstat (limited to 'tools/aapt2/diff/Diff.cpp')
0 files changed, 0 insertions, 0 deletions