Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +2 −0 Original line number Diff line number Diff line Loading @@ -1282,6 +1282,8 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange ActivityManager.RunningTaskInfo task, Rect bounds) { wct.setBounds(task.token, bounds); wct.setSmallestScreenWidthDp(task.token, getSmallestWidthDp(bounds)); wct.setScreenSizeDp(task.token, task.configuration.screenWidthDp, task.configuration.screenHeightDp); } private int getSmallestWidthDp(Rect bounds) { Loading libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java +4 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ package com.android.wm.shell.splitscreen; import static android.app.ActivityTaskManager.INVALID_TASK_ID; import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import static android.content.res.Configuration.SCREEN_HEIGHT_DP_UNDEFINED; import static android.content.res.Configuration.SCREEN_WIDTH_DP_UNDEFINED; import static android.content.res.Configuration.SMALLEST_SCREEN_WIDTH_DP_UNDEFINED; import static android.view.RemoteAnimationTarget.MODE_OPENING; Loading Loading @@ -453,6 +455,8 @@ public class StageTaskListener implements ShellTaskOrganizer.TaskListener { wct.setBounds(mRootTaskInfo.token, null); wct.setAppBounds(mRootTaskInfo.token, null); wct.setSmallestScreenWidthDp(mRootTaskInfo.token, SMALLEST_SCREEN_WIDTH_DP_UNDEFINED); wct.setScreenSizeDp(mRootTaskInfo.token, SCREEN_WIDTH_DP_UNDEFINED, SCREEN_HEIGHT_DP_UNDEFINED); } void onSplitScreenListenerRegistered(SplitScreen.SplitScreenListener listener, Loading services/core/java/com/android/server/wm/WindowOrganizerController.java +22 −5 Original line number Diff line number Diff line Loading @@ -811,13 +811,30 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub if (task != null) { if (c.screenWidthDp != SCREEN_WIDTH_DP_UNDEFINED && c.screenHeightDp != SCREEN_HEIGHT_DP_UNDEFINED) { final Rect oldBounds = container.getRequestedOverrideBounds(); final Rect newBounds = change.getConfiguration().windowConfiguration.getBounds(); if (oldBounds.width() == newBounds.width() && oldBounds.height() == newBounds.height()) { task.mOffsetXForInsets = oldBounds.left - newBounds.left; task.mOffsetYForInsets = oldBounds.top - newBounds.top; final Rect display = container.getMaxBounds(); // In two cases -- IME shift and flexible split -- the task's bounds can // temporarily exceed the display's bounds. In these cases, we want to // avoid recalculating the config (which causes an app redraw). The // below offset achieves that. Notably, to avoid affecting the launch // adjacent case (which starts offscreen), we do nothing when the task // is fully outside the display. boolean offscreen = !display.contains(newBounds) && Rect.intersects(display, newBounds); if (offscreen) { if (newBounds.top < display.top) { task.mOffsetYForInsets = display.top - newBounds.top; } else if (newBounds.bottom > display.bottom) { task.mOffsetYForInsets = display.bottom - newBounds.bottom; } if (newBounds.left < display.left) { task.mOffsetXForInsets = display.left - newBounds.left; } else if (newBounds.right > display.right) { task.mOffsetXForInsets = display.right - newBounds.right; } } else { task.mOffsetXForInsets = task.mOffsetYForInsets = 0; } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +2 −0 Original line number Diff line number Diff line Loading @@ -1282,6 +1282,8 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange ActivityManager.RunningTaskInfo task, Rect bounds) { wct.setBounds(task.token, bounds); wct.setSmallestScreenWidthDp(task.token, getSmallestWidthDp(bounds)); wct.setScreenSizeDp(task.token, task.configuration.screenWidthDp, task.configuration.screenHeightDp); } private int getSmallestWidthDp(Rect bounds) { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java +4 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ package com.android.wm.shell.splitscreen; import static android.app.ActivityTaskManager.INVALID_TASK_ID; import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import static android.content.res.Configuration.SCREEN_HEIGHT_DP_UNDEFINED; import static android.content.res.Configuration.SCREEN_WIDTH_DP_UNDEFINED; import static android.content.res.Configuration.SMALLEST_SCREEN_WIDTH_DP_UNDEFINED; import static android.view.RemoteAnimationTarget.MODE_OPENING; Loading Loading @@ -453,6 +455,8 @@ public class StageTaskListener implements ShellTaskOrganizer.TaskListener { wct.setBounds(mRootTaskInfo.token, null); wct.setAppBounds(mRootTaskInfo.token, null); wct.setSmallestScreenWidthDp(mRootTaskInfo.token, SMALLEST_SCREEN_WIDTH_DP_UNDEFINED); wct.setScreenSizeDp(mRootTaskInfo.token, SCREEN_WIDTH_DP_UNDEFINED, SCREEN_HEIGHT_DP_UNDEFINED); } void onSplitScreenListenerRegistered(SplitScreen.SplitScreenListener listener, Loading
services/core/java/com/android/server/wm/WindowOrganizerController.java +22 −5 Original line number Diff line number Diff line Loading @@ -811,13 +811,30 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub if (task != null) { if (c.screenWidthDp != SCREEN_WIDTH_DP_UNDEFINED && c.screenHeightDp != SCREEN_HEIGHT_DP_UNDEFINED) { final Rect oldBounds = container.getRequestedOverrideBounds(); final Rect newBounds = change.getConfiguration().windowConfiguration.getBounds(); if (oldBounds.width() == newBounds.width() && oldBounds.height() == newBounds.height()) { task.mOffsetXForInsets = oldBounds.left - newBounds.left; task.mOffsetYForInsets = oldBounds.top - newBounds.top; final Rect display = container.getMaxBounds(); // In two cases -- IME shift and flexible split -- the task's bounds can // temporarily exceed the display's bounds. In these cases, we want to // avoid recalculating the config (which causes an app redraw). The // below offset achieves that. Notably, to avoid affecting the launch // adjacent case (which starts offscreen), we do nothing when the task // is fully outside the display. boolean offscreen = !display.contains(newBounds) && Rect.intersects(display, newBounds); if (offscreen) { if (newBounds.top < display.top) { task.mOffsetYForInsets = display.top - newBounds.top; } else if (newBounds.bottom > display.bottom) { task.mOffsetYForInsets = display.bottom - newBounds.bottom; } if (newBounds.left < display.left) { task.mOffsetXForInsets = display.left - newBounds.left; } else if (newBounds.right > display.right) { task.mOffsetXForInsets = display.right - newBounds.right; } } else { task.mOffsetXForInsets = task.mOffsetYForInsets = 0; } Loading