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
Loading
Please register or sign in to comment