Optimize window decor inset source updates
Adding or removing inset sources through WCT requires a binder
transaction that is expensive and may result in jank.
To avoid unnecessary inset updates, this change:
1) Adds a WindowDecorationInsets object caching the latest inset source
parameters sent for its window decoration, to allow diffing whenever
the decoration relayouts and the caption insets may need to be
updated.
2) Bundles inset source updates into the same WCT in a #relayout. Prior
to this change, when the caption SCVH had to be recreated during a
#relayout, it first released its views and removed the inset source
with one WCT, and then recreated the views and added the new inset
source using a different WCT.
Bug: 335975211
Test: enter split-screen through overview button, check app handles
still work and get updated on resizes. Also check perfetto trace to see
reduced number of binder transactions.
Change-Id: I0ebfc27885c7047ee2e27509739317eb4ad74f5e
3 files changed