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

Skip to content
Commit 98f9d6bf authored by Tiger's avatar Tiger
Browse files

Enable InsetsState to store sources with discontinuous IDs

This CL uses a SparseArray to store the sources instead of a fixed-
length array. In this way, the amount of the sources in the state won't
be limited by the amount of the pre-defined IDs (InternalInsetsType).
Also, the IDs can be discontinuous integers now.

This is a step to remove InternalInsetsType.

This CL also fixes the misuses of InsetsState#getSource. In most of
cases, they should use peekSource instead. To prevent the caller
from creating the source unexpectedly, this CL renames getSource to
getOrCreateSource.

Bug: 234093736
Test: atest InsetsAnimationControlImplTest InsetsControllerTest
      InsetsStateTest SurfaceControlViewHostInsetsTest
      ActivityRecordTests DisplayContentTests
      DisplayPolicyLayoutTests InsetsPolicyTest
      InsetsStateControllerTest TaskLaunchParamsModifierTests
      WindowLayoutTests WindowStateTests
Change-Id: I41729a973fbf7f2765b51f4d696cb9be9981fbed
parent 04e433ca
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment