summaryrefslogtreecommitdiff
path: root/libs/androidfw/StringPool.cpp
diff options
context:
space:
mode:
author Chavi Weingarten <chaviw@google.com> 2023-04-19 17:19:39 +0000
committer Chavi Weingarten <chaviw@google.com> 2023-04-20 15:54:18 +0000
commit6608bfd58b26c1476caab3a0edfe11a125165807 (patch)
tree58d22d87187b32db670fdc990357a73f953f5479 /libs/androidfw/StringPool.cpp
parente0dfbbbe11830df51372519c0fb1cc4ff762c695 (diff)
Ensure pendingTransactions are applied if the VRI is torn down
When callers invoke the applyTransactionOnDraw, the code previously set up an RT frame callback and only merged the transaction once a draw started. However, if VRI is being torn down before a traversal starts, the callback will never be invoked and the transaction will be left in memory until GC. The cleanest way is to immediately apply the transaction when the VRI is getting torn down to avoid leaving a stale transaction with reference to SCs in it. This required a bit of cleanup to ensure the UI thread still had access to the SurfaceControl until a traversal was called. The new behavior merges all incoming transactions from applyTransactionOnDraw into a single Transaction. Then in the traversal path, it will either piggy-back on the frame callback from sync transaction or create a new one. The Transaction and flag are cleared in the traversal path since if draw has been invoked, we are guaranteed the callback even if VRI dies. This is because HardwareRenderer is not destroyed until everything in the queue completes. Test: presubmit Bug: 248162583 Change-Id: I4d28b917545f530a068b237bf95de431afd749cb
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions