diff options
| author | 2024-12-03 11:42:53 +0900 | |
|---|---|---|
| committer | 2024-12-04 23:41:15 +0000 | |
| commit | d7abea1703abfd3ec1e46537e88a735529bb6210 (patch) | |
| tree | 0b5136677f01fa64fc5b311da48b2efe0e5910e6 | |
| parent | 99b8085541304f7d1f1f5fdc2b7e5ce128fb86ee (diff) | |
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
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt index d5a2a4083b1d..e4dd9f8e2e22 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt @@ -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 |