Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 3148276a authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Use cached insets for display switch

The insets of common bars in previous device state will be cached.
When display switch transition is running, the previous cached
insets can be dispatched to each window before the insets provider
update new insets for new device state. That reduces intermediate
insets change and extra redraw.

The preserved insets only takes effect during display switch
transition is running.

Also cache PrivacyIndicatorBounds because it is also a member of
InsetsState that will trigger changes.

For an activity which doesn't consume insets when unfolding,
the amount of reduced change events:
 View#onLayout: from 3 to 1
 View#dispatchApplyWindowInsets: from 4 to 2

Bug: 266197298
Flag: com.android.window.flags.use_cached_insets_for_display_switch
Test: atest DisplayPolicyTests#testSwitchDecorInsets
Test: Check the number of calls to View#onLayout and
      View.OnApplyWindowInsetsListener during fold/unfold.
Change-Id: I3a5b458624cee9daaa38dadff1c52ae03ee8d5a8
parent 40aa32b3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment