Merge "Limit black background to only base and starting windows" into oc-dr1-dev am: 44cab75cb0 am: 68f48673c7
am: 992e299ec2

Change-Id: I7f554d9e7739f18d0b27a72cd5bc5d7be24196af
diff --git a/services/core/java/com/android/server/wm/SurfaceControlWithBackground.java b/services/core/java/com/android/server/wm/SurfaceControlWithBackground.java
index 3603f2f..b0eaf14 100644
--- a/services/core/java/com/android/server/wm/SurfaceControlWithBackground.java
+++ b/services/core/java/com/android/server/wm/SurfaceControlWithBackground.java
@@ -26,9 +26,8 @@
 import android.view.SurfaceControl;
 import android.view.SurfaceSession;
 
-import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
-import static android.view.WindowManager.LayoutParams.LAST_APPLICATION_WINDOW;
 import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
+import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
 import static android.view.WindowManagerPolicy.NAV_BAR_BOTTOM;
 import static android.view.WindowManagerPolicy.NAV_BAR_LEFT;
 import static android.view.WindowManagerPolicy.NAV_BAR_RIGHT;
@@ -73,9 +72,8 @@
         super(s, name, w, h, format, flags, windowType, ownerUid);
 
         // We should only show background behind app windows that are letterboxed in a task.
-        if (!windowSurfaceController.mAnimator.mWin.isLetterboxedAppWindow()
-                || windowType < FIRST_APPLICATION_WINDOW
-                || windowType > LAST_APPLICATION_WINDOW) {
+        if ((windowType != TYPE_BASE_APPLICATION && windowType != TYPE_APPLICATION_STARTING)
+                || !windowSurfaceController.mAnimator.mWin.isLetterboxedAppWindow()) {
             return;
         }
         mWindowSurfaceController = windowSurfaceController;