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

Commit ad10b92a authored by Matthew DeVore's avatar Matthew DeVore
Browse files

DisplayTopology: make allNodesIdMap public

This is a more light-weight utility than getAbsoluteBounds for getting
all display IDs in the topology. It is also needed by ag/32951858 to
resolve a display ID to its logical size.

Flag: EXEMPT refactor
Bug: b/397231553
Test: SQ
Change-Id: I2a1baed6c84f4078f18860b3a291dae76d3ea652
parent d8210a7c
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -813,7 +813,13 @@ public final class DisplayTopology implements Parcelable {
        return a == b || (Float.isNaN(a) && Float.isNaN(b)) || Math.abs(a - b) < EPSILON;
    }

    private Map<Integer, TreeNode> allNodesIdMap() {
    /**
     * Returns a map of all TreeNodes indexed by the display ID.
     *
     * @hide
     */
    @NonNull
    public Map<Integer, TreeNode> allNodesIdMap() {
        var pend = new ArrayDeque<TreeNode>();
        var found = new HashMap<Integer, TreeNode>();

+1 −2
Original line number Diff line number Diff line
@@ -375,8 +375,7 @@ class MultiDisplayVeiledResizeTaskPositioner(

        displayIds.clear()
        if (topology == null) return
        val displayBounds = topology.getAbsoluteBounds()
        displayIds.addAll(List(displayBounds.size()) { displayBounds.keyAt(it) })
        displayIds.addAll(topology.allNodesIdMap().keys)
    }

    companion object {