Loading packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +7 −3 Original line number Original line Diff line number Diff line Loading @@ -22,6 +22,7 @@ import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID; import static android.app.ActivityManager.StackId.HOME_STACK_ID; import static android.app.ActivityManager.StackId.HOME_STACK_ID; import static android.app.ActivityManager.StackId.INVALID_STACK_ID; import static android.app.ActivityManager.StackId.INVALID_STACK_ID; import static android.app.ActivityManager.StackId.PINNED_STACK_ID; import static android.app.ActivityManager.StackId.PINNED_STACK_ID; import static android.app.ActivityManager.StackId.RECENTS_STACK_ID; import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT; import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT; import android.annotation.NonNull; import android.annotation.NonNull; Loading Loading @@ -1057,15 +1058,18 @@ public class SystemServicesProxy { } } /** /** * Returns the window rect for the RecentsActivity, based on the dimensions of the home stack. * Returns the window rect for the RecentsActivity, based on the dimensions of the recents stack */ */ public Rect getWindowRect() { public Rect getWindowRect() { Rect windowRect = new Rect(); Rect windowRect = new Rect(); if (mIam == null) return windowRect; if (mIam == null) return windowRect; try { try { // Use the home stack bounds // Use the recents stack bounds, fallback to fullscreen stack if it is null ActivityManager.StackInfo stackInfo = mIam.getStackInfo(HOME_STACK_ID); ActivityManager.StackInfo stackInfo = mIam.getStackInfo(RECENTS_STACK_ID); if (stackInfo == null) { stackInfo = mIam.getStackInfo(FULLSCREEN_WORKSPACE_STACK_ID); } if (stackInfo != null) { if (stackInfo != null) { windowRect.set(stackInfo.bounds); windowRect.set(stackInfo.bounds); } } Loading packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java +7 −4 Original line number Original line Diff line number Diff line Loading @@ -746,15 +746,18 @@ public class DividerView extends FrameLayout implements OnTouchListener, if (mStableInsets.isEmpty()) { if (mStableInsets.isEmpty()) { SystemServicesProxy.getInstance(mContext).getStableInsets(mStableInsets); SystemServicesProxy.getInstance(mContext).getStableInsets(mStableInsets); } } mMinimizedSnapAlgorithm = null; mDockedStackMinimized = minimized; initializeSnapAlgorithm(); if (!mIsInMinimizeInteraction && minimized) { if (!mIsInMinimizeInteraction && minimized) { mIsInMinimizeInteraction = true; mIsInMinimizeInteraction = true; mDividerPositionBeforeMinimized = DockedDividerUtils.calculateMiddlePosition( mDividerPositionBeforeMinimized = DockedDividerUtils.calculateMiddlePosition( isHorizontalDivision(), mStableInsets, mDisplayWidth, mDisplayHeight, isHorizontalDivision(), mStableInsets, mDisplayWidth, mDisplayHeight, mDividerSize); mDividerSize); int position = mMinimizedSnapAlgorithm.getMiddleTarget().position; resizeStack(position, position, mMinimizedSnapAlgorithm.getMiddleTarget()); } } mMinimizedSnapAlgorithm = null; mDockedStackMinimized = minimized; initializeSnapAlgorithm(); } } } } Loading Loading @@ -1140,7 +1143,7 @@ public class DividerView extends FrameLayout implements OnTouchListener, && dockSideBottomRight(mDockSide))) { && dockSideBottomRight(mDockSide))) { return StackId.DOCKED_STACK_ID; return StackId.DOCKED_STACK_ID; } else { } else { return StackId.HOME_STACK_ID; return StackId.RECENTS_STACK_ID; } } } } Loading services/core/java/com/android/server/am/ActivityManagerService.java +3 −6 Original line number Original line Diff line number Diff line Loading @@ -19901,14 +19901,11 @@ public class ActivityManagerService extends IActivityManager.Stub /** Helper method that requests bounds from WM and applies them to stack. */ /** Helper method that requests bounds from WM and applies them to stack. */ private void resizeStackWithBoundsFromWindowManager(int stackId, boolean deferResume) { private void resizeStackWithBoundsFromWindowManager(int stackId, boolean deferResume) { final Rect newStackBounds = new Rect(); final Rect newStackBounds = new Rect(); final Rect newTempTaskBounds = new Rect(); mStackSupervisor.getStack(stackId).getBoundsForNewConfiguration(newStackBounds); mStackSupervisor.getStack(stackId).getBoundsForNewConfiguration(newStackBounds, newTempTaskBounds); mStackSupervisor.resizeStackLocked( mStackSupervisor.resizeStackLocked( stackId, !newStackBounds.isEmpty() ? newStackBounds : null /* bounds */, stackId, !newStackBounds.isEmpty() ? newStackBounds : null /* bounds */, !newTempTaskBounds.isEmpty() ? newTempTaskBounds : null /* tempTaskBounds */, null /* tempTaskBounds */, null /* tempTaskInsetBounds */, null /* tempTaskInsetBounds */, false /* preserveWindows */, false /* preserveWindows */, false /* allowResizeInDockedMode */, deferResume); false /* allowResizeInDockedMode */, deferResume); } } /** /** services/core/java/com/android/server/am/ActivityStack.java +10 −6 Original line number Original line Diff line number Diff line Loading @@ -120,6 +120,7 @@ import com.android.server.am.ActivityManagerService.ItemMatcher; import com.android.server.am.ActivityStackSupervisor.ActivityContainer; import com.android.server.am.ActivityStackSupervisor.ActivityContainer; import com.android.server.wm.StackWindowController; import com.android.server.wm.StackWindowController; import com.android.server.wm.StackWindowListener; import com.android.server.wm.StackWindowListener; import com.android.server.wm.TaskStack; import com.android.server.wm.WindowManagerService; import com.android.server.wm.WindowManagerService; import java.io.FileDescriptor; import java.io.FileDescriptor; Loading Loading @@ -544,10 +545,13 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai mActivityContainer.mActivityDisplay.mDisplay.getSize(out); mActivityContainer.mActivityDisplay.mDisplay.getSize(out); } } void getStackDockedModeBounds(Rect outBounds, Rect outTempBounds, Rect outTempInsetBounds, /** boolean ignoreVisibility) { * @see ActivityStack.getStackDockedModeBounds(Rect, Rect, Rect, boolean) mWindowContainerController.getStackDockedModeBounds(outBounds, outTempBounds, */ outTempInsetBounds, ignoreVisibility); void getStackDockedModeBounds(Rect currentTempTaskBounds, Rect outStackBounds, Rect outTempTaskBounds, boolean ignoreVisibility) { mWindowContainerController.getStackDockedModeBounds(currentTempTaskBounds, outStackBounds, outTempTaskBounds, ignoreVisibility); } } void prepareFreezingTaskBounds() { void prepareFreezingTaskBounds() { Loading @@ -562,8 +566,8 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai outBounds.setEmpty(); outBounds.setEmpty(); } } void getBoundsForNewConfiguration(Rect outBounds, Rect outTempBounds) { void getBoundsForNewConfiguration(Rect outBounds) { mWindowContainerController.getBoundsForNewConfiguration(outBounds, outTempBounds); mWindowContainerController.getBoundsForNewConfiguration(outBounds); } } void positionChildWindowContainerAtTop(TaskRecord child) { void positionChildWindowContainerAtTop(TaskRecord child) { Loading services/core/java/com/android/server/am/ActivityStackSupervisor.java +9 −9 Original line number Original line Diff line number Diff line Loading @@ -2403,19 +2403,19 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D // static stacks need to be adjusted so they don't overlap with the docked stack. // static stacks need to be adjusted so they don't overlap with the docked stack. // We get the bounds to use from window manager which has been adjusted for any // We get the bounds to use from window manager which has been adjusted for any // screen controls and is also the same for all stacks. // screen controls and is also the same for all stacks. final Rect tempOtherTaskRect = new Rect(); final Rect otherTaskRect = new Rect(); final Rect tempOtherTaskInsetRect = new Rect(); for (int i = FIRST_STATIC_STACK_ID; i <= LAST_STATIC_STACK_ID; i++) { for (int i = FIRST_STATIC_STACK_ID; i <= LAST_STATIC_STACK_ID; i++) { final ActivityStack current = getStack(i); final ActivityStack current = getStack(i); if (current != null && StackId.isResizeableByDockedStack(i)) { if (current != null && StackId.isResizeableByDockedStack(i)) { current.getStackDockedModeBounds(tempRect, tempOtherTaskRect, current.getStackDockedModeBounds( tempOtherTaskInsetRect, true /* ignoreVisibility */); tempOtherTaskBounds /* currentTempTaskBounds */, tempRect /* outStackBounds */, otherTaskRect /* outTempTaskBounds */, true /* ignoreVisibility */); resizeStackLocked(i, tempRect, resizeStackLocked(i, tempRect, !tempOtherTaskRect.isEmpty() ? tempOtherTaskRect : !otherTaskRect.isEmpty() ? otherTaskRect : tempOtherTaskBounds, tempOtherTaskBounds, tempOtherTaskInsetBounds, preserveWindows, !tempOtherTaskInsetRect.isEmpty() ? tempOtherTaskInsetRect : true /* allowResizeInDockedMode */, deferResume); tempOtherTaskInsetBounds, preserveWindows, true /* allowResizeInDockedMode */, deferResume); } } } } } } Loading Loading
packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +7 −3 Original line number Original line Diff line number Diff line Loading @@ -22,6 +22,7 @@ import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID; import static android.app.ActivityManager.StackId.HOME_STACK_ID; import static android.app.ActivityManager.StackId.HOME_STACK_ID; import static android.app.ActivityManager.StackId.INVALID_STACK_ID; import static android.app.ActivityManager.StackId.INVALID_STACK_ID; import static android.app.ActivityManager.StackId.PINNED_STACK_ID; import static android.app.ActivityManager.StackId.PINNED_STACK_ID; import static android.app.ActivityManager.StackId.RECENTS_STACK_ID; import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT; import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT; import android.annotation.NonNull; import android.annotation.NonNull; Loading Loading @@ -1057,15 +1058,18 @@ public class SystemServicesProxy { } } /** /** * Returns the window rect for the RecentsActivity, based on the dimensions of the home stack. * Returns the window rect for the RecentsActivity, based on the dimensions of the recents stack */ */ public Rect getWindowRect() { public Rect getWindowRect() { Rect windowRect = new Rect(); Rect windowRect = new Rect(); if (mIam == null) return windowRect; if (mIam == null) return windowRect; try { try { // Use the home stack bounds // Use the recents stack bounds, fallback to fullscreen stack if it is null ActivityManager.StackInfo stackInfo = mIam.getStackInfo(HOME_STACK_ID); ActivityManager.StackInfo stackInfo = mIam.getStackInfo(RECENTS_STACK_ID); if (stackInfo == null) { stackInfo = mIam.getStackInfo(FULLSCREEN_WORKSPACE_STACK_ID); } if (stackInfo != null) { if (stackInfo != null) { windowRect.set(stackInfo.bounds); windowRect.set(stackInfo.bounds); } } Loading
packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java +7 −4 Original line number Original line Diff line number Diff line Loading @@ -746,15 +746,18 @@ public class DividerView extends FrameLayout implements OnTouchListener, if (mStableInsets.isEmpty()) { if (mStableInsets.isEmpty()) { SystemServicesProxy.getInstance(mContext).getStableInsets(mStableInsets); SystemServicesProxy.getInstance(mContext).getStableInsets(mStableInsets); } } mMinimizedSnapAlgorithm = null; mDockedStackMinimized = minimized; initializeSnapAlgorithm(); if (!mIsInMinimizeInteraction && minimized) { if (!mIsInMinimizeInteraction && minimized) { mIsInMinimizeInteraction = true; mIsInMinimizeInteraction = true; mDividerPositionBeforeMinimized = DockedDividerUtils.calculateMiddlePosition( mDividerPositionBeforeMinimized = DockedDividerUtils.calculateMiddlePosition( isHorizontalDivision(), mStableInsets, mDisplayWidth, mDisplayHeight, isHorizontalDivision(), mStableInsets, mDisplayWidth, mDisplayHeight, mDividerSize); mDividerSize); int position = mMinimizedSnapAlgorithm.getMiddleTarget().position; resizeStack(position, position, mMinimizedSnapAlgorithm.getMiddleTarget()); } } mMinimizedSnapAlgorithm = null; mDockedStackMinimized = minimized; initializeSnapAlgorithm(); } } } } Loading Loading @@ -1140,7 +1143,7 @@ public class DividerView extends FrameLayout implements OnTouchListener, && dockSideBottomRight(mDockSide))) { && dockSideBottomRight(mDockSide))) { return StackId.DOCKED_STACK_ID; return StackId.DOCKED_STACK_ID; } else { } else { return StackId.HOME_STACK_ID; return StackId.RECENTS_STACK_ID; } } } } Loading
services/core/java/com/android/server/am/ActivityManagerService.java +3 −6 Original line number Original line Diff line number Diff line Loading @@ -19901,14 +19901,11 @@ public class ActivityManagerService extends IActivityManager.Stub /** Helper method that requests bounds from WM and applies them to stack. */ /** Helper method that requests bounds from WM and applies them to stack. */ private void resizeStackWithBoundsFromWindowManager(int stackId, boolean deferResume) { private void resizeStackWithBoundsFromWindowManager(int stackId, boolean deferResume) { final Rect newStackBounds = new Rect(); final Rect newStackBounds = new Rect(); final Rect newTempTaskBounds = new Rect(); mStackSupervisor.getStack(stackId).getBoundsForNewConfiguration(newStackBounds); mStackSupervisor.getStack(stackId).getBoundsForNewConfiguration(newStackBounds, newTempTaskBounds); mStackSupervisor.resizeStackLocked( mStackSupervisor.resizeStackLocked( stackId, !newStackBounds.isEmpty() ? newStackBounds : null /* bounds */, stackId, !newStackBounds.isEmpty() ? newStackBounds : null /* bounds */, !newTempTaskBounds.isEmpty() ? newTempTaskBounds : null /* tempTaskBounds */, null /* tempTaskBounds */, null /* tempTaskInsetBounds */, null /* tempTaskInsetBounds */, false /* preserveWindows */, false /* preserveWindows */, false /* allowResizeInDockedMode */, deferResume); false /* allowResizeInDockedMode */, deferResume); } } /** /**
services/core/java/com/android/server/am/ActivityStack.java +10 −6 Original line number Original line Diff line number Diff line Loading @@ -120,6 +120,7 @@ import com.android.server.am.ActivityManagerService.ItemMatcher; import com.android.server.am.ActivityStackSupervisor.ActivityContainer; import com.android.server.am.ActivityStackSupervisor.ActivityContainer; import com.android.server.wm.StackWindowController; import com.android.server.wm.StackWindowController; import com.android.server.wm.StackWindowListener; import com.android.server.wm.StackWindowListener; import com.android.server.wm.TaskStack; import com.android.server.wm.WindowManagerService; import com.android.server.wm.WindowManagerService; import java.io.FileDescriptor; import java.io.FileDescriptor; Loading Loading @@ -544,10 +545,13 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai mActivityContainer.mActivityDisplay.mDisplay.getSize(out); mActivityContainer.mActivityDisplay.mDisplay.getSize(out); } } void getStackDockedModeBounds(Rect outBounds, Rect outTempBounds, Rect outTempInsetBounds, /** boolean ignoreVisibility) { * @see ActivityStack.getStackDockedModeBounds(Rect, Rect, Rect, boolean) mWindowContainerController.getStackDockedModeBounds(outBounds, outTempBounds, */ outTempInsetBounds, ignoreVisibility); void getStackDockedModeBounds(Rect currentTempTaskBounds, Rect outStackBounds, Rect outTempTaskBounds, boolean ignoreVisibility) { mWindowContainerController.getStackDockedModeBounds(currentTempTaskBounds, outStackBounds, outTempTaskBounds, ignoreVisibility); } } void prepareFreezingTaskBounds() { void prepareFreezingTaskBounds() { Loading @@ -562,8 +566,8 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai outBounds.setEmpty(); outBounds.setEmpty(); } } void getBoundsForNewConfiguration(Rect outBounds, Rect outTempBounds) { void getBoundsForNewConfiguration(Rect outBounds) { mWindowContainerController.getBoundsForNewConfiguration(outBounds, outTempBounds); mWindowContainerController.getBoundsForNewConfiguration(outBounds); } } void positionChildWindowContainerAtTop(TaskRecord child) { void positionChildWindowContainerAtTop(TaskRecord child) { Loading
services/core/java/com/android/server/am/ActivityStackSupervisor.java +9 −9 Original line number Original line Diff line number Diff line Loading @@ -2403,19 +2403,19 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D // static stacks need to be adjusted so they don't overlap with the docked stack. // static stacks need to be adjusted so they don't overlap with the docked stack. // We get the bounds to use from window manager which has been adjusted for any // We get the bounds to use from window manager which has been adjusted for any // screen controls and is also the same for all stacks. // screen controls and is also the same for all stacks. final Rect tempOtherTaskRect = new Rect(); final Rect otherTaskRect = new Rect(); final Rect tempOtherTaskInsetRect = new Rect(); for (int i = FIRST_STATIC_STACK_ID; i <= LAST_STATIC_STACK_ID; i++) { for (int i = FIRST_STATIC_STACK_ID; i <= LAST_STATIC_STACK_ID; i++) { final ActivityStack current = getStack(i); final ActivityStack current = getStack(i); if (current != null && StackId.isResizeableByDockedStack(i)) { if (current != null && StackId.isResizeableByDockedStack(i)) { current.getStackDockedModeBounds(tempRect, tempOtherTaskRect, current.getStackDockedModeBounds( tempOtherTaskInsetRect, true /* ignoreVisibility */); tempOtherTaskBounds /* currentTempTaskBounds */, tempRect /* outStackBounds */, otherTaskRect /* outTempTaskBounds */, true /* ignoreVisibility */); resizeStackLocked(i, tempRect, resizeStackLocked(i, tempRect, !tempOtherTaskRect.isEmpty() ? tempOtherTaskRect : !otherTaskRect.isEmpty() ? otherTaskRect : tempOtherTaskBounds, tempOtherTaskBounds, tempOtherTaskInsetBounds, preserveWindows, !tempOtherTaskInsetRect.isEmpty() ? tempOtherTaskInsetRect : true /* allowResizeInDockedMode */, deferResume); tempOtherTaskInsetBounds, preserveWindows, true /* allowResizeInDockedMode */, deferResume); } } } } } } Loading