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

Commit fdc8ac91 authored by Andreas Miko's avatar Andreas Miko
Browse files

Fix renderAuthority being empty after device rotation

In theory, renderAuthority should never be empty if a node is attached.
In practice, some elements can still be composed even when they are
already detached. In this edge case we will now simply return false.

Bug: 383345762
Test: manual verification
Flag: com.android.systemui.scene_container
Change-Id: I2c703d82fbb21b2f13ff29505642cb630169277c
parent 84e03f80
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -30,7 +30,8 @@ internal fun Element.shouldBeRenderedBy(content: ContentKey): Boolean {
    // the transition is running. If the [renderAuthority.size] is 1 it means that that this element
    // is currently composed only in one nesting level, which means that the render authority
    // is determined by "classic" shared element code.
    return renderAuthority.size == 1 || renderAuthority.first() == content
    return renderAuthority.size > 0 &&
        (renderAuthority.size == 1 || renderAuthority.first() == content)
}

/**