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

Commit d7abea17 authored by Toshiki Kikuchi's avatar Toshiki Kikuchi
Browse files

Skip checking display windowing mode if TDA is null

This CL fixes the crash issue in CTS which uses non-trusted virtual
displays.
Such a display is not “organized” by the DisplayOrganizer so
DisplayAreaInfo can be null.

Bug: 380441549
Flag: EXEMPT bug fix
Test: com.android.test.input.UinputRecordingIntegrationTests
Change-Id: I91eed17c6fd23cad9dd1aaeab5bd541503338b34
parent 99b80855
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -361,8 +361,15 @@ class DesktopTasksController(
        }

        val tdaInfo = rootTaskDisplayAreaOrganizer.getDisplayAreaInfo(displayId)
        requireNotNull(tdaInfo) {
            "This method can only be called with the ID of a display having non-null DisplayArea."
        // A non-organized display (e.g., non-trusted virtual displays used in CTS) doesn't have
        // TDA.
        if (tdaInfo == null) {
            logW(
                "forceEnterDesktop cannot find DisplayAreaInfo for displayId=%d. This could happen" +
                    " when the display is a non-trusted virtual display.",
                displayId,
            )
            return false
        }
        val tdaWindowingMode = tdaInfo.configuration.windowConfiguration.windowingMode
        val isFreeformDisplay = tdaWindowingMode == WINDOWING_MODE_FREEFORM