From a86a6bf73e8f6e58590c1b53972cd2d1cc7c137f Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Fri, 8 Apr 2016 17:34:16 -0700 Subject: [PATCH] Fix Task dim with docked resize. When are are docked resizing, just fake the task bounds as the stack bounds for the purposes of DimLayers, even if we don't want to relayout the application interactively we want the DimLayer to keep up with the divider. Bug: 28154322 Change-Id: I86e41324cf384f2dceea15cd5e8ddd753dc5bfbd --- .../core/java/com/android/server/wm/Task.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java index 7b16dbec68a5f..ce82dbe09a979 100644 --- a/services/core/java/com/android/server/wm/Task.java +++ b/services/core/java/com/android/server/wm/Task.java @@ -456,6 +456,11 @@ class Task implements DimLayer.DimLayerUser { /** Bounds of the task to be used for dimming, as well as touch related tests. */ @Override public void getDimBounds(Rect out) { + final DisplayContent displayContent = mStack.getDisplayContent(); + // It doesn't matter if we in particular are part of the resize, since we couldn't have + // a DimLayer anyway if we weren't visible. + final boolean dockedResizing = displayContent != null ? + displayContent.mDividerControllerLocked.isResizing() : false; if (useCurrentBounds()) { if (inFreeformWorkspace() && getMaxVisibleBounds(out)) { return; @@ -464,8 +469,16 @@ class Task implements DimLayer.DimLayerUser { if (!mFullscreen) { // When minimizing the docked stack when going home, we don't adjust the task bounds // so we need to intersect the task bounds with the stack bounds here. - mStack.getBounds(mTmpRect); - mTmpRect.intersect(mBounds); + // + // If we are Docked Resizing with snap points, the task bounds could be smaller than the stack + // bounds and so we don't even want to use them. Even if the app should not be resized the Dim + // should keep up with the divider. + if (dockedResizing) { + mStack.getBounds(out); + } else { + mStack.getBounds(mTmpRect); + mTmpRect.intersect(mBounds); + } out.set(mTmpRect); } else { out.set(mBounds); @@ -476,7 +489,7 @@ class Task implements DimLayer.DimLayerUser { // The bounds has been adjusted to accommodate for a docked stack, but the docked stack // is not currently visible. Go ahead a represent it as fullscreen to the rest of the // system. - mStack.getDisplayContent().getLogicalDisplayRect(out); + displayContent.getLogicalDisplayRect(out); } void setDragResizing(boolean dragResizing, int dragResizeMode) {