summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrii Kulian <akulian@google.com>2017-08-15 17:49:24 -0700
committerAndrii Kulian <akulian@google.com>2017-08-15 18:59:14 -0700
commite3332341c34893eafbb1c3cd786f1e3779c79411 (patch)
treeea5c574c0c3109b9e624da0ee7793cda6926b646
parenta3c2cee05562838cf64e7d0946b2ea66e6541304 (diff)
downloadbase-e3332341c34893eafbb1c3cd786f1e3779c79411.tar.gz
Limit black background to only base and starting windows
Show black background behind nav bar only behind windows with type TYPE_APPLICATION_STARTING or TYPE_BASE_APPLICATION, which corresponds to main window of an activity. Bug: 64711770 Test: Go to Wallpapers app, select a static one, click "set" and check the background of the dialog. Test: Open letterboxed app, go to/from Recents. Change-Id: I42357a5df70b5dd58b422f31704c71d36074a50c
-rw-r--r--services/core/java/com/android/server/wm/SurfaceControlWithBackground.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/wm/SurfaceControlWithBackground.java b/services/core/java/com/android/server/wm/SurfaceControlWithBackground.java
index 3603f2ffeed2..b0eaf1488f21 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.Surface.OutOfResourcesException;
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 @@ class SurfaceControlWithBackground extends SurfaceControl {
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;