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

Skip to content
Commit 3e3b4221 authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Enable non-activity windows to be re-parented between displays

This allow a window added using a WindowContext's WindowManager to be reparented to a different display without being removed and re-added, using "WindowContext#reparentToDisplayId" (hidden API).

A call to "reparentToDisplayId" updates the context and its resources to match the destination display ID and characteristics.

For this reason, it is necessary to inflate all the views that are moved with this API with a separate context from other views (e.g. creating one with applicationContext.createWindowContext(...)).

This also prevents "onAttached" and "onDetached" callbacks from being invoked after the view is reparented. Only a configurationChange + onMovedToDisplay is expected to be received from the window's root view.

The motivation of this change is that SysUI (especially flexiglass) is written assuming onAttached happens only once, and it would have taken a huge refactor to change this.

Also, using this API results in a much faster shade movement (as all the sysui code that was triggering "onAttached", is not triggered anymore).

Note that this API is used in SysUI in the child cl.

Bug: 362719719
Bug: 381258683
Bug: 381075014
Test: WindowContextListenerControllerTests, WindowManagerServiceTests, WindowTokenTests
Flag: com.android.window.flags.reparent_window_token_api
Change-Id: Icd17761951c26786d3e8120fce677265acf9390a
parent a424fedc
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