summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator_test.cpp
diff options
context:
space:
mode:
authorRiddle Hsu <riddlehsu@google.com>2020-02-02 18:01:54 +0800
committerGopal Shukla <gshukla@codeaurora.org>2020-04-28 20:14:43 +0000
commitb7b85a3f5f5a60cbc2d834b262dbf64f5e4fe009 (patch)
tree7365782114f35e248586a46e514fa25fc18591fd /tools/aapt2/java/JavaClassGenerator_test.cpp
parent4652e8a10663adb280e41e059156a15c162f5ae5 (diff)
DO NOT MERGE 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. CRs-Fixed:2617537 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 restart the system). Change-Id: I3ae85927da1c11b2560524b6642401741b5beae2 Merged-In: I3ae85927da1c11b2560524b6642401741b5beae2
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions