Loading services/core/java/com/android/server/wm/Task.java +1 −35 Original line number Diff line number Diff line Loading @@ -2197,10 +2197,6 @@ class Task extends TaskFragment { final Rect taskBounds = getBounds(); width = taskBounds.width(); height = taskBounds.height(); final int outset = getTaskOutset(); width += 2 * outset; height += 2 * outset; } if (width == mLastSurfaceSize.x && height == mLastSurfaceSize.y) { return; Loading @@ -2209,28 +2205,6 @@ class Task extends TaskFragment { mLastSurfaceSize.set(width, height); } /** * Calculate an amount by which to expand the task bounds in each direction. * Used to make room for shadows in the pinned windowing mode. */ int getTaskOutset() { // If we are drawing shadows on the task then don't outset the root task. if (mWmService.mRenderShadowsInCompositor) { return 0; } DisplayContent displayContent = getDisplayContent(); if (inPinnedWindowingMode() && displayContent != null) { final DisplayMetrics displayMetrics = displayContent.getDisplayMetrics(); // We multiply by two to match the client logic for converting view elevation // to insets, as in {@link WindowManager.LayoutParams#setSurfaceInsets} return (int) Math.ceil( mWmService.dipToPixel(PINNED_WINDOWING_MODE_ELEVATION_IN_DIP, displayMetrics) * 2); } return 0; } @VisibleForTesting Point getLastSurfaceSize() { return mLastSurfaceSize; Loading Loading @@ -4338,7 +4312,7 @@ class Task extends TaskFragment { */ private void updateShadowsRadius(boolean taskIsFocused, SurfaceControl.Transaction pendingTransaction) { if (!mWmService.mRenderShadowsInCompositor || !isRootTask()) return; if (!isRootTask()) return; final float newShadowRadius = getShadowRadius(taskIsFocused); if (mShadowRadius != newShadowRadius) { Loading Loading @@ -6015,14 +5989,6 @@ class Task extends TaskFragment { scheduleAnimation(); } @Override void getRelativePosition(Point outPos) { super.getRelativePosition(outPos); final int outset = getTaskOutset(); outPos.x -= outset; outPos.y -= outset; } private Point getRelativePosition() { Point position = new Point(); getRelativePosition(position); Loading services/core/java/com/android/server/wm/WindowManagerService.java +0 −18 Original line number Diff line number Diff line Loading @@ -462,11 +462,6 @@ public class WindowManagerService extends IWindowManager.Stub int mVr2dDisplayId = INVALID_DISPLAY; boolean mVrModeEnabled = false; /* If true, shadows drawn around the window will be rendered by the system compositor. If * false, shadows will be drawn by the client by setting an elevation on the root view and * the contents will be inset by the shadow radius. */ boolean mRenderShadowsInCompositor = false; /** * Tracks a map of input tokens to info that is used to decide whether to intercept * a key event. Loading Loading @@ -811,8 +806,6 @@ public class WindowManagerService extends IWindowManager.Stub resolver.registerContentObserver(mForceResizableUri, false, this, UserHandle.USER_ALL); resolver.registerContentObserver(mDevEnableNonResizableMultiWindowUri, false, this, UserHandle.USER_ALL); resolver.registerContentObserver(mRenderShadowsInCompositorUri, false, this, UserHandle.USER_ALL); resolver.registerContentObserver(mDisplaySettingsPathUri, false, this, UserHandle.USER_ALL); } Loading Loading @@ -853,11 +846,6 @@ public class WindowManagerService extends IWindowManager.Stub return; } if (mRenderShadowsInCompositorUri.equals(uri)) { setShadowRenderer(); return; } if (mDisplaySettingsPathUri.equals(uri)) { updateDisplaySettingsLocation(); return; Loading Loading @@ -972,11 +960,6 @@ public class WindowManagerService extends IWindowManager.Stub } } private void setShadowRenderer() { mRenderShadowsInCompositor = Settings.Global.getInt(mContext.getContentResolver(), DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR, 1) != 0; } PowerManager mPowerManager; PowerManagerInternal mPowerManagerInternal; Loading Loading @@ -1395,7 +1378,6 @@ public class WindowManagerService extends IWindowManager.Stub float[] spotColor = {0.f, 0.f, 0.f, spotShadowAlpha}; SurfaceControl.setGlobalShadowSettings(ambientColor, spotColor, lightY, lightZ, lightRadius); setShadowRenderer(); } /** Loading services/core/java/com/android/server/wm/WindowState.java +0 −11 Original line number Diff line number Diff line Loading @@ -5398,17 +5398,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP outPoint.offset(-parentBounds.left, -parentBounds.top); } Task rootTask = getRootTask(); // If we have root task outsets, that means the top-left // will be outset, and we need to inset ourselves // to account for it. If we actually have shadows we will // then un-inset ourselves by the surfaceInsets. if (rootTask != null) { final int outset = rootTask.getTaskOutset(); outPoint.offset(outset, outset); } // The surface size is larger than the window if the window has positive surface insets. transformSurfaceInsetsPosition(mTmpPoint, mAttrs.surfaceInsets); outPoint.offset(-mTmpPoint.x, -mTmpPoint.y); Loading services/tests/wmtests/src/com/android/server/wm/RootTaskTests.java +0 −29 Original line number Diff line number Diff line Loading @@ -80,7 +80,6 @@ import android.app.IApplicationThread; import android.app.WindowConfiguration; import android.content.ComponentName; import android.content.pm.ActivityInfo; import android.graphics.Rect; import android.os.Binder; import android.os.UserHandle; import android.platform.test.annotations.Presubmit; Loading Loading @@ -230,34 +229,6 @@ public class RootTaskTests extends WindowTestsBase { verify(task1, times(1)).onDisplayChanged(any()); } @Test public void testTaskOutset() { final Task task = createTask(mDisplayContent); final int taskOutset = 10; spyOn(task); doReturn(taskOutset).when(task).getTaskOutset(); doReturn(true).when(task).inMultiWindowMode(); // Mock the resolved override windowing mode to non-fullscreen final WindowConfiguration windowConfiguration = task.getResolvedOverrideConfiguration().windowConfiguration; spyOn(windowConfiguration); doReturn(WINDOWING_MODE_MULTI_WINDOW) .when(windowConfiguration).getWindowingMode(); // Prevent adjust task dimensions doNothing().when(task).adjustForMinimalTaskDimensions(any(), any(), any()); final Rect taskBounds = new Rect(200, 200, 800, 1000); // Update surface position and size by the given bounds. task.setBounds(taskBounds); assertEquals(taskBounds.width() + 2 * taskOutset, task.getLastSurfaceSize().x); assertEquals(taskBounds.height() + 2 * taskOutset, task.getLastSurfaceSize().y); assertEquals(taskBounds.left - taskOutset, task.getLastSurfacePosition().x); assertEquals(taskBounds.top - taskOutset, task.getLastSurfacePosition().y); } @Test public void testActivityAndTaskGetsProperType() { final Task task1 = new TaskBuilder(mSupervisor).build(); Loading Loading
services/core/java/com/android/server/wm/Task.java +1 −35 Original line number Diff line number Diff line Loading @@ -2197,10 +2197,6 @@ class Task extends TaskFragment { final Rect taskBounds = getBounds(); width = taskBounds.width(); height = taskBounds.height(); final int outset = getTaskOutset(); width += 2 * outset; height += 2 * outset; } if (width == mLastSurfaceSize.x && height == mLastSurfaceSize.y) { return; Loading @@ -2209,28 +2205,6 @@ class Task extends TaskFragment { mLastSurfaceSize.set(width, height); } /** * Calculate an amount by which to expand the task bounds in each direction. * Used to make room for shadows in the pinned windowing mode. */ int getTaskOutset() { // If we are drawing shadows on the task then don't outset the root task. if (mWmService.mRenderShadowsInCompositor) { return 0; } DisplayContent displayContent = getDisplayContent(); if (inPinnedWindowingMode() && displayContent != null) { final DisplayMetrics displayMetrics = displayContent.getDisplayMetrics(); // We multiply by two to match the client logic for converting view elevation // to insets, as in {@link WindowManager.LayoutParams#setSurfaceInsets} return (int) Math.ceil( mWmService.dipToPixel(PINNED_WINDOWING_MODE_ELEVATION_IN_DIP, displayMetrics) * 2); } return 0; } @VisibleForTesting Point getLastSurfaceSize() { return mLastSurfaceSize; Loading Loading @@ -4338,7 +4312,7 @@ class Task extends TaskFragment { */ private void updateShadowsRadius(boolean taskIsFocused, SurfaceControl.Transaction pendingTransaction) { if (!mWmService.mRenderShadowsInCompositor || !isRootTask()) return; if (!isRootTask()) return; final float newShadowRadius = getShadowRadius(taskIsFocused); if (mShadowRadius != newShadowRadius) { Loading Loading @@ -6015,14 +5989,6 @@ class Task extends TaskFragment { scheduleAnimation(); } @Override void getRelativePosition(Point outPos) { super.getRelativePosition(outPos); final int outset = getTaskOutset(); outPos.x -= outset; outPos.y -= outset; } private Point getRelativePosition() { Point position = new Point(); getRelativePosition(position); Loading
services/core/java/com/android/server/wm/WindowManagerService.java +0 −18 Original line number Diff line number Diff line Loading @@ -462,11 +462,6 @@ public class WindowManagerService extends IWindowManager.Stub int mVr2dDisplayId = INVALID_DISPLAY; boolean mVrModeEnabled = false; /* If true, shadows drawn around the window will be rendered by the system compositor. If * false, shadows will be drawn by the client by setting an elevation on the root view and * the contents will be inset by the shadow radius. */ boolean mRenderShadowsInCompositor = false; /** * Tracks a map of input tokens to info that is used to decide whether to intercept * a key event. Loading Loading @@ -811,8 +806,6 @@ public class WindowManagerService extends IWindowManager.Stub resolver.registerContentObserver(mForceResizableUri, false, this, UserHandle.USER_ALL); resolver.registerContentObserver(mDevEnableNonResizableMultiWindowUri, false, this, UserHandle.USER_ALL); resolver.registerContentObserver(mRenderShadowsInCompositorUri, false, this, UserHandle.USER_ALL); resolver.registerContentObserver(mDisplaySettingsPathUri, false, this, UserHandle.USER_ALL); } Loading Loading @@ -853,11 +846,6 @@ public class WindowManagerService extends IWindowManager.Stub return; } if (mRenderShadowsInCompositorUri.equals(uri)) { setShadowRenderer(); return; } if (mDisplaySettingsPathUri.equals(uri)) { updateDisplaySettingsLocation(); return; Loading Loading @@ -972,11 +960,6 @@ public class WindowManagerService extends IWindowManager.Stub } } private void setShadowRenderer() { mRenderShadowsInCompositor = Settings.Global.getInt(mContext.getContentResolver(), DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR, 1) != 0; } PowerManager mPowerManager; PowerManagerInternal mPowerManagerInternal; Loading Loading @@ -1395,7 +1378,6 @@ public class WindowManagerService extends IWindowManager.Stub float[] spotColor = {0.f, 0.f, 0.f, spotShadowAlpha}; SurfaceControl.setGlobalShadowSettings(ambientColor, spotColor, lightY, lightZ, lightRadius); setShadowRenderer(); } /** Loading
services/core/java/com/android/server/wm/WindowState.java +0 −11 Original line number Diff line number Diff line Loading @@ -5398,17 +5398,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP outPoint.offset(-parentBounds.left, -parentBounds.top); } Task rootTask = getRootTask(); // If we have root task outsets, that means the top-left // will be outset, and we need to inset ourselves // to account for it. If we actually have shadows we will // then un-inset ourselves by the surfaceInsets. if (rootTask != null) { final int outset = rootTask.getTaskOutset(); outPoint.offset(outset, outset); } // The surface size is larger than the window if the window has positive surface insets. transformSurfaceInsetsPosition(mTmpPoint, mAttrs.surfaceInsets); outPoint.offset(-mTmpPoint.x, -mTmpPoint.y); Loading
services/tests/wmtests/src/com/android/server/wm/RootTaskTests.java +0 −29 Original line number Diff line number Diff line Loading @@ -80,7 +80,6 @@ import android.app.IApplicationThread; import android.app.WindowConfiguration; import android.content.ComponentName; import android.content.pm.ActivityInfo; import android.graphics.Rect; import android.os.Binder; import android.os.UserHandle; import android.platform.test.annotations.Presubmit; Loading Loading @@ -230,34 +229,6 @@ public class RootTaskTests extends WindowTestsBase { verify(task1, times(1)).onDisplayChanged(any()); } @Test public void testTaskOutset() { final Task task = createTask(mDisplayContent); final int taskOutset = 10; spyOn(task); doReturn(taskOutset).when(task).getTaskOutset(); doReturn(true).when(task).inMultiWindowMode(); // Mock the resolved override windowing mode to non-fullscreen final WindowConfiguration windowConfiguration = task.getResolvedOverrideConfiguration().windowConfiguration; spyOn(windowConfiguration); doReturn(WINDOWING_MODE_MULTI_WINDOW) .when(windowConfiguration).getWindowingMode(); // Prevent adjust task dimensions doNothing().when(task).adjustForMinimalTaskDimensions(any(), any(), any()); final Rect taskBounds = new Rect(200, 200, 800, 1000); // Update surface position and size by the given bounds. task.setBounds(taskBounds); assertEquals(taskBounds.width() + 2 * taskOutset, task.getLastSurfaceSize().x); assertEquals(taskBounds.height() + 2 * taskOutset, task.getLastSurfaceSize().y); assertEquals(taskBounds.left - taskOutset, task.getLastSurfacePosition().x); assertEquals(taskBounds.top - taskOutset, task.getLastSurfacePosition().y); } @Test public void testActivityAndTaskGetsProperType() { final Task task1 = new TaskBuilder(mSupervisor).build(); Loading