Loading services/java/com/android/server/wm/DimLayer.java +27 −16 Original line number Diff line number Diff line Loading @@ -48,9 +48,13 @@ public class DimLayer { /** Time in milliseconds to take to transition from mStartAlpha to mTargetAlpha */ long mDuration; DimLayer(WindowManagerService service, DisplayContent displayContent) { mDisplayContent = displayContent; final int displayId = displayContent.getDisplayId(); /** Owning stack */ final TaskStack mStack; DimLayer(WindowManagerService service, TaskStack stack) { mStack = stack; mDisplayContent = stack.getDisplayContent(); final int displayId = mDisplayContent.getDisplayId(); if (DEBUG) Slog.v(TAG, "Ctor: displayId=" + displayId); SurfaceControl.openTransaction(); try { Loading Loading @@ -160,22 +164,29 @@ public class DimLayer { return; } /* final int dw, dh; final float xPos, yPos; if (mStack.hasSibling()) { dw = mBounds.width(); dh = mBounds.height(); xPos = mBounds.left; yPos = mBounds.right; } else { // Set surface size to screen size. final DisplayInfo info = mDisplayContent.getDisplayInfo(); // Multiply by 1.5 so that rotating a frozen surface that includes this does not expose a // corner. final int dw = (int) (info.logicalWidth * 1.5); final int dh = (int) (info.logicalHeight * 1.5); dw = (int) (info.logicalWidth * 1.5); dh = (int) (info.logicalHeight * 1.5); // back off position so 1/4 of Surface is before and 1/4 is after. final float xPos = -1 * dw / 6; final float yPos = -1 * dh / 6; */ xPos = -1 * dw / 6; yPos = -1 * dh / 6; } if (!mLastBounds.equals(mBounds) || mLayer != layer) { try { mDimSurface.setPosition(mBounds.left, mBounds.top); mDimSurface.setSize(mBounds.width(), mBounds.height()); mDimSurface.setPosition(xPos, yPos); mDimSurface.setSize(dw, dh); mDimSurface.setLayer(layer); } catch (RuntimeException e) { Slog.w(TAG, "Failure setting size or layer", e); Loading services/java/com/android/server/wm/TaskStack.java +2 −2 Original line number Diff line number Diff line Loading @@ -71,8 +71,8 @@ public class TaskStack { mStackId = stackId; mDisplayContent = displayContent; final int displayId = displayContent.getDisplayId(); mDimLayer = new DimLayer(service, displayContent); mAnimationBackgroundSurface = new DimLayer(service, displayContent); mDimLayer = new DimLayer(service, this); mAnimationBackgroundSurface = new DimLayer(service, this); } DisplayContent getDisplayContent() { Loading Loading
services/java/com/android/server/wm/DimLayer.java +27 −16 Original line number Diff line number Diff line Loading @@ -48,9 +48,13 @@ public class DimLayer { /** Time in milliseconds to take to transition from mStartAlpha to mTargetAlpha */ long mDuration; DimLayer(WindowManagerService service, DisplayContent displayContent) { mDisplayContent = displayContent; final int displayId = displayContent.getDisplayId(); /** Owning stack */ final TaskStack mStack; DimLayer(WindowManagerService service, TaskStack stack) { mStack = stack; mDisplayContent = stack.getDisplayContent(); final int displayId = mDisplayContent.getDisplayId(); if (DEBUG) Slog.v(TAG, "Ctor: displayId=" + displayId); SurfaceControl.openTransaction(); try { Loading Loading @@ -160,22 +164,29 @@ public class DimLayer { return; } /* final int dw, dh; final float xPos, yPos; if (mStack.hasSibling()) { dw = mBounds.width(); dh = mBounds.height(); xPos = mBounds.left; yPos = mBounds.right; } else { // Set surface size to screen size. final DisplayInfo info = mDisplayContent.getDisplayInfo(); // Multiply by 1.5 so that rotating a frozen surface that includes this does not expose a // corner. final int dw = (int) (info.logicalWidth * 1.5); final int dh = (int) (info.logicalHeight * 1.5); dw = (int) (info.logicalWidth * 1.5); dh = (int) (info.logicalHeight * 1.5); // back off position so 1/4 of Surface is before and 1/4 is after. final float xPos = -1 * dw / 6; final float yPos = -1 * dh / 6; */ xPos = -1 * dw / 6; yPos = -1 * dh / 6; } if (!mLastBounds.equals(mBounds) || mLayer != layer) { try { mDimSurface.setPosition(mBounds.left, mBounds.top); mDimSurface.setSize(mBounds.width(), mBounds.height()); mDimSurface.setPosition(xPos, yPos); mDimSurface.setSize(dw, dh); mDimSurface.setLayer(layer); } catch (RuntimeException e) { Slog.w(TAG, "Failure setting size or layer", e); Loading
services/java/com/android/server/wm/TaskStack.java +2 −2 Original line number Diff line number Diff line Loading @@ -71,8 +71,8 @@ public class TaskStack { mStackId = stackId; mDisplayContent = displayContent; final int displayId = displayContent.getDisplayId(); mDimLayer = new DimLayer(service, displayContent); mAnimationBackgroundSurface = new DimLayer(service, displayContent); mDimLayer = new DimLayer(service, this); mAnimationBackgroundSurface = new DimLayer(service, this); } DisplayContent getDisplayContent() { Loading