Loading services/core/java/com/android/server/am/ActivityDisplay.java +2 −15 Original line number Diff line number Diff line Loading @@ -50,9 +50,7 @@ import android.util.proto.ProtoOutputStream; import android.view.Display; import com.android.internal.annotations.VisibleForTesting; import com.android.server.wm.ConfigurationContainer; import com.android.server.wm.DisplayWindowController; import com.android.server.wm.WindowContainerListener; import java.io.PrintWriter; import java.util.ArrayList; Loading @@ -60,8 +58,7 @@ import java.util.ArrayList; * Exactly one of these classes per Display in the system. Capable of holding zero or more * attached {@link ActivityStack}s. */ class ActivityDisplay extends ConfigurationContainer<ActivityStack> implements WindowContainerListener { class ActivityDisplay extends ConfigurationContainer<ActivityStack> { private static final String TAG = TAG_WITH_CLASS_NAME ? "ActivityDisplay" : TAG_AM; private static final String TAG_STACK = TAG + POSTFIX_STACK; Loading Loading @@ -103,8 +100,6 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> // Used in updating the display size private Point mTmpDisplaySize = new Point(); private DisplayWindowController mWindowContainerController; ActivityDisplay(ActivityStackSupervisor supervisor, int displayId) { mSupervisor = supervisor; mDisplayId = displayId; Loading @@ -113,15 +108,10 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> throw new IllegalStateException("Display does not exist displayId=" + displayId); } mDisplay = display; mWindowContainerController = createWindowContainerController(); updateBounds(); } protected DisplayWindowController createWindowContainerController() { return new DisplayWindowController(mDisplayId, this); } void updateBounds() { mDisplay.getSize(mTmpDisplaySize); setBounds(0, 0, mTmpDisplaySize.x, mTmpDisplaySize.y); Loading Loading @@ -158,10 +148,7 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> private void positionChildAt(ActivityStack stack, int position) { mStacks.remove(stack); final int insertPosition = getTopInsertPosition(stack, position); mStacks.add(insertPosition, stack); mWindowContainerController.positionChildAt(stack.getWindowContainerController(), insertPosition); mStacks.add(getTopInsertPosition(stack, position), stack); } private int getTopInsertPosition(ActivityStack stack, int candidatePosition) { Loading services/core/java/com/android/server/am/ActivityStack.java +12 −0 Original line number Diff line number Diff line Loading @@ -994,6 +994,12 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai insertTaskAtTop(task, null); return; } task = topTask(); if (task != null) { mWindowContainerController.positionChildAtTop(task.getWindowContainerController(), true /* includingParents */); } } /** Loading @@ -1018,6 +1024,12 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai if (task != null) { insertTaskAtBottom(task); return; } else { task = bottomTask(); if (task != null) { mWindowContainerController.positionChildAtBottom( task.getWindowContainerController(), true /* includingParents */); } } } Loading services/core/java/com/android/server/wm/DisplayContent.java +0 −5 Original line number Diff line number Diff line Loading @@ -1802,11 +1802,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo getParent().positionChildAt(position, this, includingParents); } void positionStackAt(int position, TaskStack child) { mTaskStackContainers.positionChildAt(position, child, false /* includingParents */); layoutAndAssignWindowLayersIfNeeded(); } int taskIdFromPoint(int x, int y) { for (int stackNdx = mTaskStackContainers.getChildCount() - 1; stackNdx >= 0; --stackNdx) { final TaskStack stack = mTaskStackContainers.getChildAt(stackNdx); Loading services/core/java/com/android/server/wm/DisplayWindowController.javadeleted 100644 → 0 +0 −85 Original line number Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License */ package com.android.server.wm; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STACK; import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import android.content.res.Configuration; import android.util.Slog; /** * Controller for the display container. This is created by activity manager to link activity * displays to the display content they use in window manager. */ public class DisplayWindowController extends WindowContainerController<DisplayContent, WindowContainerListener> { private final int mDisplayId; public DisplayWindowController(int displayId, WindowContainerListener listener) { super(listener, WindowManagerService.getInstance()); mDisplayId = displayId; synchronized (mWindowMap) { // TODO: Convert to setContainer() from DisplayContent once everything is hooked up. // Currently we are not setup to register for config changes. mContainer = mRoot.getDisplayContentOrCreate(displayId); if (mContainer == null) { throw new IllegalArgumentException("Trying to add displayId=" + displayId); } } } @Override public void removeContainer() { // TODO: Pipe through from ActivityDisplay to remove the display throw new UnsupportedOperationException("To be implemented"); } @Override public void onOverrideConfigurationChanged(Configuration overrideConfiguration) { // TODO: Pipe through from ActivityDisplay to update the configuration for the display throw new UnsupportedOperationException("To be implemented"); } /** * Positions the task stack at the given position in the task stack container. */ public void positionChildAt(StackWindowController child, int position) { synchronized (mWindowMap) { if (DEBUG_STACK) Slog.i(TAG_WM, "positionTaskStackAt: positioning stack=" + child + " at " + position); if (mContainer == null) { if (DEBUG_STACK) Slog.i(TAG_WM, "positionTaskStackAt: could not find display=" + mContainer); return; } if (child.mContainer == null) { if (DEBUG_STACK) Slog.i(TAG_WM, "positionTaskStackAt: could not find stack=" + this); return; } mContainer.positionStackAt(position, child.mContainer); } } @Override public String toString() { return "{DisplayWindowController displayId=" + mDisplayId + "}"; } } services/tests/servicestests/src/com/android/server/am/ActivityTestsBase.java +1 −7 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import static org.mockito.Mockito.anyInt; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.spy; import com.android.server.wm.DisplayWindowController; import org.mockito.invocation.InvocationOnMock; import android.app.IApplicationThread; Loading Loading @@ -346,7 +345,7 @@ public class ActivityTestsBase { } } protected static class TestActivityDisplay extends ActivityDisplay { private static class TestActivityDisplay extends ActivityDisplay { private final ActivityStackSupervisor mSupervisor; TestActivityDisplay(ActivityStackSupervisor supervisor, int displayId) { Loading Loading @@ -375,11 +374,6 @@ public class ActivityTestsBase { this, stackId, mSupervisor, windowingMode, activityType, onTop); } } @Override protected DisplayWindowController createWindowContainerController() { return mock(DisplayWindowController.class); } } private static WindowManagerService prepareMockWindowManager() { Loading Loading
services/core/java/com/android/server/am/ActivityDisplay.java +2 −15 Original line number Diff line number Diff line Loading @@ -50,9 +50,7 @@ import android.util.proto.ProtoOutputStream; import android.view.Display; import com.android.internal.annotations.VisibleForTesting; import com.android.server.wm.ConfigurationContainer; import com.android.server.wm.DisplayWindowController; import com.android.server.wm.WindowContainerListener; import java.io.PrintWriter; import java.util.ArrayList; Loading @@ -60,8 +58,7 @@ import java.util.ArrayList; * Exactly one of these classes per Display in the system. Capable of holding zero or more * attached {@link ActivityStack}s. */ class ActivityDisplay extends ConfigurationContainer<ActivityStack> implements WindowContainerListener { class ActivityDisplay extends ConfigurationContainer<ActivityStack> { private static final String TAG = TAG_WITH_CLASS_NAME ? "ActivityDisplay" : TAG_AM; private static final String TAG_STACK = TAG + POSTFIX_STACK; Loading Loading @@ -103,8 +100,6 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> // Used in updating the display size private Point mTmpDisplaySize = new Point(); private DisplayWindowController mWindowContainerController; ActivityDisplay(ActivityStackSupervisor supervisor, int displayId) { mSupervisor = supervisor; mDisplayId = displayId; Loading @@ -113,15 +108,10 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> throw new IllegalStateException("Display does not exist displayId=" + displayId); } mDisplay = display; mWindowContainerController = createWindowContainerController(); updateBounds(); } protected DisplayWindowController createWindowContainerController() { return new DisplayWindowController(mDisplayId, this); } void updateBounds() { mDisplay.getSize(mTmpDisplaySize); setBounds(0, 0, mTmpDisplaySize.x, mTmpDisplaySize.y); Loading Loading @@ -158,10 +148,7 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> private void positionChildAt(ActivityStack stack, int position) { mStacks.remove(stack); final int insertPosition = getTopInsertPosition(stack, position); mStacks.add(insertPosition, stack); mWindowContainerController.positionChildAt(stack.getWindowContainerController(), insertPosition); mStacks.add(getTopInsertPosition(stack, position), stack); } private int getTopInsertPosition(ActivityStack stack, int candidatePosition) { Loading
services/core/java/com/android/server/am/ActivityStack.java +12 −0 Original line number Diff line number Diff line Loading @@ -994,6 +994,12 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai insertTaskAtTop(task, null); return; } task = topTask(); if (task != null) { mWindowContainerController.positionChildAtTop(task.getWindowContainerController(), true /* includingParents */); } } /** Loading @@ -1018,6 +1024,12 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai if (task != null) { insertTaskAtBottom(task); return; } else { task = bottomTask(); if (task != null) { mWindowContainerController.positionChildAtBottom( task.getWindowContainerController(), true /* includingParents */); } } } Loading
services/core/java/com/android/server/wm/DisplayContent.java +0 −5 Original line number Diff line number Diff line Loading @@ -1802,11 +1802,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo getParent().positionChildAt(position, this, includingParents); } void positionStackAt(int position, TaskStack child) { mTaskStackContainers.positionChildAt(position, child, false /* includingParents */); layoutAndAssignWindowLayersIfNeeded(); } int taskIdFromPoint(int x, int y) { for (int stackNdx = mTaskStackContainers.getChildCount() - 1; stackNdx >= 0; --stackNdx) { final TaskStack stack = mTaskStackContainers.getChildAt(stackNdx); Loading
services/core/java/com/android/server/wm/DisplayWindowController.javadeleted 100644 → 0 +0 −85 Original line number Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License */ package com.android.server.wm; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STACK; import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import android.content.res.Configuration; import android.util.Slog; /** * Controller for the display container. This is created by activity manager to link activity * displays to the display content they use in window manager. */ public class DisplayWindowController extends WindowContainerController<DisplayContent, WindowContainerListener> { private final int mDisplayId; public DisplayWindowController(int displayId, WindowContainerListener listener) { super(listener, WindowManagerService.getInstance()); mDisplayId = displayId; synchronized (mWindowMap) { // TODO: Convert to setContainer() from DisplayContent once everything is hooked up. // Currently we are not setup to register for config changes. mContainer = mRoot.getDisplayContentOrCreate(displayId); if (mContainer == null) { throw new IllegalArgumentException("Trying to add displayId=" + displayId); } } } @Override public void removeContainer() { // TODO: Pipe through from ActivityDisplay to remove the display throw new UnsupportedOperationException("To be implemented"); } @Override public void onOverrideConfigurationChanged(Configuration overrideConfiguration) { // TODO: Pipe through from ActivityDisplay to update the configuration for the display throw new UnsupportedOperationException("To be implemented"); } /** * Positions the task stack at the given position in the task stack container. */ public void positionChildAt(StackWindowController child, int position) { synchronized (mWindowMap) { if (DEBUG_STACK) Slog.i(TAG_WM, "positionTaskStackAt: positioning stack=" + child + " at " + position); if (mContainer == null) { if (DEBUG_STACK) Slog.i(TAG_WM, "positionTaskStackAt: could not find display=" + mContainer); return; } if (child.mContainer == null) { if (DEBUG_STACK) Slog.i(TAG_WM, "positionTaskStackAt: could not find stack=" + this); return; } mContainer.positionStackAt(position, child.mContainer); } } @Override public String toString() { return "{DisplayWindowController displayId=" + mDisplayId + "}"; } }
services/tests/servicestests/src/com/android/server/am/ActivityTestsBase.java +1 −7 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import static org.mockito.Mockito.anyInt; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.spy; import com.android.server.wm.DisplayWindowController; import org.mockito.invocation.InvocationOnMock; import android.app.IApplicationThread; Loading Loading @@ -346,7 +345,7 @@ public class ActivityTestsBase { } } protected static class TestActivityDisplay extends ActivityDisplay { private static class TestActivityDisplay extends ActivityDisplay { private final ActivityStackSupervisor mSupervisor; TestActivityDisplay(ActivityStackSupervisor supervisor, int displayId) { Loading Loading @@ -375,11 +374,6 @@ public class ActivityTestsBase { this, stackId, mSupervisor, windowingMode, activityType, onTop); } } @Override protected DisplayWindowController createWindowContainerController() { return mock(DisplayWindowController.class); } } private static WindowManagerService prepareMockWindowManager() { Loading