diff options
author | Riddle Hsu <riddlehsu@google.com> | 2020-02-02 18:01:54 +0800 |
---|---|---|
committer | Riddle Hsu <riddlehsu@google.com> | 2020-02-03 18:25:51 +0000 |
commit | 60a494ae3858c1485c8d9b60264c0618128eeffe (patch) | |
tree | 5c6fcf0c48feb586081c0cf6b57fca1ba30a463c /libs/hwui/renderthread/VulkanManager.cpp | |
parent | 749e585a3bdeb09327ef265a9aead724e5f1c61b (diff) |
Make the disconnecting list from activity up-to-date
After the holder has enqueued the runnable to disconnect, the
connections may be removed by other paths, e.g.
ActivityThread#handleDestroyActivity
-> ContextImpl#scheduleFinalCleanup
-> LoadedApk#removeContextRegistrations
-> unbindService
Then when executing the runnable, it will remove the removed
connection again and try to bind down the service. If a new service
instance has been started again, it will cause IllegalStateException.
This change keeps the reference of connections, so removeConnection
from ActiveServices still updates the exact list. The original
double-disconnect is protected by null out the holder and a new
flag to indicate disconnecting.
Bug: 146825978
Test: atest CtsAppTestCases:ServiceTest
Test: 1. Add sleep 5s in the disconnect-runnable to delay calling
ActivityManagerInternal#disconnectActivityFromServices.
2. Launch an activity which binds a service.
3. Finish the activity without unbind (so the
disconnect-runnable is enqueued and unbindService from
final-cleanup will be called. If DEBUG_CLEANUP is enabled,
the log in removeConnection should appear).
4. After the activity is destroyed for 2s, start the service
again (previous service is destroyed by unbind, so a new
service record is created).
5. The 5s delayed disconnect-runnable executes, and system
is still alive without any exception logs (originally
it will always crash the system).
Change-Id: I3ae85927da1c11b2560524b6642401741b5beae2
Diffstat (limited to 'libs/hwui/renderthread/VulkanManager.cpp')
0 files changed, 0 insertions, 0 deletions