OSDN Git Service

Remove obsolete conditional preventing surface placement.
authorRobert Carr <racarr@google.com>
Wed, 3 Feb 2016 03:16:04 +0000 (19:16 -0800)
committerRobert Carr <racarr@google.com>
Wed, 3 Feb 2016 06:44:53 +0000 (22:44 -0800)
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

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

index 761d6e9..b553603 100644 (file)
@@ -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.