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

Skip to content
Commit b50ba0c4 authored by Qijing Yao's avatar Qijing Yao
Browse files

Unregister DisplayWindowListener when window closed

To support drag across multi-displays, we added
MultiDisplayVeiledResizeTaskPositioner as an OnDisplaysChangedListener
to DisplayController. However, the listener was never unregistered,
and since a new taskPositioner is created for each window, this
resulted in a memory leak.

This change addresses the issue by:
* Adding a `close()` method to the `TaskDragResizer` interface and its
implementations. For `MultiDisplayVeiledResizeTaskPositioner`, it
removes the listener from `DisplayController`. For other
implementations, it's a no-op.
* Calling `TaskDragResizer.close()` in `WindowDecoration#close()`.

Bug: 399076683
Test: atest; check heap dump to confirm the memory leak is resolved
Flag: com.android.window.flags.enable_connected_displays_window_drag

Change-Id: I14f0c3d04385c06899f846ceaa1962b024cdc62e
parent 4f06c68f
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