From e352b18f17789897ba1d160b011e81e9b182f0ec Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Tue, 2 Feb 2016 19:16:04 -0800 Subject: [PATCH] Remove obsolete conditional preventing surface placement. This conditional seems obsolete and is preventing surface changes for dialogs on secondary displays. To show obsolesence, we can break down our cases based on display as follows: 1. Primary Display In this case we have a home stack, and we cannot enter this conditional. 2. Secondary Display (no home stack) a. Private displays - We allow layout without a homestack when type == TYPE_PRIVATE_PRESENTATION b. Other secondary displays - As TYPE_PRIVATE_PRESENTATION can only be on private displays (see addWindow) we always enter this conditional for taskless Windows (e.g. Dialogs) on secondary displays, and refuse to apply their surface changes. We can see if we remove the conditional, 1 will be invariant. 2a will remain invariant, except we allow layout when type != TYPE_PRIVATE_PRESENTATION. If there is a non private presentation window on a private display, an invariant has malfunctioned and we don't know what to do here (we don't enforce all the addWindow invariants at each surface change). In case 2b we will allow surface changes (where previously blocking them), and this seems correct, after all we wish to allow dialogs to appear on secondary displays right? Bug: 26154242 Change-Id: Ia8cbb079616a80f41b131cafe46c7408a558e307 --- .../java/com/android/server/wm/WindowSurfacePlacer.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/services/core/java/com/android/server/wm/WindowSurfacePlacer.java b/services/core/java/com/android/server/wm/WindowSurfacePlacer.java index 761d6e9c5e06b..b553603ef2bad 100644 --- a/services/core/java/com/android/server/wm/WindowSurfacePlacer.java +++ b/services/core/java/com/android/server/wm/WindowSurfacePlacer.java @@ -647,14 +647,6 @@ class WindowSurfacePlacer { for (int i = windows.size() - 1; i >= 0; i--) { WindowState w = windows.get(i); - Task task = w.getTask(); - if (task == null && w.getDisplayContent().getHomeStack() == null - && w.getAttrs().type != TYPE_PRIVATE_PRESENTATION) { - // TODO: Understand what the use case is here and see if the conditions can be - // simplified. - continue; - } - final boolean obscuredChanged = w.mObscured != mObscured; // Update effect.