Improve visibility and layering of dock divider.

We adjust the visiblity of the divider now after every layout.

The divider was far too high in the priority list, based on the wrong
assumption that as a part of the system UI it needs to be constantly
visible. It should stay at the same level as applications, because it's
almost as a part of application.

Layering gets improved by having the relaunch animation receive zorder
top, just as if it was entering. The window that is being replaced fakes
this too, since it's not being animated, but should share the behavior.

Bug: 24500829

Change-Id: Iad3369a5ab6721b1bf7a94e8979dcf33e0805c7f
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index dbc3970..c265000 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -2105,6 +2105,8 @@
         case TYPE_WALLPAPER:
             // wallpaper is at the bottom, though the window manager may move it.
             return 2;
+        case TYPE_DOCK_DIVIDER:
+            return 2;
         case TYPE_PHONE:
             return 3;
         case TYPE_SEARCH_BAR:
@@ -2135,56 +2137,54 @@
         case TYPE_INPUT_METHOD_DIALOG:
             // on-screen keyboards and other such input method user interfaces go here.
             return 13;
-        case TYPE_DOCK_DIVIDER:
-            return 14;
         case TYPE_KEYGUARD_SCRIM:
             // the safety window that shows behind keyguard while keyguard is starting
-            return 15;
+            return 14;
         case TYPE_STATUS_BAR_SUB_PANEL:
-            return 16;
+            return 15;
         case TYPE_STATUS_BAR:
-            return 17;
+            return 16;
         case TYPE_STATUS_BAR_PANEL:
-            return 18;
+            return 17;
         case TYPE_KEYGUARD_DIALOG:
-            return 19;
+            return 18;
         case TYPE_VOLUME_OVERLAY:
             // the on-screen volume indicator and controller shown when the user
             // changes the device volume
-            return 20;
+            return 19;
         case TYPE_SYSTEM_OVERLAY:
             // the on-screen volume indicator and controller shown when the user
             // changes the device volume
-            return 21;
+            return 20;
         case TYPE_NAVIGATION_BAR:
             // the navigation bar, if available, shows atop most things
-            return 22;
+            return 21;
         case TYPE_NAVIGATION_BAR_PANEL:
             // some panels (e.g. search) need to show on top of the navigation bar
-            return 23;
+            return 22;
         case TYPE_SYSTEM_ERROR:
             // system-level error dialogs
-            return 24;
+            return 23;
         case TYPE_MAGNIFICATION_OVERLAY:
             // used to highlight the magnified portion of a display
-            return 25;
+            return 24;
         case TYPE_DISPLAY_OVERLAY:
             // used to simulate secondary display devices
-            return 26;
+            return 25;
         case TYPE_DRAG:
             // the drag layer: input for drag-and-drop is associated with this window,
             // which sits above all other focusable windows
-            return 27;
+            return 26;
         case TYPE_ACCESSIBILITY_OVERLAY:
             // overlay put by accessibility services to intercept user interaction
-            return 28;
+            return 27;
         case TYPE_SECURE_SYSTEM_OVERLAY:
-            return 29;
+            return 28;
         case TYPE_BOOT_PROGRESS:
-            return 30;
+            return 29;
         case TYPE_POINTER:
             // the (mouse) pointer layer
-            return 31;
+            return 30;
         }
         Log.e(TAG, "Unknown window type: " + type);
         return 2;