OSDN Git Service

Ignore request to add starting window if already visible
authorWale Ogunwale <ogunwale@google.com>
Thu, 20 Apr 2017 23:45:13 +0000 (16:45 -0700)
committerWale Ogunwale <ogunwale@google.com>
Thu, 20 Apr 2017 23:47:40 +0000 (16:47 -0700)
No need to display a starting winow for an app that already has its
main window visible and drawn.

Test: manual
Change-Id: Ibb6c74d0c5cc91cef335749d7546001fff1f7678
Fixes: 37199644

services/core/java/com/android/server/wm/AppWindowContainerController.java

index bde2111..292734d 100644 (file)
@@ -470,6 +470,13 @@ public class AppWindowContainerController
                 return false;
             }
 
+            final WindowState mainWin = mContainer.findMainWindow();
+            if (mainWin != null && mainWin.isVisible() && mainWin.isDrawnLw()) {
+                // App already has a visible window that is drawn...why would you want a starting
+                // window?
+                return false;
+            }
+
             final int type = getStartingWindowType(newTask, taskSwitch, processRunning,
                     allowTaskSnapshot);