summaryrefslogtreecommitdiff
path: root/libs/androidfw/StringPool.cpp
diff options
context:
space:
mode:
author Jan Sebechlebsky <jsebechlebsky@google.com> 2024-03-21 16:33:20 +0100
committer Jan Sebechlebsky <jsebechlebsky@google.com> 2024-03-26 10:50:36 +0100
commit4ac594892213e7595850fe3e98634d48cd6fa2af (patch)
treee89539948efd074a24db6bc473dac79d35891779 /libs/androidfw/StringPool.cpp
parentdcfc1a872ea166c9bd093f21d9ed5085080e5b6f (diff)
Fix ContextImpl leak in ActivityThread.
ActivityThread caches system ui contexts per display, but never removes them when the corresponding displays are removed. This is especially problematic with VirtualDisplay-s and ActivityThread instance used in system server. This cl modifies the cache to use WeakRef and allow instances to be garbage collected. Also, since the context can be moved between the displays, it's possible that the cached instance doesn't correspond to the display in the SparseArray key at the moment it's fetched. This cl stores the instances in the simple array list (The number of instances at the same time should be low, and we would anyway need to traverse the whole SparseArray to check for moved instances). Bug: 330472805 Test: verifying heapdump after atest CtsVirtualDevicesAppLaunchTestCases --iterations 10 Change-Id: I8811945560381653cac8363d4086f87d253e22db
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions