Loading services/java/com/android/server/wm/DimLayer.java +3 −2 Original line number Diff line number Diff line Loading @@ -48,9 +48,10 @@ public class DimLayer { /** Time in milliseconds to take to transition from mStartAlpha to mTargetAlpha */ long mDuration; DimLayer(WindowManagerService service, int displayId) { DimLayer(WindowManagerService service, DisplayContent displayContent) { mDisplayContent = displayContent; final int displayId = displayContent.getDisplayId(); if (DEBUG) Slog.v(TAG, "Ctor: displayId=" + displayId); mDisplayContent = service.getDisplayContentLocked(displayId); SurfaceControl.openTransaction(); try { if (WindowManagerService.DEBUG_SURFACE_TRACE) { Loading services/java/com/android/server/wm/DisplayContent.java +19 −15 Original line number Diff line number Diff line Loading @@ -111,14 +111,25 @@ class DisplayContent { /** Save allocating when calculating rects */ Rect mTmpRect = new Rect(); final WindowManagerService mService; /** * @param display May not be null. * @param service TODO(cmautner): */ DisplayContent(Display display) { DisplayContent(Display display, WindowManagerService service) { mDisplay = display; mDisplayId = display.getDisplayId(); display.getDisplayInfo(mDisplayInfo); isDefaultDisplay = mDisplayId == Display.DEFAULT_DISPLAY; mService = service; StackBox newBox = new StackBox(service, this, null); mStackBoxes.add(newBox); TaskStack newStack = new TaskStack(service, HOME_STACK_ID, this); newStack.mStackBox = newBox; newBox.mStack = newStack; mHomeStack = newStack; } int getDisplayId() { Loading Loading @@ -201,22 +212,15 @@ class DisplayContent { } /** Refer to {@link WindowManagerService#createStack(int, int, int, float)} */ TaskStack createStack(WindowManagerService service, int stackId, int relativeStackBoxId, int position, float weight) { TaskStack createStack(int stackId, int relativeStackBoxId, int position, float weight) { TaskStack newStack = null; if (DEBUG_STACK) Slog.d(TAG, "createStack: stackId=" + stackId + " relativeStackBoxId=" + relativeStackBoxId + " position=" + position + " weight=" + weight); if (mStackBoxes.isEmpty()) { if (stackId != HOME_STACK_ID) { throw new IllegalArgumentException("createStack: First stackId not " + HOME_STACK_ID); if (stackId == HOME_STACK_ID) { if (mStackBoxes.size() != 1) { throw new IllegalArgumentException("createStack: HOME_STACK_ID (0) not first."); } StackBox newBox = new StackBox(service, this, null); mStackBoxes.add(newBox); newStack = new TaskStack(service, stackId, this); newStack.mStackBox = newBox; newBox.mStack = newStack; mHomeStack = newStack; newStack = mHomeStack; } else { int stackBoxNdx; for (stackBoxNdx = mStackBoxes.size() - 1; stackBoxNdx >= 0; --stackBoxNdx) { Loading @@ -225,8 +229,8 @@ class DisplayContent { || position == StackBox.TASK_STACK_GOES_UNDER) { // Position indicates a new box is added at top level only. if (box.contains(relativeStackBoxId)) { StackBox newBox = new StackBox(service, this, null); newStack = new TaskStack(service, stackId, this); StackBox newBox = new StackBox(mService, this, null); newStack = new TaskStack(mService, stackId, this); newStack.mStackBox = newBox; newBox.mStack = newStack; final int offset = position == StackBox.TASK_STACK_GOES_OVER ? 1 : 0; 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, displayId); mAnimationBackgroundSurface = new DimLayer(service, displayId); mDimLayer = new DimLayer(service, displayContent); mAnimationBackgroundSurface = new DimLayer(service, displayContent); } DisplayContent getDisplayContent() { Loading services/java/com/android/server/wm/WindowManagerService.java +3 −3 Original line number Diff line number Diff line Loading @@ -4832,8 +4832,8 @@ public class WindowManagerService extends IWindowManager.Stub final int numDisplays = mDisplayContents.size(); for (int displayNdx = 0; displayNdx < numDisplays; ++displayNdx) { final DisplayContent displayContent = mDisplayContents.valueAt(displayNdx); TaskStack stack = displayContent.createStack(this, stackId, relativeStackBoxId, position, weight); TaskStack stack = displayContent.createStack(stackId, relativeStackBoxId, position, weight); if (stack != null) { mStackIdToStack.put(stackId, stack); displayContent.moveStack(stack, true); Loading Loading @@ -10716,7 +10716,7 @@ public class WindowManagerService extends IWindowManager.Stub } private DisplayContent newDisplayContentLocked(final Display display) { DisplayContent displayContent = new DisplayContent(display); DisplayContent displayContent = new DisplayContent(display, this); final int displayId = display.getDisplayId(); mDisplayContents.put(displayId, displayContent); final Rect rect = new Rect(); Loading Loading
services/java/com/android/server/wm/DimLayer.java +3 −2 Original line number Diff line number Diff line Loading @@ -48,9 +48,10 @@ public class DimLayer { /** Time in milliseconds to take to transition from mStartAlpha to mTargetAlpha */ long mDuration; DimLayer(WindowManagerService service, int displayId) { DimLayer(WindowManagerService service, DisplayContent displayContent) { mDisplayContent = displayContent; final int displayId = displayContent.getDisplayId(); if (DEBUG) Slog.v(TAG, "Ctor: displayId=" + displayId); mDisplayContent = service.getDisplayContentLocked(displayId); SurfaceControl.openTransaction(); try { if (WindowManagerService.DEBUG_SURFACE_TRACE) { Loading
services/java/com/android/server/wm/DisplayContent.java +19 −15 Original line number Diff line number Diff line Loading @@ -111,14 +111,25 @@ class DisplayContent { /** Save allocating when calculating rects */ Rect mTmpRect = new Rect(); final WindowManagerService mService; /** * @param display May not be null. * @param service TODO(cmautner): */ DisplayContent(Display display) { DisplayContent(Display display, WindowManagerService service) { mDisplay = display; mDisplayId = display.getDisplayId(); display.getDisplayInfo(mDisplayInfo); isDefaultDisplay = mDisplayId == Display.DEFAULT_DISPLAY; mService = service; StackBox newBox = new StackBox(service, this, null); mStackBoxes.add(newBox); TaskStack newStack = new TaskStack(service, HOME_STACK_ID, this); newStack.mStackBox = newBox; newBox.mStack = newStack; mHomeStack = newStack; } int getDisplayId() { Loading Loading @@ -201,22 +212,15 @@ class DisplayContent { } /** Refer to {@link WindowManagerService#createStack(int, int, int, float)} */ TaskStack createStack(WindowManagerService service, int stackId, int relativeStackBoxId, int position, float weight) { TaskStack createStack(int stackId, int relativeStackBoxId, int position, float weight) { TaskStack newStack = null; if (DEBUG_STACK) Slog.d(TAG, "createStack: stackId=" + stackId + " relativeStackBoxId=" + relativeStackBoxId + " position=" + position + " weight=" + weight); if (mStackBoxes.isEmpty()) { if (stackId != HOME_STACK_ID) { throw new IllegalArgumentException("createStack: First stackId not " + HOME_STACK_ID); if (stackId == HOME_STACK_ID) { if (mStackBoxes.size() != 1) { throw new IllegalArgumentException("createStack: HOME_STACK_ID (0) not first."); } StackBox newBox = new StackBox(service, this, null); mStackBoxes.add(newBox); newStack = new TaskStack(service, stackId, this); newStack.mStackBox = newBox; newBox.mStack = newStack; mHomeStack = newStack; newStack = mHomeStack; } else { int stackBoxNdx; for (stackBoxNdx = mStackBoxes.size() - 1; stackBoxNdx >= 0; --stackBoxNdx) { Loading @@ -225,8 +229,8 @@ class DisplayContent { || position == StackBox.TASK_STACK_GOES_UNDER) { // Position indicates a new box is added at top level only. if (box.contains(relativeStackBoxId)) { StackBox newBox = new StackBox(service, this, null); newStack = new TaskStack(service, stackId, this); StackBox newBox = new StackBox(mService, this, null); newStack = new TaskStack(mService, stackId, this); newStack.mStackBox = newBox; newBox.mStack = newStack; final int offset = position == StackBox.TASK_STACK_GOES_OVER ? 1 : 0; 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, displayId); mAnimationBackgroundSurface = new DimLayer(service, displayId); mDimLayer = new DimLayer(service, displayContent); mAnimationBackgroundSurface = new DimLayer(service, displayContent); } DisplayContent getDisplayContent() { Loading
services/java/com/android/server/wm/WindowManagerService.java +3 −3 Original line number Diff line number Diff line Loading @@ -4832,8 +4832,8 @@ public class WindowManagerService extends IWindowManager.Stub final int numDisplays = mDisplayContents.size(); for (int displayNdx = 0; displayNdx < numDisplays; ++displayNdx) { final DisplayContent displayContent = mDisplayContents.valueAt(displayNdx); TaskStack stack = displayContent.createStack(this, stackId, relativeStackBoxId, position, weight); TaskStack stack = displayContent.createStack(stackId, relativeStackBoxId, position, weight); if (stack != null) { mStackIdToStack.put(stackId, stack); displayContent.moveStack(stack, true); Loading Loading @@ -10716,7 +10716,7 @@ public class WindowManagerService extends IWindowManager.Stub } private DisplayContent newDisplayContentLocked(final Display display) { DisplayContent displayContent = new DisplayContent(display); DisplayContent displayContent = new DisplayContent(display, this); final int displayId = display.getDisplayId(); mDisplayContents.put(displayId, displayContent); final Rect rect = new Rect(); Loading