Fix the condition for removing desktop wallpaper
This change fixes a condition that led to an ANR error when a task was moved from the default display to another. Previously, DesktopWallpaperActivity was removed when the last desktop task was removed (e.g. the task closed or left desktop mode). However, if other desktop tasks remained on a different display, DesktopWallpaperActivity remained on the default display. In this case, DesktopWallpaperActivity became the topmost task on the default display, and the system server attempted to give it focus. Because DesktopWallpaperActivity is not focusable, the system server could not find a focusable window, eventually causing an ANR. This commit corrects the condition for removing the desktop wallpaper. Now, DesktopWallpaperActivity is removed when the last desktop task on the default display is removed. Bug: 381361395 Test: DesktopTasksControllerTest#moveToNextDisplay_removeWallpaper Flag: com.android.window.flags.enable_per_display_desktop_wallpaper_activity Change-Id: I7f142b3cc4282109c716e80b65f8b9e2cc343787
Loading
Please register or sign in to comment