Clean-up old docked-stack implementation from WM
Bug: 133381284
Test: Existing tests pass. Manually use sysui
Change-Id: I44155d74df1489fa391c60a05d1f8098986cefb7
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index d715ed4..787785b 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -4198,13 +4198,6 @@
final DisplayContent displayContent = getDisplayContent();
if (!displayContent.mClosingApps.contains(this)
&& !displayContent.mOpeningApps.contains(this)) {
- // The token is not closing nor opening, so even if there is an animation set, that
- // doesn't mean that it goes through the normal app transition cycle so we have
- // to inform the docked controller about visibility change.
- // TODO(multi-display): notify docked divider on all displays where visibility was
- // affected.
- displayContent.getDockedDividerController().notifyAppVisibilityChanged();
-
// Take the screenshot before possibly hiding the WSA, otherwise the screenshot
// will not be taken.
mWmService.mTaskSnapshotController.notifyAppVisibilityChanged(this, visible);
diff --git a/services/core/java/com/android/server/wm/ActivityStack.java b/services/core/java/com/android/server/wm/ActivityStack.java
index ff890ff..84848b4 100644
--- a/services/core/java/com/android/server/wm/ActivityStack.java
+++ b/services/core/java/com/android/server/wm/ActivityStack.java
@@ -17,8 +17,6 @@
package com.android.server.wm;
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
-import static android.app.ActivityTaskManager.SPLIT_SCREEN_CREATE_MODE_BOTTOM_OR_RIGHT;
-import static android.app.ActivityTaskManager.SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT;
import static android.app.ITaskStackListener.FORCED_RESIZEABLE_REASON_SPLIT_SCREEN;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_ASSISTANT;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
@@ -39,16 +37,10 @@
import static android.content.pm.ActivityInfo.FLAG_RESUME_WHILE_PAUSING;
import static android.content.pm.ActivityInfo.FLAG_SHOW_FOR_ALL_USERS;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSET;
-import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Display.FLAG_CAN_SHOW_WITH_INSECURE_KEYGUARD;
import static android.view.Display.INVALID_DISPLAY;
-import static android.view.WindowManager.DOCKED_BOTTOM;
-import static android.view.WindowManager.DOCKED_INVALID;
-import static android.view.WindowManager.DOCKED_LEFT;
-import static android.view.WindowManager.DOCKED_RIGHT;
-import static android.view.WindowManager.DOCKED_TOP;
import static android.view.WindowManager.TRANSIT_ACTIVITY_CLOSE;
import static android.view.WindowManager.TRANSIT_ACTIVITY_OPEN;
import static android.view.WindowManager.TRANSIT_CRASHING_ACTIVITY_CLOSE;
@@ -98,13 +90,8 @@
import static com.android.server.wm.ActivityTaskManagerService.H.FIRST_ACTIVITY_STACK_MSG;
import static com.android.server.wm.ActivityTaskManagerService.RELAUNCH_REASON_FREE_RESIZE;
import static com.android.server.wm.ActivityTaskManagerService.RELAUNCH_REASON_WINDOWING_MODE_RESIZE;
-import static com.android.server.wm.DragResizeMode.DRAG_RESIZE_MODE_DOCKED_DIVIDER;
import static com.android.server.wm.TaskProto.ACTIVITIES;
import static com.android.server.wm.TaskProto.ACTIVITY_TYPE;
-import static com.android.server.wm.TaskProto.ADJUSTED_BOUNDS;
-import static com.android.server.wm.TaskProto.ADJUSTED_FOR_IME;
-import static com.android.server.wm.TaskProto.ADJUST_DIVIDER_AMOUNT;
-import static com.android.server.wm.TaskProto.ADJUST_IME_AMOUNT;
import static com.android.server.wm.TaskProto.ANIMATING_BOUNDS;
import static com.android.server.wm.TaskProto.BOUNDS;
import static com.android.server.wm.TaskProto.CREATED_BY_ORGANIZER;
@@ -113,7 +100,6 @@
import static com.android.server.wm.TaskProto.DISPLAY_ID;
import static com.android.server.wm.TaskProto.FILLS_PARENT;
import static com.android.server.wm.TaskProto.LAST_NON_FULLSCREEN_BOUNDS;
-import static com.android.server.wm.TaskProto.MINIMIZE_AMOUNT;
import static com.android.server.wm.TaskProto.MIN_HEIGHT;
import static com.android.server.wm.TaskProto.MIN_WIDTH;
import static com.android.server.wm.TaskProto.ORIG_ACTIVITY;
@@ -168,7 +154,6 @@
import android.util.Slog;
import android.util.proto.ProtoOutputStream;
import android.view.Display;
-import android.view.DisplayCutout;
import android.view.DisplayInfo;
import android.view.ITaskOrganizer;
import android.view.SurfaceControl;
@@ -177,8 +162,6 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.app.IVoiceInteractor;
import com.android.internal.os.logging.MetricsLoggerWrapper;
-import com.android.internal.policy.DividerSnapAlgorithm;
-import com.android.internal.policy.DockedDividerUtils;
import com.android.internal.util.function.pooled.PooledConsumer;
import com.android.internal.util.function.pooled.PooledFunction;
import com.android.internal.util.function.pooled.PooledLambda;
@@ -238,13 +221,6 @@
/** Stack is completely invisible. */
static final int STACK_VISIBILITY_INVISIBLE = 2;
- /** Minimum size of an adjusted stack bounds relative to original stack bounds. Used to
- * restrict IME adjustment so that a min portion of top stack remains visible.*/
- private static final float ADJUSTED_STACK_FRACTION_MIN = 0.3f;
-
- /** Dimming amount for non-focused stack when stacks are IME-adjusted. */
- private static final float IME_ADJUST_DIM_AMOUNT = 0.25f;
-
enum ActivityState {
INITIALIZING,
STARTED,
@@ -294,28 +270,10 @@
/** For Pinned stack controlling. */
private Rect mTmpToBounds = new Rect();
- /** Stack bounds adjusted to screen content area (taking into account IM windows, etc.) */
- private final Rect mAdjustedBounds = new Rect();
-
- /**
- * Fully adjusted IME bounds. These are different from {@link #mAdjustedBounds} because they
- * represent the state when the animation has ended.
- */
- private final Rect mFullyAdjustedImeBounds = new Rect();
-
/** Detach this stack from its display when animation completes. */
// TODO: maybe tie this to WindowContainer#removeChild some how...
private boolean mDeferRemoval;
- private final Rect mTmpAdjustedBounds = new Rect();
- private boolean mAdjustedForIme;
- private boolean mImeGoingAway;
- private WindowState mImeWin;
- private float mMinimizeAmount;
- private float mAdjustImeAmount;
- private float mAdjustDividerAmount;
- private final int mDockedStackMinimizeThickness;
-
// If this is true, we are in the bounds animating mode. The task will be down or upscaled to
// perfectly fit the region it would have been cropped to. We may also avoid certain logic we
// would otherwise apply while resizing, while resizing in the bounds animating mode.
@@ -643,8 +601,6 @@
_realActivitySuspended, userSetupComplete, minWidth, minHeight, info, _voiceSession,
_voiceInteractor, stack);
- mDockedStackMinimizeThickness = mWmService.mContext.getResources().getDimensionPixelSize(
- com.android.internal.R.dimen.docked_stack_minimize_thickness);
EventLogTags.writeWmStackCreated(id);
mHandler = new ActivityStackHandler(mStackSupervisor.mLooper);
mCurrentUser = mAtmService.mAmInternal.getCurrentUserId();
@@ -3497,43 +3453,6 @@
forAllLeafTasks(Task::prepareFreezingBounds, true /* traverseTopToBottom */);
}
- /**
- * Overrides the adjusted bounds, i.e. sets temporary layout bounds which are different from
- * the normal task bounds.
- *
- * @param bounds The adjusted bounds.
- */
- private void setAdjustedBounds(Rect bounds) {
- if (mAdjustedBounds.equals(bounds) && !isAnimatingForIme()) {
- return;
- }
-
- mAdjustedBounds.set(bounds);
- final boolean adjusted = !mAdjustedBounds.isEmpty();
- Rect insetBounds = null;
- if (adjusted && isAdjustedForMinimizedDockedStack()) {
- insetBounds = getRawBounds();
- } else if (adjusted && mAdjustedForIme) {
- if (mImeGoingAway) {
- insetBounds = getRawBounds();
- } else {
- insetBounds = mFullyAdjustedImeBounds;
- }
- }
-
- if (!matchParentBounds()) {
- final boolean alignBottom = mAdjustedForIme && getDockSide() == DOCKED_TOP;
- final PooledConsumer c = PooledLambda.obtainConsumer(Task::alignToAdjustedBounds,
- PooledLambda.__(Task.class), adjusted ? mAdjustedBounds : getRawBounds(),
- insetBounds, alignBottom);
- forAllLeafTasks(c, true /* traverseTopToBottom */);
- c.recycle();
- }
-
- mDisplayContent.setLayoutNeeded();
- updateSurfaceBounds();
- }
-
@Override
public int setBounds(Rect bounds) {
// Calling Task#setBounds() for leaf task since this is the a specialization of
@@ -3552,8 +3471,6 @@
final int result = super.setBounds(!inMultiWindowMode() ? null : bounds);
- updateAdjustedBounds();
-
updateSurfaceBounds();
return result;
}
@@ -3575,19 +3492,6 @@
bounds.set(getBounds());
}
- @Override
- public Rect getBounds() {
- // If we're currently adjusting for IME or minimized docked stack, we use the adjusted
- // bounds; otherwise, no need to adjust the output bounds if fullscreen or the docked
- // stack is visible since it is already what we want to represent to the rest of the
- // system.
- if (!mAdjustedBounds.isEmpty()) {
- return mAdjustedBounds;
- } else {
- return super.getBounds();
- }
- }
-
/**
* @return the final bounds for the bounds animation.
*/
@@ -3620,113 +3524,6 @@
}
/**
- * Updates the passed-in {@code inOutBounds} based on the current state of the
- * docked controller. This gets run *after* the override configuration is updated, so it's
- * safe to rely on the controller's state in here (though eventually this dependence should
- * be removed).
- *
- * This does NOT modify this TaskStack's configuration. However, it does, for the time-being,
- * update docked controller state.
- *
- * @param parentConfig the parent configuration for reference.
- * @param inOutBounds the bounds to update (both input and output).
- */
- void calculateDockedBoundsForConfigChange(Configuration parentConfig, Rect inOutBounds) {
- final boolean primary =
- getRequestedOverrideWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
- repositionSplitScreenStackAfterRotation(parentConfig, primary, inOutBounds);
- final DisplayCutout cutout = mDisplayContent.getDisplayInfo().displayCutout;
- snapDockedStackAfterRotation(parentConfig, cutout, inOutBounds);
- if (primary) {
- final int newDockSide = getDockSide(parentConfig, inOutBounds);
- // Update the dock create mode and clear the dock create bounds, these
- // might change after a rotation and the original values will be invalid.
- mWmService.setDockedStackCreateStateLocked(
- (newDockSide == DOCKED_LEFT || newDockSide == DOCKED_TOP)
- ? SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT
- : SPLIT_SCREEN_CREATE_MODE_BOTTOM_OR_RIGHT,
- null);
- mDisplayContent.getDockedDividerController().notifyDockSideChanged(newDockSide);
- }
- }
-
- /**
- * Some primary split screen sides are not allowed by the policy. This method queries the policy
- * and moves the primary stack around if needed.
- *
- * @param parentConfig the configuration of the stack's parent.
- * @param primary true if adjusting the primary docked stack, false for secondary.
- * @param inOutBounds the bounds of the stack to adjust.
- */
- void repositionSplitScreenStackAfterRotation(Configuration parentConfig, boolean primary,
- Rect inOutBounds) {
- final int dockSide = getDockSide(mDisplayContent, parentConfig, inOutBounds);
- final int otherDockSide = DockedDividerUtils.invertDockSide(dockSide);
- final int primaryDockSide = primary ? dockSide : otherDockSide;
- if (mDisplayContent.getDockedDividerController()
- .canPrimaryStackDockTo(primaryDockSide,
- parentConfig.windowConfiguration.getBounds(),
- parentConfig.windowConfiguration.getRotation())) {
- return;
- }
- final Rect parentBounds = parentConfig.windowConfiguration.getBounds();
- switch (otherDockSide) {
- case DOCKED_LEFT:
- int movement = inOutBounds.left;
- inOutBounds.left -= movement;
- inOutBounds.right -= movement;
- break;
- case DOCKED_RIGHT:
- movement = parentBounds.right - inOutBounds.right;
- inOutBounds.left += movement;
- inOutBounds.right += movement;
- break;
- case DOCKED_TOP:
- movement = inOutBounds.top;
- inOutBounds.top -= movement;
- inOutBounds.bottom -= movement;
- break;
- case DOCKED_BOTTOM:
- movement = parentBounds.bottom - inOutBounds.bottom;
- inOutBounds.top += movement;
- inOutBounds.bottom += movement;
- break;
- }
- }
-
- /**
- * Snaps the bounds after rotation to the closest snap target for the docked stack.
- */
- void snapDockedStackAfterRotation(Configuration parentConfig, DisplayCutout displayCutout,
- Rect outBounds) {
-
- // Calculate the current position.
- final int dividerSize = mDisplayContent.getDockedDividerController().getContentWidth();
- final int dockSide = getDockSide(parentConfig, outBounds);
- final int dividerPosition = DockedDividerUtils.calculatePositionForBounds(outBounds,
- dockSide, dividerSize);
- final int displayWidth = parentConfig.windowConfiguration.getBounds().width();
- final int displayHeight = parentConfig.windowConfiguration.getBounds().height();
-
- // Snap the position to a target.
- final int rotation = parentConfig.windowConfiguration.getRotation();
- final int orientation = parentConfig.orientation;
- mDisplayContent.getDisplayPolicy().getStableInsetsLw(rotation, displayWidth, displayHeight,
- displayCutout, outBounds);
- final DividerSnapAlgorithm algorithm = new DividerSnapAlgorithm(
- mWmService.mContext.getResources(), displayWidth, displayHeight,
- dividerSize, orientation == Configuration.ORIENTATION_PORTRAIT, outBounds,
- getDockSide(), isMinimizedDockAndHomeStackResizable());
- final DividerSnapAlgorithm.SnapTarget target =
- algorithm.calculateNonDismissingSnapTarget(dividerPosition);
-
- // Recalculate the bounds based on the position of the target.
- DockedDividerUtils.calculateBoundsForPosition(target.position, dockSide,
- outBounds, displayWidth, displayHeight,
- dividerSize);
- }
-
- /**
* Put a Task in this stack. Used for adding only.
* When task is added to top of the stack, the entire branch of the hierarchy (including stack
* and display) will be brought to top.
@@ -3916,445 +3713,8 @@
}
}
- /**
- * Determines the stack and task bounds of the other stack when in docked mode. The current task
- * bounds is passed in but depending on the stack, the task and stack must match. Only in
- * minimized mode with resizable launcher, the other stack ignores calculating the stack bounds
- * and uses the task bounds passed in as the stack and task bounds, otherwise the stack bounds
- * is calculated and is also used for its task bounds.
- * If any of the out bounds are empty, it represents default bounds
- *
- * @param currentTempTaskBounds the current task bounds of the other stack
- * @param outStackBounds the calculated stack bounds of the other stack
- * @param outTempTaskBounds the calculated task bounds of the other stack
- */
- void getStackDockedModeBounds(Rect dockedBounds,
- Rect currentTempTaskBounds, Rect outStackBounds, Rect outTempTaskBounds) {
- final Configuration parentConfig = getParent().getConfiguration();
- outTempTaskBounds.setEmpty();
-
- if (dockedBounds == null || dockedBounds.isEmpty()) {
- // Calculate the primary docked bounds.
- final boolean dockedOnTopOrLeft = mWmService.mDockedStackCreateMode
- == SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT;
- getStackDockedModeBounds(parentConfig,
- true /* primary */, outStackBounds, dockedBounds,
- mDisplayContent.mDividerControllerLocked.getContentWidth(), dockedOnTopOrLeft);
- return;
- }
- final int dockedSide = getDockSide(parentConfig, dockedBounds);
-
- // When the home stack is resizable, should always have the same stack and task bounds
- if (isActivityTypeHome()) {
- final Task homeTask = getTopMostTask();
- if (homeTask == null || homeTask.isResizeable()) {
- // Calculate the home stack bounds when in docked mode and the home stack is
- // resizeable.
- getDisplayContent().mDividerControllerLocked
- .getHomeStackBoundsInDockedMode(parentConfig,
- dockedSide, outStackBounds);
- } else {
- // Home stack isn't resizeable, so don't specify stack bounds.
- outStackBounds.setEmpty();
- }
-
- outTempTaskBounds.set(outStackBounds);
- return;
- }
-
- // When minimized state, the stack bounds for all non-home and docked stack bounds should
- // match the passed task bounds
- if (isMinimizedDockAndHomeStackResizable() && currentTempTaskBounds != null) {
- outStackBounds.set(currentTempTaskBounds);
- return;
- }
-
- if (dockedSide == DOCKED_INVALID) {
- // Not sure how you got here...Only thing we can do is return current bounds.
- Slog.e(TAG_WM, "Failed to get valid docked side for docked stack");
- outStackBounds.set(getRawBounds());
- return;
- }
-
- final boolean dockedOnTopOrLeft = dockedSide == DOCKED_TOP || dockedSide == DOCKED_LEFT;
- getStackDockedModeBounds(parentConfig,
- false /* primary */, outStackBounds, dockedBounds,
- mDisplayContent.mDividerControllerLocked.getContentWidth(), dockedOnTopOrLeft);
- }
-
- /**
- * Outputs the bounds a stack should be given the presence of a docked stack on the display.
- * @param parentConfig The parent configuration.
- * @param primary {@code true} if getting the primary stack bounds.
- * @param outBounds Output bounds that should be used for the stack.
- * @param dockedBounds Bounds of the docked stack.
- * @param dockDividerWidth We need to know the width of the divider make to the output bounds
- * close to the side of the dock.
- * @param dockOnTopOrLeft If the docked stack is on the top or left side of the screen.
- */
- private void getStackDockedModeBounds(Configuration parentConfig, boolean primary,
- Rect outBounds, Rect dockedBounds, int dockDividerWidth,
- boolean dockOnTopOrLeft) {
- final Rect displayRect = parentConfig.windowConfiguration.getBounds();
- final boolean splitHorizontally = displayRect.width() > displayRect.height();
-
- outBounds.set(displayRect);
- if (primary) {
- if (mWmService.mDockedStackCreateBounds != null) {
- outBounds.set(mWmService.mDockedStackCreateBounds);
- return;
- }
-
- // The initial bounds of the docked stack when it is created about half the screen space
- // and its bounds can be adjusted after that. The bounds of all other stacks are
- // adjusted to occupy whatever screen space the docked stack isn't occupying.
- final DisplayCutout displayCutout = mDisplayContent.getDisplayInfo().displayCutout;
- mDisplayContent.getDisplayPolicy().getStableInsetsLw(
- parentConfig.windowConfiguration.getRotation(),
- displayRect.width(), displayRect.height(), displayCutout, mTmpRect2);
- final int position = new DividerSnapAlgorithm(mWmService.mContext.getResources(),
- displayRect.width(),
- displayRect.height(),
- dockDividerWidth,
- parentConfig.orientation == ORIENTATION_PORTRAIT,
- mTmpRect2).getMiddleTarget().position;
-
- if (dockOnTopOrLeft) {
- if (splitHorizontally) {
- outBounds.right = position;
- } else {
- outBounds.bottom = position;
- }
- } else {
- if (splitHorizontally) {
- outBounds.left = position + dockDividerWidth;
- } else {
- outBounds.top = position + dockDividerWidth;
- }
- }
- return;
- }
-
- // Other stacks occupy whatever space is left by the docked stack.
- if (!dockOnTopOrLeft) {
- if (splitHorizontally) {
- outBounds.right = dockedBounds.left - dockDividerWidth;
- } else {
- outBounds.bottom = dockedBounds.top - dockDividerWidth;
- }
- } else {
- if (splitHorizontally) {
- outBounds.left = dockedBounds.right + dockDividerWidth;
- } else {
- outBounds.top = dockedBounds.bottom + dockDividerWidth;
- }
- }
- DockedDividerUtils.sanitizeStackBounds(outBounds, !dockOnTopOrLeft);
- }
-
- void resetDockedStackToMiddle() {
- if (!inSplitScreenPrimaryWindowingMode()) {
- throw new IllegalStateException("Not a docked stack=" + this);
- }
-
- mWmService.mDockedStackCreateBounds = null;
-
- final Rect bounds = new Rect();
- final Rect tempBounds = new Rect();
- getStackDockedModeBounds(null /* dockedBounds */, null /* currentTempTaskBounds */,
- bounds, tempBounds);
- mStackSupervisor.resizeDockedStackLocked(bounds, null /* tempTaskBounds */,
- null /* tempTaskInsetBounds */, null /* tempOtherTaskBounds */,
- null /* tempOtherTaskInsetBounds */, false /* preserveWindows */,
- false /* deferResume */);
- }
-
- /**
- * Adjusts the stack bounds if the IME is visible.
- *
- * @param imeWin The IME window.
- * @param keepLastAmount Use {@code true} to keep the last adjusted amount from
- * {@link DockedStackDividerController} for adjusting the stack bounds,
- * Use {@code false} to reset adjusted amount as 0.
- * @see #updateAdjustForIme(float, float, boolean)
- */
- void setAdjustedForIme(WindowState imeWin, boolean keepLastAmount) {
- mImeWin = imeWin;
- mImeGoingAway = false;
- if (!mAdjustedForIme || keepLastAmount) {
- mAdjustedForIme = true;
- DockedStackDividerController controller = getDisplayContent().mDividerControllerLocked;
- final float adjustImeAmount = keepLastAmount ? controller.mLastAnimationProgress : 0f;
- final float adjustDividerAmount = keepLastAmount ? controller.mLastDividerProgress : 0f;
- updateAdjustForIme(adjustImeAmount, adjustDividerAmount, true /* force */);
- }
- }
-
- boolean isAdjustedForIme() {
- return mAdjustedForIme;
- }
-
- boolean isAnimatingForIme() {
- return mImeWin != null && mImeWin.isAnimatingLw();
- }
-
- /**
- * Update the stack's bounds (crop or position) according to the IME window's
- * current position. When IME window is animated, the bottom stack is animated
- * together to track the IME window's current position, and the top stack is
- * cropped as necessary.
- *
- * @return true if a traversal should be performed after the adjustment.
- */
- boolean updateAdjustForIme(float adjustAmount, float adjustDividerAmount, boolean force) {
- if (adjustAmount != mAdjustImeAmount
- || adjustDividerAmount != mAdjustDividerAmount || force) {
- mAdjustImeAmount = adjustAmount;
- mAdjustDividerAmount = adjustDividerAmount;
- updateAdjustedBounds();
- return isVisible();
- } else {
- return false;
- }
- }
-
- /**
- * Resets the adjustment after it got adjusted for the IME.
- * @param adjustBoundsNow if true, reset and update the bounds immediately and forget about
- * animations; otherwise, set flag and animates the window away together
- * with IME window.
- */
- void resetAdjustedForIme(boolean adjustBoundsNow) {
- if (adjustBoundsNow) {
- mImeWin = null;
- mImeGoingAway = false;
- mAdjustImeAmount = 0f;
- mAdjustDividerAmount = 0f;
- if (!mAdjustedForIme) {
- return;
- }
- mAdjustedForIme = false;
- updateAdjustedBounds();
- mWmService.setResizeDimLayer(false, getWindowingMode(), 1.0f);
- } else {
- mImeGoingAway |= mAdjustedForIme;
- }
- }
-
- /**
- * Sets the amount how much we currently minimize our stack.
- *
- * @param minimizeAmount The amount, between 0 and 1.
- * @return Whether the amount has changed and a layout is needed.
- */
- boolean setAdjustedForMinimizedDock(float minimizeAmount) {
- if (minimizeAmount != mMinimizeAmount) {
- mMinimizeAmount = minimizeAmount;
- updateAdjustedBounds();
- return isVisible();
- } else {
- return false;
- }
- }
-
boolean shouldIgnoreInput() {
- return isAdjustedForMinimizedDockedStack()
- || (inSplitScreenPrimaryWindowingMode() && isMinimizedDockAndHomeStackResizable());
- }
-
- /**
- * Puts all visible tasks that are adjusted for IME into resizing mode and adds the windows
- * to the list of to be drawn windows the service is waiting for.
- */
- void beginImeAdjustAnimation() {
- forAllLeafTasks((t) -> {
- if (t.hasContentToDisplay()) {
- t.setDragResizing(true, DRAG_RESIZE_MODE_DOCKED_DIVIDER);
- t.setWaitingForDrawnIfResizingChanged();
- }
- }, true /* traverseTopToBottom */);
- }
-
- /** Resets the resizing state of all windows. */
- void endImeAdjustAnimation() {
- forAllLeafTasks((t) -> {
- t.setDragResizing(false, DRAG_RESIZE_MODE_DOCKED_DIVIDER);
- }, true /* traverseTopToBottom */);
- }
-
- private int getMinTopStackBottom(final Rect displayContentRect, int originalStackBottom) {
- return displayContentRect.top + (int)
- ((originalStackBottom - displayContentRect.top) * ADJUSTED_STACK_FRACTION_MIN);
- }
-
- private boolean adjustForIME(final WindowState imeWin) {
- // To prevent task stack resize animation may flicking when playing app transition
- // animation & IME window enter animation in parallel, we need to make sure app
- // transition is done and then adjust task size for IME, skip the new adjusted frame when
- // app transition is still running.
- if (getDisplayContent().mAppTransition.isRunning()) {
- return false;
- }
-
- final int dockedSide = getDockSide();
- final boolean dockedTopOrBottom = dockedSide == DOCKED_TOP || dockedSide == DOCKED_BOTTOM;
- if (imeWin == null || !dockedTopOrBottom) {
- return false;
- }
-
- final Rect displayStableRect = mTmpRect;
- final Rect contentBounds = mTmpRect2;
-
- // Calculate the content bounds excluding the area occupied by IME
- getDisplayContent().getStableRect(displayStableRect);
- contentBounds.set(displayStableRect);
- int imeTop = Math.max(imeWin.getFrameLw().top, contentBounds.top);
-
- imeTop += imeWin.getGivenContentInsetsLw().top;
- if (contentBounds.bottom > imeTop) {
- contentBounds.bottom = imeTop;
- }
-
- final int yOffset = displayStableRect.bottom - contentBounds.bottom;
-
- final int dividerWidth =
- getDisplayContent().mDividerControllerLocked.getContentWidth();
- final int dividerWidthInactive =
- getDisplayContent().mDividerControllerLocked.getContentWidthInactive();
-
- if (dockedSide == DOCKED_TOP) {
- // If this stack is docked on top, we make it smaller so the bottom stack is not
- // occluded by IME. We shift its bottom up by the height of the IME, but
- // leaves at least 30% of the top stack visible.
- final int minTopStackBottom =
- getMinTopStackBottom(displayStableRect, getRawBounds().bottom);
- final int bottom = Math.max(
- getRawBounds().bottom - yOffset + dividerWidth - dividerWidthInactive,
- minTopStackBottom);
- mTmpAdjustedBounds.set(getRawBounds());
- mTmpAdjustedBounds.bottom = (int) (mAdjustImeAmount * bottom + (1 - mAdjustImeAmount)
- * getRawBounds().bottom);
- mFullyAdjustedImeBounds.set(getRawBounds());
- } else {
- // When the stack is on bottom and has no focus, it's only adjusted for divider width.
- final int dividerWidthDelta = dividerWidthInactive - dividerWidth;
-
- // When the stack is on bottom and has focus, it needs to be moved up so as to
- // not occluded by IME, and at the same time adjusted for divider width.
- // We try to move it up by the height of the IME window, but only to the extent
- // that leaves at least 30% of the top stack visible.
- // 'top' is where the top of bottom stack will move to in this case.
- final int topBeforeImeAdjust =
- getRawBounds().top - dividerWidth + dividerWidthInactive;
- final int minTopStackBottom =
- getMinTopStackBottom(displayStableRect,
- getRawBounds().top - dividerWidth);
- final int top = Math.max(
- getRawBounds().top - yOffset, minTopStackBottom + dividerWidthInactive);
-
- mTmpAdjustedBounds.set(getRawBounds());
- // Account for the adjustment for IME and divider width separately.
- // (top - topBeforeImeAdjust) is the amount of movement due to IME only,
- // and dividerWidthDelta is due to divider width change only.
- mTmpAdjustedBounds.top =
- getRawBounds().top + (int) (mAdjustImeAmount * (top - topBeforeImeAdjust)
- + mAdjustDividerAmount * dividerWidthDelta);
- mFullyAdjustedImeBounds.set(getRawBounds());
- mFullyAdjustedImeBounds.top = top;
- mFullyAdjustedImeBounds.bottom = top + getRawBounds().height();
- }
- return true;
- }
-
- private boolean adjustForMinimizedDockedStack(float minimizeAmount) {
- final int dockSide = getDockSide();
- if (dockSide == DOCKED_INVALID && !mTmpAdjustedBounds.isEmpty()) {
- return false;
- }
-
- if (dockSide == DOCKED_TOP) {
- mWmService.getStableInsetsLocked(DEFAULT_DISPLAY, mTmpRect);
- int topInset = mTmpRect.top;
- mTmpAdjustedBounds.set(getRawBounds());
- mTmpAdjustedBounds.bottom = (int) (minimizeAmount * topInset + (1 - minimizeAmount)
- * getRawBounds().bottom);
- } else if (dockSide == DOCKED_LEFT) {
- mTmpAdjustedBounds.set(getRawBounds());
- final int width = getRawBounds().width();
- mTmpAdjustedBounds.right =
- (int) (minimizeAmount * mDockedStackMinimizeThickness
- + (1 - minimizeAmount) * getRawBounds().right);
- mTmpAdjustedBounds.left = mTmpAdjustedBounds.right - width;
- } else if (dockSide == DOCKED_RIGHT) {
- mTmpAdjustedBounds.set(getRawBounds());
- mTmpAdjustedBounds.left =
- (int) (minimizeAmount * (getRawBounds().right - mDockedStackMinimizeThickness)
- + (1 - minimizeAmount) * getRawBounds().left);
- }
- return true;
- }
-
- boolean isMinimizedDockAndHomeStackResizable() {
- return mDisplayContent.mDividerControllerLocked.isMinimizedDock()
- && mDisplayContent.mDividerControllerLocked.isHomeStackResizable();
- }
-
- /**
- * @return the distance in pixels how much the stack gets minimized from it's original size
- */
- int getMinimizeDistance() {
- final int dockSide = getDockSide();
- if (dockSide == DOCKED_INVALID) {
- return 0;
- }
-
- if (dockSide == DOCKED_TOP) {
- mWmService.getStableInsetsLocked(DEFAULT_DISPLAY, mTmpRect);
- int topInset = mTmpRect.top;
- return getRawBounds().bottom - topInset;
- } else if (dockSide == DOCKED_LEFT || dockSide == DOCKED_RIGHT) {
- return getRawBounds().width() - mDockedStackMinimizeThickness;
- } else {
- return 0;
- }
- }
-
- /**
- * Updates the adjustment depending on it's current state.
- */
- private void updateAdjustedBounds() {
- boolean adjust = false;
- if (mMinimizeAmount != 0f) {
- adjust = adjustForMinimizedDockedStack(mMinimizeAmount);
- } else if (mAdjustedForIme) {
- adjust = adjustForIME(mImeWin);
- }
- if (!adjust) {
- mTmpAdjustedBounds.setEmpty();
- }
- setAdjustedBounds(mTmpAdjustedBounds);
-
- final boolean isImeTarget = (mWmService.getImeFocusStackLocked() == this);
- if (mAdjustedForIme && adjust && !isImeTarget) {
- final float alpha = Math.max(mAdjustImeAmount, mAdjustDividerAmount)
- * IME_ADJUST_DIM_AMOUNT;
- mWmService.setResizeDimLayer(true, getWindowingMode(), alpha);
- }
- }
-
- void applyAdjustForImeIfNeeded(Task task) {
- if (mMinimizeAmount != 0f || !mAdjustedForIme || mAdjustedBounds.isEmpty()) {
- return;
- }
-
- final Rect insetBounds = mImeGoingAway ? getRawBounds() : mFullyAdjustedImeBounds;
- task.alignToAdjustedBounds(mAdjustedBounds, insetBounds, getDockSide() == DOCKED_TOP);
- mDisplayContent.setLayoutNeeded();
- }
-
-
- boolean isAdjustedForMinimizedDockedStack() {
- return mMinimizeAmount != 0f;
+ return inSplitScreenPrimaryWindowingMode() && !isFocusable();
}
@Override
@@ -4362,17 +3722,6 @@
pw.println(prefix + "mStackId=" + getRootTaskId());
pw.println(prefix + "mDeferRemoval=" + mDeferRemoval);
pw.println(prefix + "mBounds=" + getRawBounds().toShortString());
- if (mMinimizeAmount != 0f) {
- pw.println(prefix + "mMinimizeAmount=" + mMinimizeAmount);
- }
- if (mAdjustedForIme) {
- pw.println(prefix + "mAdjustedForIme=true");
- pw.println(prefix + "mAdjustImeAmount=" + mAdjustImeAmount);
- pw.println(prefix + "mAdjustDividerAmount=" + mAdjustDividerAmount);
- }
- if (!mAdjustedBounds.isEmpty()) {
- pw.println(prefix + "mAdjustedBounds=" + mAdjustedBounds.toShortString());
- }
for (int taskNdx = mChildren.size() - 1; taskNdx >= 0; taskNdx--) {
mChildren.get(taskNdx).dump(pw, prefix + " ", dumpAll);
}
@@ -4391,39 +3740,6 @@
}
/**
- * For docked workspace (or workspace that's side-by-side to the docked), provides
- * information which side of the screen was the dock anchored.
- */
- int getDockSide() {
- return getDockSide(mDisplayContent.getConfiguration(), getRawBounds());
- }
-
- int getDockSideForDisplay(DisplayContent dc) {
- return getDockSide(dc, dc.getConfiguration(), getRawBounds());
- }
-
- int getDockSide(Configuration parentConfig, Rect bounds) {
- if (mDisplayContent == null) {
- return DOCKED_INVALID;
- }
- return getDockSide(mDisplayContent, parentConfig, bounds);
- }
-
- private int getDockSide(DisplayContent dc, Configuration parentConfig, Rect bounds) {
- return dc.getDockedDividerController().getDockSide(bounds,
- parentConfig.windowConfiguration.getBounds(),
- parentConfig.orientation, parentConfig.windowConfiguration.getRotation());
- }
-
- boolean hasTaskForUser(int userId) {
- final PooledPredicate p = PooledLambda.obtainPredicate(
- Task::isTaskForUser, PooledLambda.__(Task.class), userId);
- final Task task = getTask(p);
- p.recycle();
- return task != null;
- }
-
- /**
* Sets the current picture-in-picture aspect ratio.
*/
void setPictureInPictureAspectRatio(float aspectRatio) {
@@ -4639,16 +3955,11 @@
bounds.dumpDebug(proto, BOUNDS);
}
getOverrideDisplayedBounds().dumpDebug(proto, DISPLAYED_BOUNDS);
- mAdjustedBounds.dumpDebug(proto, ADJUSTED_BOUNDS);
if (mLastNonFullscreenBounds != null) {
mLastNonFullscreenBounds.dumpDebug(proto, LAST_NON_FULLSCREEN_BOUNDS);
}
proto.write(DEFER_REMOVAL, mDeferRemoval);
- proto.write(MINIMIZE_AMOUNT, mMinimizeAmount);
- proto.write(ADJUSTED_FOR_IME, mAdjustedForIme);
- proto.write(ADJUST_IME_AMOUNT, mAdjustImeAmount);
- proto.write(ADJUST_DIVIDER_AMOUNT, mAdjustDividerAmount);
proto.write(ANIMATING_BOUNDS, mBoundsAnimating);
if (mSurfaceControl != null) {
diff --git a/services/core/java/com/android/server/wm/ActivityStackSupervisor.java b/services/core/java/com/android/server/wm/ActivityStackSupervisor.java
index b2d2f62..6d7f8fb 100644
--- a/services/core/java/com/android/server/wm/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/wm/ActivityStackSupervisor.java
@@ -35,12 +35,10 @@
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
-import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static android.content.pm.PackageManager.NOTIFY_PACKAGE_USE_ACTIVITY;
import static android.content.pm.PackageManager.PERMISSION_DENIED;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
-import static android.graphics.Rect.copyOrNull;
import static android.os.PowerManager.PARTIAL_WAKE_LOCK;
import static android.os.Process.INVALID_UID;
import static android.os.Process.SYSTEM_UID;
@@ -210,17 +208,6 @@
/** True if the docked stack is currently being resized. */
private boolean mDockedStackResizing;
- /**
- * True if there are pending docked bounds that need to be applied after
- * {@link #mDockedStackResizing} is reset to false.
- */
- private boolean mHasPendingDockedBounds;
- private Rect mPendingDockedBounds;
- private Rect mPendingTempDockedTaskBounds;
- private Rect mPendingTempDockedTaskInsetBounds;
- private Rect mPendingTempOtherTaskBounds;
- private Rect mPendingTempOtherTaskInsetBounds;
-
// Activity actions an app cannot start if it uses a permission which is not granted.
private static final ArrayMap<String, String> ACTION_TO_RUNTIME_PERMISSION =
new ArrayMap<>();
@@ -387,15 +374,6 @@
*/
private final ArraySet<Integer> mResizingTasksDuringAnimation = new ArraySet<>();
-
- /**
- * If set to {@code false} all calls to resize the docked stack {@link #resizeDockedStackLocked}
- * will be ignored. Useful for the case where the caller is handling resizing of other stack and
- * moving tasks around and doesn't want dock stack to be resized due to an automatic trigger
- * like the docked stack going empty.
- */
- private boolean mAllowDockedStackResize = true;
-
private KeyguardController mKeyguardController;
private PowerManager mPowerManager;
@@ -1541,12 +1519,6 @@
}
otherStack.setWindowingMode(WINDOWING_MODE_UNDEFINED);
}
-
- // Also disable docked stack resizing since we have manually adjusted the
- // size of other stacks above and we don't want to trigger a docked stack
- // resize when we remove task from it below and it is detached from the
- // display because it no longer contains any tasks.
- mAllowDockedStackResize = false;
}
// If we are moving from the pinned stack, then the animation takes care of updating
@@ -1563,7 +1535,6 @@
mRootWindowContainer.ensureActivitiesVisible(null, 0, PRESERVE_WINDOWS);
mRootWindowContainer.resumeFocusedStacksTopActivities();
} finally {
- mAllowDockedStackResize = true;
mService.continueWindowLayout();
}
}
@@ -1580,120 +1551,6 @@
mDockedStackResizing = resizing;
mWindowManager.setDockedStackResizing(resizing);
-
- if (!resizing && mHasPendingDockedBounds) {
- resizeDockedStackLocked(mPendingDockedBounds, mPendingTempDockedTaskBounds,
- mPendingTempDockedTaskInsetBounds, mPendingTempOtherTaskBounds,
- mPendingTempOtherTaskInsetBounds, PRESERVE_WINDOWS);
-
- mHasPendingDockedBounds = false;
- mPendingDockedBounds = null;
- mPendingTempDockedTaskBounds = null;
- mPendingTempDockedTaskInsetBounds = null;
- mPendingTempOtherTaskBounds = null;
- mPendingTempOtherTaskInsetBounds = null;
- }
- }
-
- void resizeDockedStackLocked(Rect dockedBounds, Rect tempDockedTaskBounds,
- Rect tempDockedTaskInsetBounds, Rect tempOtherTaskBounds, Rect tempOtherTaskInsetBounds,
- boolean preserveWindows) {
- resizeDockedStackLocked(dockedBounds, tempDockedTaskBounds, tempDockedTaskInsetBounds,
- tempOtherTaskBounds, tempOtherTaskInsetBounds, preserveWindows,
- false /* deferResume */);
- }
-
- void resizeDockedStackLocked(Rect displayedBounds, Rect tempDockedTaskBounds,
- Rect tempDockedTaskInsetBounds, Rect tempOtherTaskBounds, Rect tempOtherTaskInsetBounds,
- boolean preserveWindows, boolean deferResume) {
-
- if (!mAllowDockedStackResize) {
- // Docked stack resize currently disabled.
- return;
- }
-
- final ActivityStack stack =
- mRootWindowContainer.getDefaultDisplay().getRootSplitScreenPrimaryTask();
- if (stack == null) {
- Slog.w(TAG, "resizeDockedStackLocked: docked stack not found");
- return;
- }
-
- if (mDockedStackResizing) {
- mHasPendingDockedBounds = true;
- mPendingDockedBounds = copyOrNull(displayedBounds);
- mPendingTempDockedTaskBounds = copyOrNull(tempDockedTaskBounds);
- mPendingTempDockedTaskInsetBounds = copyOrNull(tempDockedTaskInsetBounds);
- mPendingTempOtherTaskBounds = copyOrNull(tempOtherTaskBounds);
- mPendingTempOtherTaskInsetBounds = copyOrNull(tempOtherTaskInsetBounds);
- }
-
- Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "resizeDockedStack");
- mService.deferWindowLayout();
- try {
- // Don't allow re-entry while resizing. E.g. due to docked stack detaching.
- mAllowDockedStackResize = false;
- ActivityRecord r = stack.topRunningActivity();
- stack.resize(displayedBounds, tempDockedTaskBounds,
- !PRESERVE_WINDOWS, DEFER_RESUME);
-
- // TODO: Checking for isAttached might not be needed as if the user passes in null
- // dockedBounds then they want the docked stack to be dismissed.
- if (stack.getWindowingMode() == WINDOWING_MODE_FULLSCREEN
- || (displayedBounds == null && !stack.isAttached())) {
- // The dock stack either was dismissed or went fullscreen, which is kinda the same.
- // In this case we make all other static stacks fullscreen and move all
- // docked stack tasks to the fullscreen stack.
- moveTasksToFullscreenStackLocked(stack, ON_TOP);
-
- // stack shouldn't contain anymore activities, so nothing to resume.
- r = null;
- } else {
- // Docked stacks occupy a dedicated region on screen so the size of all other
- // 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
- // screen controls and is also the same for all stacks.
- final DisplayContent display = mRootWindowContainer.getDefaultDisplay();
- final Rect otherTaskRect = new Rect();
- for (int i = display.getStackCount() - 1; i >= 0; --i) {
- final ActivityStack current = display.getStackAt(i);
- if (!current.inSplitScreenSecondaryWindowingMode()) {
- continue;
- }
- if (!current.affectedBySplitScreenResize()) {
- continue;
- }
- if (mDockedStackResizing && !current.isTopActivityVisible()) {
- // Non-visible stacks get resized once we're done with the resize
- // interaction.
- continue;
- }
- current.getStackDockedModeBounds(displayedBounds,
- tempOtherTaskBounds /* currentTempTaskBounds */,
- tempRect /* outStackBounds */,
- otherTaskRect /* outTempTaskBounds */);
-
- if (tempRect.isEmpty()) {
- // If this scenario is hit, it means something is not working right.
- // Empty/null bounds implies fullscreen. In the event that this stack
- // *should* be fullscreen, its mode should be set explicitly in a form
- // of setWindowingMode so that other parts of the system are updated
- // properly.
- throw new IllegalArgumentException("Trying to set null bounds on a"
- + " non-fullscreen stack");
- }
-
- current.resize(tempRect, tempOtherTaskBounds, preserveWindows, deferResume);
- }
- }
- if (!deferResume) {
- stack.ensureVisibleActivitiesConfiguration(r, preserveWindows);
- }
- } finally {
- mAllowDockedStackResize = true;
- mService.continueWindowLayout();
- Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
- }
}
private void removeStackInSurfaceTransaction(ActivityStack stack) {
@@ -2723,9 +2580,6 @@
mService.deferWindowLayout();
try {
if (windowingMode == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY) {
- mWindowManager.setDockedStackCreateStateLocked(
- activityOptions.getSplitScreenCreateMode(), null /* initialBounds */);
-
// Defer updating the stack in which recents is until the app transition is done, to
// not run into issues where we still need to draw the task in recents but the
// docked stack is already created.
@@ -2801,24 +2655,6 @@
// the window renders full-screen with the background filling the void. Also only
// call this at the end to make sure that tasks exists on the window manager side.
setResizingDuringAnimation(task);
-
- final DisplayContent display = task.getStack().getDisplay();
- final ActivityStack topSecondaryStack =
- display.getTopStackInWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_SECONDARY);
- if (topSecondaryStack != null && topSecondaryStack.isActivityTypeHome()) {
- // If the home activity is the top split-screen secondary stack, then the
- // primary split-screen stack is in the minimized mode which means it can't
- // receive input keys, so we should move the focused app to the home app so that
- // window manager can correctly calculate the focus window that can receive
- // input keys.
- display.moveHomeActivityToTop(
- "startActivityFromRecents: homeVisibleInSplitScreen");
-
- // Immediately update the minimized docked stack mode, the upcoming animation
- // for the docked activity (WMS.overridePendingAppTransitionMultiThumbFuture)
- // will do the animation to the target bounds
- mWindowManager.checkSplitScreenMinimizedChanged(false /* animate */);
- }
}
mService.continueWindowLayout();
}
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index 693a5e4..eaffd2b 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -31,12 +31,12 @@
import static android.app.ActivityManagerInternal.ALLOW_NON_FULL;
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
import static android.app.ActivityTaskManager.RESIZE_MODE_PRESERVE_WINDOW;
-import static android.app.ActivityTaskManager.SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
+import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
@@ -2309,9 +2309,7 @@
@Override
public boolean setTaskWindowingMode(int taskId, int windowingMode, boolean toTop) {
if (windowingMode == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY) {
- return setTaskWindowingModeSplitScreenPrimary(taskId,
- SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT,
- toTop, ANIMATE, null /* initialBounds */, true /* showRecents */);
+ return setTaskWindowingModeSplitScreenPrimary(taskId, toTop);
}
enforceCallerIsRecentsOrHasPermission(MANAGE_ACTIVITY_STACKS, "setTaskWindowingMode()");
synchronized (mGlobalLock) {
@@ -2681,10 +2679,6 @@
throw new IllegalArgumentException("moveTaskToStack: Attempt to move task "
+ taskId + " to stack " + stackId);
}
- if (stack.inSplitScreenPrimaryWindowingMode()) {
- mWindowManager.setDockedStackCreateStateLocked(
- SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT, null /* initialBounds */);
- }
task.reparent(stack, toTop, REPARENT_KEEP_STACK_AT_FRONT, ANIMATE, !DEFER_RESUME,
"moveTaskToStack");
} finally {
@@ -2697,22 +2691,11 @@
* Moves the specified task to the primary-split-screen stack.
*
* @param taskId Id of task to move.
- * @param createMode The mode the primary split screen stack should be created in if it doesn't
- * exist already. See
- * {@link android.app.ActivityTaskManager#SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT}
- * and
- * {@link android.app.ActivityTaskManager#SPLIT_SCREEN_CREATE_MODE_BOTTOM_OR_RIGHT}
* @param toTop If the task and stack should be moved to the top.
- * @param animate Whether we should play an animation for the moving the task.
- * @param initialBounds If the primary stack gets created, it will use these bounds for the
- * stack. Pass {@code null} to use default bounds.
- * @param showRecents If the recents activity should be shown on the other side of the task
- * going into split-screen mode.
* @return Whether the task was successfully put into splitscreen.
*/
@Override
- public boolean setTaskWindowingModeSplitScreenPrimary(int taskId, int createMode,
- boolean toTop, boolean animate, Rect initialBounds, boolean showRecents) {
+ public boolean setTaskWindowingModeSplitScreenPrimary(int taskId, boolean toTop) {
enforceCallerIsRecentsOrHasPermission(MANAGE_ACTIVITY_STACKS,
"setTaskWindowingModeSplitScreenPrimary()");
synchronized (mGlobalLock) {
@@ -4273,6 +4256,7 @@
}
}
+ // TODO(b/149338177): remove when CTS no-longer requires it
@Override
public void resizeDockedStack(Rect dockedBounds, Rect tempDockedTaskBounds,
Rect tempDockedTaskInsetBounds,
@@ -4281,9 +4265,42 @@
long ident = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
- mStackSupervisor.resizeDockedStackLocked(dockedBounds, tempDockedTaskBounds,
- tempDockedTaskInsetBounds, tempOtherTaskBounds, tempOtherTaskInsetBounds,
- PRESERVE_WINDOWS);
+ final DisplayContent dc = mRootWindowContainer.getDefaultDisplay();
+ TaskTile primary = null;
+ TaskTile secondary = null;
+ for (int i = dc.getStackCount() - 1; i >= 0; --i) {
+ final TaskTile t = dc.getStackAt(i).asTile();
+ if (t == null) {
+ continue;
+ }
+ if (t.getWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY) {
+ primary = t;
+ } else if (t.getWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY) {
+ secondary = t;
+ }
+ }
+ if (primary == null || secondary == null) {
+ return;
+ }
+ final WindowContainerTransaction wct = new WindowContainerTransaction();
+ final Rect primaryRect =
+ tempDockedTaskInsetBounds != null ? tempDockedTaskInsetBounds
+ : (tempDockedTaskBounds != null ? tempDockedTaskBounds
+ : dockedBounds);
+ wct.setBounds(primary.mRemoteToken, primaryRect);
+ Rect otherRect = tempOtherTaskInsetBounds != null ? tempOtherTaskInsetBounds
+ : tempOtherTaskBounds;
+ if (otherRect == null) {
+ // Temporary estimation... again this is just for tests.
+ otherRect = new Rect(secondary.getBounds());
+ if (dc.getBounds().width() > dc.getBounds().height()) {
+ otherRect.left = primaryRect.right + 6;
+ } else {
+ otherRect.top = primaryRect.bottom + 6;
+ }
+ }
+ wct.setBounds(secondary.mRemoteToken, otherRect);
+ mTaskOrganizerController.applyContainerTransaction(wct, null /* organizer */);
}
} finally {
Binder.restoreCallingIdentity(ident);
diff --git a/services/core/java/com/android/server/wm/AppTransition.java b/services/core/java/com/android/server/wm/AppTransition.java
index 8cf0881..4ba2943 100644
--- a/services/core/java/com/android/server/wm/AppTransition.java
+++ b/services/core/java/com/android/server/wm/AppTransition.java
@@ -446,8 +446,6 @@
? topOpeningAnim.getStatusBarTransitionsStartTime()
: SystemClock.uptimeMillis(),
AnimationAdapter.STATUS_BAR_TRANSITION_DURATION);
- mDisplayContent.getDockedDividerController()
- .notifyAppTransitionStarting(openingApps, transit);
if (mRemoteAnimationController != null) {
mRemoteAnimationController.goodToGo();
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index e468810..054e94b 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -95,7 +95,6 @@
import static com.android.server.wm.DisplayContentProto.CLOSING_APPS;
import static com.android.server.wm.DisplayContentProto.DISPLAY_FRAMES;
import static com.android.server.wm.DisplayContentProto.DISPLAY_INFO;
-import static com.android.server.wm.DisplayContentProto.DOCKED_STACK_DIVIDER_CONTROLLER;
import static com.android.server.wm.DisplayContentProto.DPI;
import static com.android.server.wm.DisplayContentProto.FOCUSED_APP;
import static com.android.server.wm.DisplayContentProto.FOCUSED_ROOT_TASK_ID;
@@ -132,7 +131,7 @@
import static com.android.server.wm.WindowManagerService.H.REPORT_FOCUS_CHANGE;
import static com.android.server.wm.WindowManagerService.H.REPORT_HARD_KEYBOARD_STATUS_CHANGE;
import static com.android.server.wm.WindowManagerService.H.REPORT_LOSING_FOCUS;
-import static com.android.server.wm.WindowManagerService.H.UPDATE_DOCKED_STACK_DIVIDER;
+import static com.android.server.wm.WindowManagerService.H.UPDATE_MULTI_WINDOW_STACKS;
import static com.android.server.wm.WindowManagerService.H.WINDOW_HIDE_TIMEOUT;
import static com.android.server.wm.WindowManagerService.LAYOUT_REPEAT_THRESHOLD;
import static com.android.server.wm.WindowManagerService.SEAMLESS_ROTATION_TIMEOUT_DURATION;
@@ -1006,7 +1005,7 @@
mDisplayPolicy.systemReady();
}
mWindowCornerRadius = mDisplayPolicy.getWindowCornerRadius();
- mDividerControllerLocked = new DockedStackDividerController(mWmService, this);
+ mDividerControllerLocked = new DockedStackDividerController(this);
mPinnedStackControllerLocked = new PinnedStackController(mWmService, this);
final SurfaceControl.Builder b = mWmService.makeSurfaceBuilder(mSession)
@@ -2233,12 +2232,6 @@
* for bounds calculations.
*/
void preOnConfigurationChanged() {
- final DockedStackDividerController dividerController = getDockedDividerController();
-
- if (dividerController != null) {
- getDockedDividerController().onConfigurationChanged();
- }
-
final PinnedStackController pinnedStackController = getPinnedStackController();
if (pinnedStackController != null) {
@@ -2622,10 +2615,11 @@
// We also remove the outside touch area for resizing for all freeform
// tasks (including the focused).
// We save the focused task region once we find it, and add it back at the end.
- // If the task is home stack and it is resizable in the minimized state, we want to
- // exclude the docked stack from touch so we need the entire screen area and not just a
+ // If the task is home stack and it is resizable and visible (top of its root task), we want
+ // to exclude the docked stack from touch so we need the entire screen area and not just a
// small portion which the home stack currently is resized to.
- if (task.isActivityTypeHome() && task.getStack().isMinimizedDockAndHomeStackResizable()) {
+ if (task.isActivityTypeHome() && task.isVisible() && task.getStack().getTile() != null
+ && task.isResizeable()) {
mDisplayContent.getBounds(mTmpRect);
} else {
task.getDimBounds(mTmpRect);
@@ -2634,6 +2628,8 @@
if (task == focusedTask) {
// Add the focused task rect back into the exclude region once we are done
// processing stacks.
+ // NOTE: this *looks* like a no-op, but this usage of mTmpRect2 is expected by
+ // updateTouchExcludeRegion.
mTmpRect2.set(mTmpRect);
}
@@ -2747,58 +2743,6 @@
return mDeferredRemoval;
}
- boolean animateForIme(float interpolatedValue, float animationTarget,
- float dividerAnimationTarget) {
- boolean updated = false;
-
- for (int i = mTaskContainers.getChildCount() - 1; i >= 0; --i) {
- final ActivityStack stack = mTaskContainers.getChildAt(i);
- if (stack == null || !stack.isAdjustedForIme()) {
- continue;
- }
-
- if (interpolatedValue >= 1f && animationTarget == 0f && dividerAnimationTarget == 0f) {
- stack.resetAdjustedForIme(true /* adjustBoundsNow */);
- updated = true;
- } else {
- mDividerControllerLocked.mLastAnimationProgress =
- mDividerControllerLocked.getInterpolatedAnimationValue(interpolatedValue);
- mDividerControllerLocked.mLastDividerProgress =
- mDividerControllerLocked.getInterpolatedDividerValue(interpolatedValue);
- updated |= stack.updateAdjustForIme(
- mDividerControllerLocked.mLastAnimationProgress,
- mDividerControllerLocked.mLastDividerProgress,
- false /* force */);
- }
- if (interpolatedValue >= 1f) {
- stack.endImeAdjustAnimation();
- }
- }
-
- return updated;
- }
-
- boolean clearImeAdjustAnimation() {
- boolean changed = false;
- for (int i = mTaskContainers.getChildCount() - 1; i >= 0; --i) {
- final ActivityStack stack = mTaskContainers.getChildAt(i);
- if (stack != null && stack.isAdjustedForIme()) {
- stack.resetAdjustedForIme(true /* adjustBoundsNow */);
- changed = true;
- }
- }
- return changed;
- }
-
- void beginImeAdjustAnimation() {
- for (int i = mTaskContainers.getChildCount() - 1; i >= 0; --i) {
- final ActivityStack stack = mTaskContainers.getChildAt(i);
- if (stack.isVisible() && stack.isAdjustedForIme()) {
- stack.beginImeAdjustAnimation();
- }
- }
- }
-
void adjustForImeIfNeeded() {
final WindowState imeWin = mInputMethodWindow;
final boolean imeVisible = imeWin != null && imeWin.isVisibleLw()
@@ -2893,7 +2837,6 @@
final ActivityStack stack = mTaskContainers.getChildAt(i);
stack.dumpDebug(proto, TASKS, logLevel);
}
- mDividerControllerLocked.dumpDebug(proto, DOCKED_STACK_DIVIDER_CONTROLLER);
for (int i = mOverlayContainers.getChildCount() - 1; i >= 0; --i) {
final WindowToken windowToken = mOverlayContainers.getChildAt(i);
windowToken.dumpDebug(proto, OVERLAY_WINDOWS, logLevel);
@@ -3066,8 +3009,6 @@
}
pw.println();
- mDividerControllerLocked.dump(prefix, pw);
- pw.println();
mPinnedStackControllerLocked.dump(prefix, pw);
pw.println();
@@ -4088,7 +4029,7 @@
mInputMonitor.updateInputWindowsLw(false /*force*/);
}
- mWmService.mH.sendEmptyMessage(UPDATE_DOCKED_STACK_DIVIDER);
+ mWmService.mH.sendEmptyMessage(UPDATE_MULTI_WINDOW_STACKS);
}
/**
@@ -4696,17 +4637,18 @@
@Override
int getOrientation(int candidate) {
if (isStackVisible(WINDOWING_MODE_SPLIT_SCREEN_PRIMARY)) {
- // Apps and their containers are not allowed to specify an orientation while the
- // docked stack is visible...except for the home stack if the docked stack is
- // minimized and it actually set something and the bounds is different from the
- // display.
+ // Apps and their containers are not allowed to specify an orientation while using
+ // root tasks...except for the home stack if it is not resizable and currently
+ // visible (top of) its root task.
if (mRootHomeTask != null && mRootHomeTask.isVisible()
- && mDividerControllerLocked.isMinimizedDock()
- && !(mDividerControllerLocked.isHomeStackResizable()
- && mRootHomeTask.matchParentBounds())) {
- final int orientation = mRootHomeTask.getOrientation();
- if (orientation != SCREEN_ORIENTATION_UNSET) {
- return orientation;
+ && mRootHomeTask.getTile() != null) {
+ final Task topMost = mRootHomeTask.getTopMostTask();
+ final boolean resizable = topMost == null && topMost.isResizeable();
+ if (!(resizable && mRootHomeTask.matchParentBounds())) {
+ final int orientation = mRootHomeTask.getOrientation();
+ if (orientation != SCREEN_ORIENTATION_UNSET) {
+ return orientation;
+ }
}
}
return SCREEN_ORIENTATION_UNSPECIFIED;
@@ -6171,8 +6113,6 @@
t.removeAllChildren();
}
}
- mDividerControllerLocked.setMinimizedDockedStack(false /* minimized */,
- false /* animate */);
} finally {
final ActivityStack topFullscreenStack =
getTopStackInWindowingMode(WINDOWING_MODE_FULLSCREEN);
diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
index f02a9dd..497c473 100644
--- a/services/core/java/com/android/server/wm/DisplayPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
@@ -1178,8 +1178,6 @@
return R.anim.dock_left_enter;
}
}
- } else if (win.getAttrs().type == TYPE_DOCK_DIVIDER) {
- return selectDockedDividerAnimation(win, transit);
}
if (transit == TRANSIT_PREVIEW_DONE) {
@@ -1204,36 +1202,6 @@
return ANIMATION_STYLEABLE;
}
- private int selectDockedDividerAnimation(WindowState win, int transit) {
- int insets = mDisplayContent.getDockedDividerController().getContentInsets();
-
- // If the divider is behind the navigation bar, don't animate.
- final Rect frame = win.getFrameLw();
- final boolean behindNavBar = mNavigationBar != null
- && ((mNavigationBarPosition == NAV_BAR_BOTTOM
- && frame.top + insets >= mNavigationBar.getFrameLw().top)
- || (mNavigationBarPosition == NAV_BAR_RIGHT
- && frame.left + insets >= mNavigationBar.getFrameLw().left)
- || (mNavigationBarPosition == NAV_BAR_LEFT
- && frame.right - insets <= mNavigationBar.getFrameLw().right));
- final boolean landscape = frame.height() > frame.width();
- final boolean offscreenLandscape = landscape && (frame.right - insets <= 0
- || frame.left + insets >= win.getDisplayFrameLw().right);
- final boolean offscreenPortrait = !landscape && (frame.top - insets <= 0
- || frame.bottom + insets >= win.getDisplayFrameLw().bottom);
- final boolean offscreen = offscreenLandscape || offscreenPortrait;
- if (behindNavBar || offscreen) {
- return ANIMATION_STYLEABLE;
- }
- if (transit == TRANSIT_ENTER || transit == TRANSIT_SHOW) {
- return R.anim.fade_in;
- } else if (transit == TRANSIT_EXIT) {
- return R.anim.fade_out;
- } else {
- return ANIMATION_STYLEABLE;
- }
- }
-
/**
* Called when a new system UI visibility is being reported, allowing
* the policy to adjust what is actually reported.
diff --git a/services/core/java/com/android/server/wm/DockedStackDividerController.java b/services/core/java/com/android/server/wm/DockedStackDividerController.java
index 958c8ae..20738ed 100644
--- a/services/core/java/com/android/server/wm/DockedStackDividerController.java
+++ b/services/core/java/com/android/server/wm/DockedStackDividerController.java
@@ -16,330 +16,26 @@
package com.android.server.wm;
-import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
-import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
-import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
-import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
-import static android.view.Surface.ROTATION_270;
-import static android.view.Surface.ROTATION_90;
-import static android.view.WindowManager.DOCKED_BOTTOM;
-import static android.view.WindowManager.DOCKED_INVALID;
-import static android.view.WindowManager.DOCKED_LEFT;
-import static android.view.WindowManager.DOCKED_RIGHT;
-import static android.view.WindowManager.DOCKED_TOP;
-import static android.view.WindowManager.TRANSIT_NONE;
-import static android.view.WindowManagerPolicyConstants.NAV_BAR_LEFT;
-import static android.view.WindowManagerPolicyConstants.NAV_BAR_RIGHT;
-
-import static com.android.server.wm.AppTransition.DEFAULT_APP_TRANSITION_DURATION;
-import static com.android.server.wm.AppTransition.TOUCH_RESPONSE_INTERPOLATOR;
-import static com.android.server.wm.DockedStackDividerControllerProto.MINIMIZED_DOCK;
-import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
-import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
-
-import android.content.Context;
-import android.content.res.Configuration;
import android.graphics.Rect;
-import android.os.RemoteCallbackList;
-import android.os.RemoteException;
-import android.util.ArraySet;
-import android.util.Slog;
-import android.util.proto.ProtoOutputStream;
-import android.view.DisplayCutout;
-import android.view.DisplayInfo;
-import android.view.IDockedStackListener;
-import android.view.animation.AnimationUtils;
-import android.view.animation.Interpolator;
-import android.view.animation.PathInterpolator;
-
-import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.inputmethod.SoftInputShowHideReason;
-import com.android.internal.policy.DividerSnapAlgorithm;
-import com.android.internal.policy.DockedDividerUtils;
-import com.android.server.LocalServices;
-import com.android.server.inputmethod.InputMethodManagerInternal;
-import com.android.server.wm.WindowManagerService.H;
-
-import java.io.PrintWriter;
/**
* Keeps information about the docked stack divider.
*/
public class DockedStackDividerController {
- private static final String TAG = TAG_WITH_CLASS_NAME ? "DockedStackDividerController" : TAG_WM;
-
- /**
- * The fraction during the maximize/clip reveal animation the divider meets the edge of the clip
- * revealing surface at the earliest.
- */
- private static final float CLIP_REVEAL_MEET_EARLIEST = 0.6f;
-
- /**
- * The fraction during the maximize/clip reveal animation the divider meets the edge of the clip
- * revealing surface at the latest.
- */
- private static final float CLIP_REVEAL_MEET_LAST = 1f;
-
- /**
- * If the app translates at least CLIP_REVEAL_MEET_FRACTION_MIN * minimize distance, we start
- * meet somewhere between {@link #CLIP_REVEAL_MEET_LAST} and {@link #CLIP_REVEAL_MEET_EARLIEST}.
- */
- private static final float CLIP_REVEAL_MEET_FRACTION_MIN = 0.4f;
-
- /**
- * If the app translates equals or more than CLIP_REVEAL_MEET_FRACTION_MIN * minimize distance,
- * we meet at {@link #CLIP_REVEAL_MEET_EARLIEST}.
- */
- private static final float CLIP_REVEAL_MEET_FRACTION_MAX = 0.8f;
-
- private static final Interpolator IME_ADJUST_ENTRY_INTERPOLATOR =
- new PathInterpolator(0.2f, 0f, 0.1f, 1f);
-
- private static final long IME_ADJUST_ANIM_DURATION = 280;
-
- private static final long IME_ADJUST_DRAWN_TIMEOUT = 200;
-
- private static final int DIVIDER_WIDTH_INACTIVE_DP = 4;
-
- private final WindowManagerService mService;
private final DisplayContent mDisplayContent;
- private int mDividerWindowWidth;
- private int mDividerWindowWidthInactive;
- private int mDividerInsets;
- private int mTaskHeightInMinimizedMode;
private boolean mResizing;
- private WindowState mWindow;
- private final Rect mTmpRect = new Rect();
- private final Rect mTmpRect2 = new Rect();
- private final Rect mTmpRect3 = new Rect();
- private final Rect mLastRect = new Rect();
- private boolean mLastVisibility = false;
- private final RemoteCallbackList<IDockedStackListener> mDockedStackListeners
- = new RemoteCallbackList<>();
- private boolean mMinimizedDock;
- private int mOriginalDockedSide = DOCKED_INVALID;
- private boolean mAnimatingForMinimizedDockedStack;
- private boolean mAnimationStarted;
- private long mAnimationStartTime;
- private float mAnimationStart;
- private float mAnimationTarget;
- private long mAnimationDuration;
- private boolean mAnimationStartDelayed;
- private final Interpolator mMinimizedDockInterpolator;
- private float mMaximizeMeetFraction;
private final Rect mTouchRegion = new Rect();
- private boolean mAnimatingForIme;
- private boolean mAdjustedForIme;
- private int mImeHeight;
- private WindowState mDelayedImeWin;
- private boolean mAdjustedForDivider;
- private float mDividerAnimationStart;
- private float mDividerAnimationTarget;
- float mLastAnimationProgress;
- float mLastDividerProgress;
- private final DividerSnapAlgorithm[] mSnapAlgorithmForRotation = new DividerSnapAlgorithm[4];
- private boolean mImeHideRequested;
- private ActivityStack mDimmedStack;
- DockedStackDividerController(WindowManagerService service, DisplayContent displayContent) {
- mService = service;
+ DockedStackDividerController(DisplayContent displayContent) {
mDisplayContent = displayContent;
- final Context context = service.mContext;
- mMinimizedDockInterpolator = AnimationUtils.loadInterpolator(
- context, android.R.interpolator.fast_out_slow_in);
- loadDimens();
- }
-
- int getSmallestWidthDpForBounds(Rect bounds) {
- final DisplayInfo di = mDisplayContent.getDisplayInfo();
-
- final int baseDisplayWidth = mDisplayContent.mBaseDisplayWidth;
- final int baseDisplayHeight = mDisplayContent.mBaseDisplayHeight;
- int minWidth = Integer.MAX_VALUE;
-
- // Go through all screen orientations and find the orientation in which the task has the
- // smallest width.
- for (int rotation = 0; rotation < 4; rotation++) {
- mTmpRect.set(bounds);
- mDisplayContent.rotateBounds(di.rotation, rotation, mTmpRect);
- final boolean rotated = (rotation == ROTATION_90 || rotation == ROTATION_270);
- mTmpRect2.set(0, 0,
- rotated ? baseDisplayHeight : baseDisplayWidth,
- rotated ? baseDisplayWidth : baseDisplayHeight);
- final int orientation = mTmpRect2.width() <= mTmpRect2.height()
- ? ORIENTATION_PORTRAIT
- : ORIENTATION_LANDSCAPE;
- final int dockSide = getDockSide(mTmpRect, mTmpRect2, orientation, rotation);
- final int position = DockedDividerUtils.calculatePositionForBounds(mTmpRect, dockSide,
- getContentWidth());
-
- final DisplayCutout displayCutout = mDisplayContent.calculateDisplayCutoutForRotation(
- rotation).getDisplayCutout();
-
- // Since we only care about feasible states, snap to the closest snap target, like it
- // would happen when actually rotating the screen.
- final int snappedPosition = mSnapAlgorithmForRotation[rotation]
- .calculateNonDismissingSnapTarget(position).position;
- DockedDividerUtils.calculateBoundsForPosition(snappedPosition, dockSide, mTmpRect,
- mTmpRect2.width(), mTmpRect2.height(), getContentWidth());
- mDisplayContent.getDisplayPolicy().getStableInsetsLw(rotation, mTmpRect2.width(),
- mTmpRect2.height(), displayCutout, mTmpRect3);
- mService.intersectDisplayInsetBounds(mTmpRect2, mTmpRect3, mTmpRect);
- minWidth = Math.min(mTmpRect.width(), minWidth);
- }
- return (int) (minWidth / mDisplayContent.getDisplayMetrics().density);
- }
-
- /**
- * Get the current docked side. Determined by its location of {@param bounds} within
- * {@param displayRect} but if both are the same, it will try to dock to each side and determine
- * if allowed in its respected {@param orientation}.
- *
- * @param bounds bounds of the docked task to get which side is docked
- * @param displayRect bounds of the display that contains the docked task
- * @param orientation the origination of device
- * @return current docked side
- */
- int getDockSide(Rect bounds, Rect displayRect, int orientation, int rotation) {
- if (orientation == Configuration.ORIENTATION_PORTRAIT) {
- // Portrait mode, docked either at the top or the bottom.
- final int diff = (displayRect.bottom - bounds.bottom) - (bounds.top - displayRect.top);
- if (diff > 0) {
- return DOCKED_TOP;
- } else if (diff < 0) {
- return DOCKED_BOTTOM;
- }
- return canPrimaryStackDockTo(DOCKED_TOP, displayRect, rotation)
- ? DOCKED_TOP : DOCKED_BOTTOM;
- } else if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
- // Landscape mode, docked either on the left or on the right.
- final int diff = (displayRect.right - bounds.right) - (bounds.left - displayRect.left);
- if (diff > 0) {
- return DOCKED_LEFT;
- } else if (diff < 0) {
- return DOCKED_RIGHT;
- }
- return canPrimaryStackDockTo(DOCKED_LEFT, displayRect, rotation)
- ? DOCKED_LEFT : DOCKED_RIGHT;
- }
- return DOCKED_INVALID;
- }
-
- void getHomeStackBoundsInDockedMode(Configuration parentConfig, int dockSide, Rect outBounds) {
- final DisplayCutout displayCutout = mDisplayContent.getDisplayInfo().displayCutout;
- final int displayWidth = parentConfig.windowConfiguration.getBounds().width();
- final int displayHeight = parentConfig.windowConfiguration.getBounds().height();
- mDisplayContent.getDisplayPolicy().getStableInsetsLw(
- parentConfig.windowConfiguration.getRotation(), displayWidth, displayHeight,
- displayCutout, mTmpRect);
- int dividerSize = mDividerWindowWidth - 2 * mDividerInsets;
- // The offset in the left (landscape)/top (portrait) is calculated with the minimized
- // offset value with the divider size and any system insets in that direction.
- if (parentConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
- outBounds.set(0, mTaskHeightInMinimizedMode + dividerSize + mTmpRect.top,
- displayWidth, displayHeight);
- } else {
- // In landscape also inset the left/right side with the status bar height to match the
- // minimized size height in portrait mode.
- final int primaryTaskWidth = mTaskHeightInMinimizedMode + dividerSize + mTmpRect.top;
- int left = mTmpRect.left;
- int right = displayWidth - mTmpRect.right;
- if (dockSide == DOCKED_LEFT) {
- left += primaryTaskWidth;
- } else if (dockSide == DOCKED_RIGHT) {
- right -= primaryTaskWidth;
- }
- outBounds.set(left, 0, right, displayHeight);
- }
- }
-
- boolean isHomeStackResizable() {
- final ActivityStack homeStack = mDisplayContent.getRootHomeTask();
- if (homeStack == null) {
- return false;
- }
- final Task homeTask = homeStack.getTopMostTask();
- return homeTask != null && homeTask.isResizeable();
- }
-
- private void initSnapAlgorithmForRotations() {
- final Configuration baseConfig = mDisplayContent.getConfiguration();
-
- // Initialize the snap algorithms for all 4 screen orientations.
- final Configuration config = new Configuration();
- for (int rotation = 0; rotation < 4; rotation++) {
- final boolean rotated = (rotation == ROTATION_90 || rotation == ROTATION_270);
- final int dw = rotated
- ? mDisplayContent.mBaseDisplayHeight
- : mDisplayContent.mBaseDisplayWidth;
- final int dh = rotated
- ? mDisplayContent.mBaseDisplayWidth
- : mDisplayContent.mBaseDisplayHeight;
- final DisplayCutout displayCutout =
- mDisplayContent.calculateDisplayCutoutForRotation(rotation).getDisplayCutout();
- final DisplayPolicy displayPolicy = mDisplayContent.getDisplayPolicy();
- displayPolicy.getStableInsetsLw(rotation, dw, dh, displayCutout, mTmpRect);
- config.unset();
- config.orientation = (dw <= dh) ? ORIENTATION_PORTRAIT : ORIENTATION_LANDSCAPE;
-
- final int appWidth = displayPolicy.getNonDecorDisplayWidth(dw, dh, rotation,
- baseConfig.uiMode, displayCutout);
- final int appHeight = displayPolicy.getNonDecorDisplayHeight(dw, dh, rotation,
- baseConfig.uiMode, displayCutout);
- displayPolicy.getNonDecorInsetsLw(rotation, dw, dh, displayCutout, mTmpRect);
- final int leftInset = mTmpRect.left;
- final int topInset = mTmpRect.top;
-
- config.windowConfiguration.setAppBounds(leftInset /*left*/, topInset /*top*/,
- leftInset + appWidth /*right*/, topInset + appHeight /*bottom*/);
-
- final float density = mDisplayContent.getDisplayMetrics().density;
- config.screenWidthDp = (int) (displayPolicy.getConfigDisplayWidth(dw, dh, rotation,
- baseConfig.uiMode, displayCutout) / density);
- config.screenHeightDp = (int) (displayPolicy.getConfigDisplayHeight(dw, dh, rotation,
- baseConfig.uiMode, displayCutout) / density);
- final Context rotationContext = mService.mContext.createConfigurationContext(config);
- mSnapAlgorithmForRotation[rotation] = new DividerSnapAlgorithm(
- rotationContext.getResources(), dw, dh, getContentWidth(),
- config.orientation == ORIENTATION_PORTRAIT, mTmpRect);
- }
- }
-
- private void loadDimens() {
- final Context context = mService.mContext;
- mDividerWindowWidth = context.getResources().getDimensionPixelSize(
- com.android.internal.R.dimen.docked_stack_divider_thickness);
- mDividerInsets = context.getResources().getDimensionPixelSize(
- com.android.internal.R.dimen.docked_stack_divider_insets);
- mDividerWindowWidthInactive = WindowManagerService.dipToPixel(
- DIVIDER_WIDTH_INACTIVE_DP, mDisplayContent.getDisplayMetrics());
- mTaskHeightInMinimizedMode = context.getResources().getDimensionPixelSize(
- com.android.internal.R.dimen.task_height_of_minimized_mode);
- initSnapAlgorithmForRotations();
- }
-
- void onConfigurationChanged() {
- loadDimens();
}
boolean isResizing() {
return mResizing;
}
- int getContentWidth() {
- return mDividerWindowWidth - 2 * mDividerInsets;
- }
-
- int getContentInsets() {
- return mDividerInsets;
- }
-
- int getContentWidthInactive() {
- return mDividerWindowWidthInactive;
- }
-
void setResizing(boolean resizing) {
if (mResizing != resizing) {
mResizing = resizing;
@@ -353,676 +49,10 @@
void getTouchRegion(Rect outRegion) {
outRegion.set(mTouchRegion);
- if (mWindow != null) {
- outRegion.offset(mWindow.getFrameLw().left, mWindow.getFrameLw().top);
- }
}
private void resetDragResizingChangeReported() {
mDisplayContent.forAllWindows(WindowState::resetDragResizingChangeReported,
true /* traverseTopToBottom */ );
}
-
- void setWindow(WindowState window) {
- mWindow = window;
- reevaluateVisibility(false);
- }
-
- void reevaluateVisibility(boolean force) {
- if (mWindow == null) {
- return;
- }
- ActivityStack stack = mDisplayContent.getRootSplitScreenPrimaryTask();
-
- // If the stack is invisible, we policy force hide it in WindowAnimator.shouldForceHide
- final boolean visible = stack != null;
- if (mLastVisibility == visible && !force) {
- return;
- }
- mLastVisibility = visible;
- notifyDockedDividerVisibilityChanged(visible);
- if (!visible) {
- setResizeDimLayer(false, WINDOWING_MODE_UNDEFINED, 0f);
- }
- }
-
- private boolean wasVisible() {
- return mLastVisibility;
- }
-
- void setAdjustedForIme(
- boolean adjustedForIme, boolean adjustedForDivider,
- boolean animate, WindowState imeWin, int imeHeight) {
- if (mAdjustedForIme != adjustedForIme || (adjustedForIme && mImeHeight != imeHeight)
- || mAdjustedForDivider != adjustedForDivider) {
- if (animate && !mAnimatingForMinimizedDockedStack) {
- // Notify SystemUI to set the target docked stack size according current docked
- // state without animation when calling startImeAdjustAnimation.
- notifyDockedStackMinimizedChanged(mMinimizedDock, false /* animate */,
- isHomeStackResizable());
- startImeAdjustAnimation(adjustedForIme, adjustedForDivider, imeWin);
- } else {
- // Animation might be delayed, so only notify if we don't run an animation.
- notifyAdjustedForImeChanged(adjustedForIme || adjustedForDivider, 0 /* duration */);
- }
- mAdjustedForIme = adjustedForIme;
- mImeHeight = imeHeight;
- mAdjustedForDivider = adjustedForDivider;
- }
- }
-
- int getImeHeightAdjustedFor() {
- return mImeHeight;
- }
-
- void positionDockedStackedDivider(Rect frame) {
- ActivityStack stack = mDisplayContent.getRootSplitScreenPrimaryTask();
- if (stack == null) {
- // Unfortunately we might end up with still having a divider, even though the underlying
- // stack was already removed. This is because we are on AM thread and the removal of the
- // divider was deferred to WM thread and hasn't happened yet. In that case let's just
- // keep putting it in the same place it was before the stack was removed to have
- // continuity and prevent it from jumping to the center. It will get hidden soon.
- frame.set(mLastRect);
- return;
- } else {
- stack.getDimBounds(mTmpRect);
- }
- int side = stack.getDockSide();
- switch (side) {
- case DOCKED_LEFT:
- frame.set(mTmpRect.right - mDividerInsets, frame.top,
- mTmpRect.right + frame.width() - mDividerInsets, frame.bottom);
- break;
- case DOCKED_TOP:
- frame.set(frame.left, mTmpRect.bottom - mDividerInsets,
- mTmpRect.right, mTmpRect.bottom + frame.height() - mDividerInsets);
- break;
- case DOCKED_RIGHT:
- frame.set(mTmpRect.left - frame.width() + mDividerInsets, frame.top,
- mTmpRect.left + mDividerInsets, frame.bottom);
- break;
- case DOCKED_BOTTOM:
- frame.set(frame.left, mTmpRect.top - frame.height() + mDividerInsets,
- frame.right, mTmpRect.top + mDividerInsets);
- break;
- }
- mLastRect.set(frame);
- }
-
- private void notifyDockedDividerVisibilityChanged(boolean visible) {
- final int size = mDockedStackListeners.beginBroadcast();
- for (int i = 0; i < size; ++i) {
- final IDockedStackListener listener = mDockedStackListeners.getBroadcastItem(i);
- try {
- listener.onDividerVisibilityChanged(visible);
- } catch (RemoteException e) {
- Slog.e(TAG_WM, "Error delivering divider visibility changed event.", e);
- }
- }
- mDockedStackListeners.finishBroadcast();
- }
-
- /**
- * Checks if the primary stack is allowed to dock to a specific side based on its original dock
- * side.
- *
- * @param dockSide the side to see if it is valid
- * @return true if the side provided is valid
- */
- boolean canPrimaryStackDockTo(int dockSide, Rect parentRect, int rotation) {
- final DisplayPolicy policy = mDisplayContent.getDisplayPolicy();
- return isDockSideAllowed(dockSide, mOriginalDockedSide,
- policy.navigationBarPosition(parentRect.width(), parentRect.height(), rotation),
- policy.navigationBarCanMove());
- }
-
- @VisibleForTesting
- static boolean isDockSideAllowed(int dockSide, int originalDockSide, int navBarPosition,
- boolean navigationBarCanMove) {
- if (dockSide == DOCKED_TOP) {
- return true;
- }
-
- if (navigationBarCanMove) {
- // Only allow the dockside opposite to the nav bar position in landscape
- return dockSide == DOCKED_LEFT && navBarPosition == NAV_BAR_RIGHT
- || dockSide == DOCKED_RIGHT && navBarPosition == NAV_BAR_LEFT;
- }
-
- // Side is the same as original side
- if (dockSide == originalDockSide) {
- return true;
- }
-
- // Only if original docked side was top in portrait will allow left for landscape
- return dockSide == DOCKED_LEFT && originalDockSide == DOCKED_TOP;
- }
-
- void notifyDockedStackExistsChanged(boolean exists) {
- // TODO(multi-display): Perform all actions only for current display.
- final int size = mDockedStackListeners.beginBroadcast();
- for (int i = 0; i < size; ++i) {
- final IDockedStackListener listener = mDockedStackListeners.getBroadcastItem(i);
- try {
- listener.onDockedStackExistsChanged(exists);
- } catch (RemoteException e) {
- Slog.e(TAG_WM, "Error delivering docked stack exists changed event.", e);
- }
- }
- mDockedStackListeners.finishBroadcast();
- if (exists) {
- InputMethodManagerInternal inputMethodManagerInternal =
- LocalServices.getService(InputMethodManagerInternal.class);
- if (inputMethodManagerInternal != null) {
-
- // Hide the current IME to avoid problems with animations from IME adjustment when
- // attaching the docked stack.
- inputMethodManagerInternal.hideCurrentInputMethod(
- SoftInputShowHideReason.HIDE_DOCKED_STACK_ATTACHED);
- mImeHideRequested = true;
- }
-
- // If a primary stack was just created, it will not have access to display content at
- // this point so pass it from here to get a valid dock side.
- final ActivityStack stack =
- mDisplayContent.getRootSplitScreenPrimaryTask();
- mOriginalDockedSide = stack.getDockSideForDisplay(mDisplayContent);
- return;
- }
- mOriginalDockedSide = DOCKED_INVALID;
- setMinimizedDockedStack(false /* minimizedDock */, false /* animate */);
-
- if (mDimmedStack != null) {
- mDimmedStack.stopDimming();
- mDimmedStack = null;
- }
- }
-
- /**
- * Resets the state that IME hide has been requested. See {@link #isImeHideRequested}.
- */
- void resetImeHideRequested() {
- mImeHideRequested = false;
- }
-
- /**
- * The docked stack divider controller makes sure the IME gets hidden when attaching the docked
- * stack, to avoid animation problems. This flag indicates whether the request to hide the IME
- * has been sent in an asynchronous manner, and the IME should be treated as hidden already.
- *
- * @return whether IME hide request has been sent
- */
- boolean isImeHideRequested() {
- return mImeHideRequested;
- }
-
- private void notifyDockedStackMinimizedChanged(boolean minimizedDock, boolean animate,
- boolean isHomeStackResizable) {
- long animDuration = 0;
- if (animate) {
- final ActivityStack stack =
- mDisplayContent.getRootSplitScreenPrimaryTask();
- final long transitionDuration = isAnimationMaximizing()
- ? mDisplayContent.mAppTransition.getLastClipRevealTransitionDuration()
- : DEFAULT_APP_TRANSITION_DURATION;
- mAnimationDuration = (long)
- (transitionDuration * mService.getTransitionAnimationScaleLocked());
- mMaximizeMeetFraction = getClipRevealMeetFraction(stack);
- animDuration = (long) (mAnimationDuration * mMaximizeMeetFraction);
- }
- final int size = mDockedStackListeners.beginBroadcast();
- for (int i = 0; i < size; ++i) {
- final IDockedStackListener listener = mDockedStackListeners.getBroadcastItem(i);
- try {
- listener.onDockedStackMinimizedChanged(minimizedDock, animDuration,
- isHomeStackResizable);
- } catch (RemoteException e) {
- Slog.e(TAG_WM, "Error delivering minimized dock changed event.", e);
- }
- }
- mDockedStackListeners.finishBroadcast();
- // Only notify ATM after we update the remote listeners, otherwise it may trigger another
- // minimize change, which would lead to an inversion of states send to the listeners
- mService.mAtmInternal.notifyDockedStackMinimizedChanged(minimizedDock);
- }
-
- void notifyDockSideChanged(int newDockSide) {
- final int size = mDockedStackListeners.beginBroadcast();
- for (int i = 0; i < size; ++i) {
- final IDockedStackListener listener = mDockedStackListeners.getBroadcastItem(i);
- try {
- listener.onDockSideChanged(newDockSide);
- } catch (RemoteException e) {
- Slog.e(TAG_WM, "Error delivering dock side changed event.", e);
- }
- }
- mDockedStackListeners.finishBroadcast();
- }
-
- private void notifyAdjustedForImeChanged(boolean adjustedForIme, long animDuration) {
- final int size = mDockedStackListeners.beginBroadcast();
- for (int i = 0; i < size; ++i) {
- final IDockedStackListener listener = mDockedStackListeners.getBroadcastItem(i);
- try {
- listener.onAdjustedForImeChanged(adjustedForIme, animDuration);
- } catch (RemoteException e) {
- Slog.e(TAG_WM, "Error delivering adjusted for ime changed event.", e);
- }
- }
- mDockedStackListeners.finishBroadcast();
- }
-
- void registerDockedStackListener(IDockedStackListener listener) {
- mDockedStackListeners.register(listener);
- notifyDockedDividerVisibilityChanged(wasVisible());
- notifyDockedStackExistsChanged(
- mDisplayContent.getRootSplitScreenPrimaryTask() != null);
- notifyDockedStackMinimizedChanged(mMinimizedDock, false /* animate */,
- isHomeStackResizable());
- notifyAdjustedForImeChanged(mAdjustedForIme, 0 /* animDuration */);
-
- }
-
- /**
- * Shows a dim layer with {@param alpha} if {@param visible} is true and
- * {@param targetWindowingMode} isn't
- * {@link android.app.WindowConfiguration#WINDOWING_MODE_UNDEFINED} and there is a stack on the
- * display in that windowing mode.
- */
- void setResizeDimLayer(boolean visible, int targetWindowingMode, float alpha) {
- // TODO: Maybe only allow split-screen windowing modes?
- final ActivityStack stack = targetWindowingMode != WINDOWING_MODE_UNDEFINED
- ? mDisplayContent.getTopStackInWindowingMode(targetWindowingMode)
- : null;
- final ActivityStack dockedStack = mDisplayContent.getRootSplitScreenPrimaryTask();
- boolean visibleAndValid = visible && stack != null && dockedStack != null;
-
- // Ensure an old dim that was shown for the docked stack divider is removed so we don't end
- // up with dim layers that can no longer be removed.
- if (mDimmedStack != null && mDimmedStack != stack) {
- mDimmedStack.stopDimming();
- mDimmedStack = null;
- }
-
- if (visibleAndValid) {
- mDimmedStack = stack;
- stack.dim(alpha);
- }
- if (!visibleAndValid && stack != null) {
- mDimmedStack = null;
- stack.stopDimming();
- }
- }
-
- /**
- * Notifies the docked stack divider controller of a visibility change that happens without
- * an animation.
- */
- void notifyAppVisibilityChanged() {
- checkMinimizeChanged(false /* animate */);
- }
-
- void notifyAppTransitionStarting(ArraySet<ActivityRecord> openingApps, int appTransition) {
- final boolean wasMinimized = mMinimizedDock;
- checkMinimizeChanged(true /* animate */);
-
- // We were minimized, and now we are still minimized, but somebody is trying to launch an
- // app in docked stack, better show recent apps so we actually get unminimized! However do
- // not do this if keyguard is dismissed such as when the device is unlocking. This catches
- // any case that was missed in ActivityStarter.postStartActivityUncheckedProcessing because
- // we couldn't retrace the launch of the app in the docked stack to the launch from
- // homescreen.
- if (wasMinimized && mMinimizedDock && containsAppInDockedStack(openingApps)
- && appTransition != TRANSIT_NONE &&
- !AppTransition.isKeyguardGoingAwayTransit(appTransition)) {
- if (mService.mAtmInternal.isRecentsComponentHomeActivity(mService.mCurrentUserId)) {
- // When the home activity is the recents component and we are already minimized,
- // then there is nothing to do here since home is already visible
- } else {
- mService.showRecentApps();
- }
- }
- }
-
- /**
- * @return true if {@param apps} contains an activity in the docked stack, false otherwise.
- */
- private boolean containsAppInDockedStack(ArraySet<ActivityRecord> apps) {
- for (int i = apps.size() - 1; i >= 0; i--) {
- final ActivityRecord activity = apps.valueAt(i);
- if (activity.getTask() != null && activity.inSplitScreenPrimaryWindowingMode()) {
- return true;
- }
- }
- return false;
- }
-
- boolean isMinimizedDock() {
- return mMinimizedDock;
- }
-
- void checkMinimizeChanged(boolean animate) {
- if (mDisplayContent.getRootSplitScreenPrimaryTask() == null) {
- return;
- }
- final ActivityStack homeStack = mDisplayContent.getRootHomeTask();
- if (homeStack == null) {
- return;
- }
- final Task homeTask = homeStack.getTopMostTask();
- if (homeTask == null || !isWithinDisplay(homeTask)) {
- return;
- }
-
- // Do not minimize when dock is already minimized while keyguard is showing and not
- // occluded such as unlocking the screen
- if (mMinimizedDock && mService.mKeyguardOrAodShowingOnDefaultDisplay) {
- return;
- }
- final ActivityStack topSecondaryStack = mDisplayContent.getTopStackInWindowingMode(
- WINDOWING_MODE_SPLIT_SCREEN_SECONDARY);
- final RecentsAnimationController recentsAnim = mService.getRecentsAnimationController();
- final boolean minimizedForRecentsAnimation = recentsAnim != null &&
- recentsAnim.isSplitScreenMinimized();
- boolean homeVisible = homeTask.getTopVisibleActivity() != null;
- if (homeVisible && topSecondaryStack != null) {
- // Home should only be considered visible if it is greater or equal to the top secondary
- // stack in terms of z-order.
- homeVisible = homeStack.compareTo(topSecondaryStack) >= 0;
- }
- setMinimizedDockedStack(homeVisible || minimizedForRecentsAnimation, animate);
- }
-
- private boolean isWithinDisplay(Task task) {
- task.getBounds(mTmpRect);
- mDisplayContent.getBounds(mTmpRect2);
- return mTmpRect.intersect(mTmpRect2);
- }
-
- /**
- * Sets whether the docked stack is currently in a minimized state, i.e. all the tasks in the
- * docked stack are heavily clipped so you can only see a minimal peek state.
- *
- * @param minimizedDock Whether the docked stack is currently minimized.
- * @param animate Whether to animate the change.
- */
- void setMinimizedDockedStack(boolean minimizedDock, boolean animate) {
- final boolean wasMinimized = mMinimizedDock;
- mMinimizedDock = minimizedDock;
- if (minimizedDock == wasMinimized) {
- return;
- }
-
- final boolean imeChanged = clearImeAdjustAnimation();
- boolean minimizedChange = false;
- if (isHomeStackResizable()) {
- notifyDockedStackMinimizedChanged(minimizedDock, animate,
- true /* isHomeStackResizable */);
- minimizedChange = true;
- } else {
- if (minimizedDock) {
- if (animate) {
- startAdjustAnimation(0f, 1f);
- } else {
- minimizedChange |= setMinimizedDockedStack(true);
- }
- } else {
- if (animate) {
- startAdjustAnimation(1f, 0f);
- } else {
- minimizedChange |= setMinimizedDockedStack(false);
- }
- }
- }
- if (imeChanged || minimizedChange) {
- if (imeChanged && !minimizedChange) {
- Slog.d(TAG, "setMinimizedDockedStack: IME adjust changed due to minimizing,"
- + " minimizedDock=" + minimizedDock
- + " minimizedChange=" + minimizedChange);
- }
- mService.mWindowPlacerLocked.performSurfacePlacement();
- }
- }
-
- private boolean clearImeAdjustAnimation() {
- final boolean changed = mDisplayContent.clearImeAdjustAnimation();
- mAnimatingForIme = false;
- return changed;
- }
-
- private void startAdjustAnimation(float from, float to) {
- mAnimatingForMinimizedDockedStack = true;
- mAnimationStarted = false;
- mAnimationStart = from;
- mAnimationTarget = to;
- }
-
- private void startImeAdjustAnimation(
- boolean adjustedForIme, boolean adjustedForDivider, WindowState imeWin) {
-
- // If we're not in an animation, the starting point depends on whether we're adjusted
- // or not. If we're already in an animation, we start from where the current animation
- // left off, so that the motion doesn't look discontinuous.
- if (!mAnimatingForIme) {
- mAnimationStart = mAdjustedForIme ? 1 : 0;
- mDividerAnimationStart = mAdjustedForDivider ? 1 : 0;
- mLastAnimationProgress = mAnimationStart;
- mLastDividerProgress = mDividerAnimationStart;
- } else {
- mAnimationStart = mLastAnimationProgress;
- mDividerAnimationStart = mLastDividerProgress;
- }
- mAnimatingForIme = true;
- mAnimationStarted = false;
- mAnimationTarget = adjustedForIme ? 1 : 0;
- mDividerAnimationTarget = adjustedForDivider ? 1 : 0;
-
- mDisplayContent.beginImeAdjustAnimation();
-
- // We put all tasks into drag resizing mode - wait until all of them have completed the
- // drag resizing switch.
- final Runnable existingWaitingForDrwanCallback =
- mService.mWaitingForDrawnCallbacks.get(mService.mRoot);
- if (existingWaitingForDrwanCallback != null) {
- mService.mH.removeMessages(H.WAITING_FOR_DRAWN_TIMEOUT, mService.mRoot);
- mService.mH.sendMessageDelayed(mService.mH.obtainMessage(H.WAITING_FOR_DRAWN_TIMEOUT,
- mService.mRoot),
- IME_ADJUST_DRAWN_TIMEOUT);
- mAnimationStartDelayed = true;
- if (imeWin != null) {
-
- // There might be an old window delaying the animation start - clear it.
- if (mDelayedImeWin != null) {
- mDelayedImeWin.endDelayingAnimationStart();
- }
- mDelayedImeWin = imeWin;
- imeWin.startDelayingAnimationStart();
- }
-
- // If we are already waiting for something to be drawn, clear out the old one so it
- // still gets executed.
- // TODO: Have a real system where we can wait on different windows to be drawn with
- // different callbacks.
- existingWaitingForDrwanCallback.run();
- mService.mWaitingForDrawnCallbacks.put(mService.mRoot, () -> {
- synchronized (mService.mGlobalLock) {
- mAnimationStartDelayed = false;
- if (mDelayedImeWin != null) {
- mDelayedImeWin.endDelayingAnimationStart();
- }
- // If the adjust status changed since this was posted, only notify
- // the new states and don't animate.
- long duration = 0;
- if (mAdjustedForIme == adjustedForIme
- && mAdjustedForDivider == adjustedForDivider) {
- duration = IME_ADJUST_ANIM_DURATION;
- } else {
- Slog.w(TAG, "IME adjust changed while waiting for drawn:"
- + " adjustedForIme=" + adjustedForIme
- + " adjustedForDivider=" + adjustedForDivider
- + " mAdjustedForIme=" + mAdjustedForIme
- + " mAdjustedForDivider=" + mAdjustedForDivider);
- }
- notifyAdjustedForImeChanged(
- mAdjustedForIme || mAdjustedForDivider, duration);
- }
- });
- } else {
- notifyAdjustedForImeChanged(
- adjustedForIme || adjustedForDivider, IME_ADJUST_ANIM_DURATION);
- }
- }
-
- private boolean setMinimizedDockedStack(boolean minimized) {
- final ActivityStack stack = mDisplayContent.getRootSplitScreenPrimaryTask();
- notifyDockedStackMinimizedChanged(minimized, false /* animate */, isHomeStackResizable());
- return stack != null && stack.setAdjustedForMinimizedDock(minimized ? 1f : 0f);
- }
-
- private boolean isAnimationMaximizing() {
- return mAnimationTarget == 0f;
- }
-
- public boolean animate(long now) {
- if (mWindow == null) {
- return false;
- }
- if (mAnimatingForMinimizedDockedStack) {
- return animateForMinimizedDockedStack(now);
- } else if (mAnimatingForIme && !mDisplayContent.mAppTransition.isRunning()) {
- // To prevent task stack resize animation may flicking when playing app transition
- // animation & IME window enter animation in parallel, make sure app transition is done
- // and then start to animate for IME.
- return animateForIme(now);
- }
- return false;
- }
-
- private boolean animateForIme(long now) {
- if (!mAnimationStarted || mAnimationStartDelayed) {
- mAnimationStarted = true;
- mAnimationStartTime = now;
- mAnimationDuration = (long)
- (IME_ADJUST_ANIM_DURATION * mService.getWindowAnimationScaleLocked());
- }
- float t = Math.min(1f, (float) (now - mAnimationStartTime) / mAnimationDuration);
- t = (mAnimationTarget == 1f ? IME_ADJUST_ENTRY_INTERPOLATOR : TOUCH_RESPONSE_INTERPOLATOR)
- .getInterpolation(t);
- final boolean updated =
- mDisplayContent.animateForIme(t, mAnimationTarget, mDividerAnimationTarget);
- if (updated) {
- mService.mWindowPlacerLocked.performSurfacePlacement();
- }
- if (t >= 1.0f) {
- mLastAnimationProgress = mAnimationTarget;
- mLastDividerProgress = mDividerAnimationTarget;
- mAnimatingForIme = false;
- return false;
- } else {
- return true;
- }
- }
-
- private boolean animateForMinimizedDockedStack(long now) {
- final ActivityStack stack = mDisplayContent.getRootSplitScreenPrimaryTask();
- if (!mAnimationStarted) {
- mAnimationStarted = true;
- mAnimationStartTime = now;
- notifyDockedStackMinimizedChanged(mMinimizedDock, true /* animate */,
- isHomeStackResizable() /* isHomeStackResizable */);
- }
- float t = Math.min(1f, (float) (now - mAnimationStartTime) / mAnimationDuration);
- t = (isAnimationMaximizing() ? TOUCH_RESPONSE_INTERPOLATOR : mMinimizedDockInterpolator)
- .getInterpolation(t);
- if (stack != null) {
- if (stack.setAdjustedForMinimizedDock(getMinimizeAmount(stack, t))) {
- mService.mWindowPlacerLocked.performSurfacePlacement();
- }
- }
- if (t >= 1.0f) {
- mAnimatingForMinimizedDockedStack = false;
- return false;
- } else {
- return true;
- }
- }
-
- float getInterpolatedAnimationValue(float t) {
- return t * mAnimationTarget + (1 - t) * mAnimationStart;
- }
-
- float getInterpolatedDividerValue(float t) {
- return t * mDividerAnimationTarget + (1 - t) * mDividerAnimationStart;
- }
-
- /**
- * Gets the amount how much to minimize a stack depending on the interpolated fraction t.
- */
- private float getMinimizeAmount(ActivityStack stack, float t) {
- final float naturalAmount = getInterpolatedAnimationValue(t);
- if (isAnimationMaximizing()) {
- return adjustMaximizeAmount(stack, t, naturalAmount);
- } else {
- return naturalAmount;
- }
- }
-
- /**
- * When maximizing the stack during a clip reveal transition, this adjusts the minimize amount
- * during the transition such that the edge of the clip reveal rect is met earlier in the
- * transition so we don't create a visible "hole", but only if both the clip reveal and the
- * docked stack divider start from about the same portion on the screen.
- */
- private float adjustMaximizeAmount(ActivityStack stack, float t, float naturalAmount) {
- if (mMaximizeMeetFraction == 1f) {
- return naturalAmount;
- }
- final int minimizeDistance = stack.getMinimizeDistance();
- final float startPrime = mDisplayContent.mAppTransition.getLastClipRevealMaxTranslation()
- / (float) minimizeDistance;
- final float amountPrime = t * mAnimationTarget + (1 - t) * startPrime;
- final float t2 = Math.min(t / mMaximizeMeetFraction, 1);
- return amountPrime * t2 + naturalAmount * (1 - t2);
- }
-
- /**
- * Retrieves the animation fraction at which the docked stack has to meet the clip reveal
- * edge. See {@link #adjustMaximizeAmount}.
- */
- private float getClipRevealMeetFraction(ActivityStack stack) {
- if (!isAnimationMaximizing() || stack == null ||
- !mDisplayContent.mAppTransition.hadClipRevealAnimation()) {
- return 1f;
- }
- final int minimizeDistance = stack.getMinimizeDistance();
- final float fraction = Math.abs(mDisplayContent.mAppTransition
- .getLastClipRevealMaxTranslation()) / (float) minimizeDistance;
- final float t = Math.max(0, Math.min(1, (fraction - CLIP_REVEAL_MEET_FRACTION_MIN)
- / (CLIP_REVEAL_MEET_FRACTION_MAX - CLIP_REVEAL_MEET_FRACTION_MIN)));
- return CLIP_REVEAL_MEET_EARLIEST
- + (1 - t) * (CLIP_REVEAL_MEET_LAST - CLIP_REVEAL_MEET_EARLIEST);
- }
-
- public String toShortString() {
- return TAG;
- }
-
- WindowState getWindow() {
- return mWindow;
- }
-
- void dump(String prefix, PrintWriter pw) {
- pw.println(prefix + "DockedStackDividerController");
- pw.println(prefix + " mLastVisibility=" + mLastVisibility);
- pw.println(prefix + " mMinimizedDock=" + mMinimizedDock);
- pw.println(prefix + " mAdjustedForIme=" + mAdjustedForIme);
- pw.println(prefix + " mAdjustedForDivider=" + mAdjustedForDivider);
- }
-
- void dumpDebug(ProtoOutputStream proto, long fieldId) {
- final long token = proto.start(fieldId);
- proto.write(MINIMIZED_DOCK, mMinimizedDock);
- proto.end(token);
- }
}
diff --git a/services/core/java/com/android/server/wm/RecentsAnimationController.java b/services/core/java/com/android/server/wm/RecentsAnimationController.java
index e69551a..3e0cff1 100644
--- a/services/core/java/com/android/server/wm/RecentsAnimationController.java
+++ b/services/core/java/com/android/server/wm/RecentsAnimationController.java
@@ -125,10 +125,6 @@
// enabled for it to start intercepting touch events.
private boolean mInputConsumerEnabled;
- // Whether or not the recents animation should cause the primary split-screen stack to be
- // minimized
- private boolean mSplitScreenMinimized;
-
private final Rect mTmpRect = new Rect();
private boolean mLinkedToDeathOfRunner;
@@ -277,23 +273,6 @@
}
@Override
- public void setSplitScreenMinimized(boolean minimized) {
- final long token = Binder.clearCallingIdentity();
- try {
- synchronized (mService.getWindowManagerLock()) {
- if (mCanceled) {
- return;
- }
-
- mSplitScreenMinimized = minimized;
- mService.checkSplitScreenMinimizedChanged(true /* animate */);
- }
- } finally {
- Binder.restoreCallingIdentity(token);
- }
- }
-
- @Override
public void hideCurrentInputMethod() {
final long token = Binder.clearCallingIdentity();
try {
@@ -738,10 +717,6 @@
}
}
- boolean isSplitScreenMinimized() {
- return mSplitScreenMinimized;
- }
-
boolean isWallpaperVisible(WindowState w) {
return w != null && w.mAttrs.type == TYPE_BASE_APPLICATION &&
((w.mActivityRecord != null && mTargetActivityRecord == w.mActivityRecord)
@@ -944,7 +919,6 @@
pw.print(innerPrefix); pw.println("mPendingAnimations=" + mPendingAnimations.size());
pw.print(innerPrefix); pw.println("mCanceled=" + mCanceled);
pw.print(innerPrefix); pw.println("mInputConsumerEnabled=" + mInputConsumerEnabled);
- pw.print(innerPrefix); pw.println("mSplitScreenMinimized=" + mSplitScreenMinimized);
pw.print(innerPrefix); pw.println("mTargetActivityRecord=" + mTargetActivityRecord);
pw.print(innerPrefix); pw.println("isTargetOverWallpaper=" + isTargetOverWallpaper());
pw.print(innerPrefix); pw.println("mRequestDeferCancelUntilNextTransition="
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java
index 64d7db2..855da61 100644
--- a/services/core/java/com/android/server/wm/RootWindowContainer.java
+++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -1011,9 +1011,7 @@
// Send any pending task-info changes that were queued-up during a layout deferment
mWmService.mAtmService.mTaskOrganizerController.dispatchPendingTaskInfoChanges();
- if (DEBUG_WINDOW_TRACE) Slog.e(TAG,
- "performSurfacePlacementInner exit: animating="
- + mWmService.mAnimator.isAnimating());
+ if (DEBUG_WINDOW_TRACE) Slog.e(TAG, "performSurfacePlacementInner exit");
}
private void checkAppTransitionReady(WindowSurfacePlacer surfacePlacer) {
@@ -1989,8 +1987,7 @@
// We dismiss the docked stack whenever we switch users.
final ActivityStack dockedStack = getDefaultDisplay().getRootSplitScreenPrimaryTask();
if (dockedStack != null) {
- mStackSupervisor.moveTasksToFullscreenStackLocked(
- dockedStack, dockedStack.isFocusedStackOnDisplay());
+ getDefaultDisplay().onSplitScreenModeDismissed();
}
// Also dismiss the pinned stack whenever we switch users. Removing the pinned stack will
// also cause all tasks to be moved to the fullscreen stack at a position that is
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index 76805e9..b81cc91 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -2036,18 +2036,6 @@
intersectWithInsetsIfFits(outStableBounds, mTmpBounds, mTmpInsets);
}
- /**
- * Asks docked-divider controller for the smallestwidthdp given bounds.
- * @param bounds bounds to calculate smallestwidthdp for.
- */
- private int getSmallestScreenWidthDpForDockedBounds(Rect bounds) {
- DisplayContent dc = getDisplayContent();
- if (dc != null) {
- return dc.getDockedDividerController().getSmallestWidthDpForBounds(bounds);
- }
- return Configuration.SMALLEST_SCREEN_WIDTH_DP_UNDEFINED;
- }
-
void computeConfigResourceOverrides(@NonNull Configuration inOutConfig,
@NonNull Configuration parentConfig) {
computeConfigResourceOverrides(inOutConfig, parentConfig, null /* compatInsets */);
diff --git a/services/core/java/com/android/server/wm/WindowAnimator.java b/services/core/java/com/android/server/wm/WindowAnimator.java
index fd91bc5..b6be386 100644
--- a/services/core/java/com/android/server/wm/WindowAnimator.java
+++ b/services/core/java/com/android/server/wm/WindowAnimator.java
@@ -50,7 +50,6 @@
final WindowManagerPolicy mPolicy;
/** Is any window animating? */
- private boolean mAnimating;
private boolean mLastRootAnimating;
final Choreographer.FrameCallback mAnimationFrameCallback;
@@ -135,7 +134,6 @@
synchronized (mService.mGlobalLock) {
mCurrentTime = frameTimeNs / TimeUtils.NANOS_PER_MS;
mBulkUpdateParams = SET_ORIENTATION_CHANGE_COMPLETE;
- mAnimating = false;
if (DEBUG_WINDOW_TRACE) {
Slog.i(TAG, "!!! animate: entry time=" + mCurrentTime);
}
@@ -160,17 +158,12 @@
final DisplayContent dc = mService.mRoot.getDisplayContent(displayId);
dc.checkAppWindowsReadyToShow();
- orAnimating(dc.getDockedDividerController().animate(mCurrentTime));
if (accessibilityController != null) {
accessibilityController.drawMagnifiedRegionBorderIfNeededLocked(displayId,
mTransaction);
}
}
- if (!mAnimating) {
- cancelAnimation();
- }
-
if (mService.mWatermark != null) {
mService.mWatermark.drawIfNeeded();
}
@@ -220,7 +213,7 @@
executeAfterPrepareSurfacesRunnables();
if (DEBUG_WINDOW_TRACE) {
- Slog.i(TAG, "!!! animate: exit mAnimating=" + mAnimating
+ Slog.i(TAG, "!!! animate: exit"
+ " mBulkUpdateParams=" + Integer.toHexString(mBulkUpdateParams)
+ " hasPendingLayoutChanges=" + hasPendingLayoutChanges);
}
@@ -302,10 +295,6 @@
private class DisplayContentsAnimator {
}
- boolean isAnimating() {
- return mAnimating;
- }
-
boolean isAnimationScheduled() {
return mAnimationFrameCallbackScheduled;
}
@@ -314,14 +303,6 @@
return mChoreographer;
}
- void setAnimating(boolean animating) {
- mAnimating = animating;
- }
-
- void orAnimating(boolean animating) {
- mAnimating |= animating;
- }
-
/**
* Adds a runnable to be executed after {@link WindowContainer#prepareSurfaces} is called and
* the corresponding transaction is closed and applied.
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index e0f8f0e..a59eab5 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -42,7 +42,6 @@
import static android.provider.Settings.Global.DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Display.INVALID_DISPLAY;
-import static android.view.WindowManager.DOCKED_INVALID;
import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
import static android.view.WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
@@ -59,7 +58,6 @@
import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
import static android.view.WindowManager.LayoutParams.TYPE_ACCESSIBILITY_OVERLAY;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
-import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER;
import static android.view.WindowManager.LayoutParams.TYPE_DREAM;
import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD;
import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG;
@@ -214,7 +212,6 @@
import android.view.IDisplayWindowInsetsController;
import android.view.IDisplayWindowListener;
import android.view.IDisplayWindowRotationController;
-import android.view.IDockedStackListener;
import android.view.IInputFilter;
import android.view.IOnKeyguardExitResult;
import android.view.IPinnedStackListener;
@@ -1636,14 +1633,6 @@
}
}
- // If the window is being added to a stack that's currently adjusted for IME,
- // make sure to apply the same adjust to this new window.
- win.applyAdjustForImeIfNeeded();
-
- if (type == TYPE_DOCK_DIVIDER) {
- mRoot.getDisplayContent(displayId).getDockedDividerController().setWindow(win);
- }
-
final WindowStateAnimator winAnimator = win.mWinAnimator;
winAnimator.mEnterAnimationPending = true;
winAnimator.mEnteringAnimation = true;
@@ -2816,16 +2805,6 @@
}
}
- void setDockedStackCreateStateLocked(int mode, Rect bounds) {
- mDockedStackCreateMode = mode;
- mDockedStackCreateBounds = bounds;
- }
-
- void checkSplitScreenMinimizedChanged(boolean animate) {
- final DisplayContent displayContent = getDefaultDisplayContentLocked();
- displayContent.getDockedDividerController().checkMinimizeChanged(animate);
- }
-
boolean isValidPictureInPictureAspectRatio(DisplayContent displayContent, float aspectRatio) {
return displayContent.getPinnedStackController().isValidPictureInPictureAspectRatio(
aspectRatio);
@@ -3295,10 +3274,6 @@
// Notify whether the docked stack exists for the current user
final DisplayContent displayContent = getDefaultDisplayContentLocked();
- final ActivityStack stack =
- displayContent.getRootSplitScreenPrimaryTask();
- displayContent.mDividerControllerLocked.notifyDockedStackExistsChanged(
- stack != null && stack.hasTaskForUser(newUserId));
mRoot.forAllDisplays(dc -> dc.mAppTransition.setCurrentUser(newUserId));
@@ -4687,7 +4662,7 @@
public static final int RESET_ANR_MESSAGE = 38;
public static final int WALLPAPER_DRAW_PENDING_TIMEOUT = 39;
- public static final int UPDATE_DOCKED_STACK_DIVIDER = 41;
+ public static final int UPDATE_MULTI_WINDOW_STACKS = 41;
public static final int WINDOW_REPLACEMENT_TIMEOUT = 46;
@@ -4832,7 +4807,7 @@
synchronized (mGlobalLock) {
// Since we're holding both mWindowMap and mAnimator we don't need to
// hold mAnimator.mLayoutToAnim.
- if (mAnimator.isAnimating() || mAnimator.isAnimationScheduled()) {
+ if (mAnimator.isAnimationScheduled()) {
// If we are animating, don't do the gc now but
// delay a bit so we don't interrupt the animation.
sendEmptyMessageDelayed(H.FORCE_GC, 2000);
@@ -4994,11 +4969,10 @@
}
break;
}
- case UPDATE_DOCKED_STACK_DIVIDER: {
+ case UPDATE_MULTI_WINDOW_STACKS: {
synchronized (mGlobalLock) {
final DisplayContent displayContent = getDefaultDisplayContentLocked();
if (displayContent != null) {
- displayContent.getDockedDividerController().reevaluateVisibility(false);
displayContent.adjustForImeIfNeeded();
}
}
@@ -6551,11 +6525,7 @@
@Override
public int getDockedStackSide() {
- synchronized (mGlobalLock) {
- final ActivityStack dockedStack = getDefaultDisplayContentLocked()
- .getRootSplitScreenPrimaryTask();
- return dockedStack == null ? DOCKED_INVALID : dockedStack.getDockSide();
- }
+ return 0;
}
void setDockedStackResizing(boolean resizing) {
@@ -6572,14 +6542,6 @@
}
}
- @Override
- public void setResizeDimLayer(boolean visible, int targetWindowingMode, float alpha) {
- synchronized (mGlobalLock) {
- getDefaultDisplayContentLocked().getDockedDividerController().setResizeDimLayer(
- visible, targetWindowingMode, alpha);
- }
- }
-
void setForceDesktopModeOnExternalDisplays(boolean forceDesktopModeOnExternalDisplays) {
synchronized (mGlobalLock) {
mForceDesktopModeOnExternalDisplays = forceDesktopModeOnExternalDisplays;
@@ -6598,17 +6560,6 @@
}
@Override
- public void registerDockedStackListener(IDockedStackListener listener) {
- mAtmInternal.enforceCallerIsRecentsOrHasPermission(REGISTER_WINDOW_MANAGER_LISTENERS,
- "registerDockedStackListener()");
- synchronized (mGlobalLock) {
- // TODO(multi-display): The listener is registered on the default display only.
- getDefaultDisplayContentLocked().mDividerControllerLocked.registerDockedStackListener(
- listener);
- }
- }
-
- @Override
public void registerPinnedStackListener(int displayId, IPinnedStackListener listener) {
if (!checkCallingPermission(REGISTER_WINDOW_MANAGER_LISTENERS,
"registerPinnedStackListener()")) {
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 37597fb..b0729a2 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -1128,7 +1128,6 @@
}
}
} else if (mAttrs.type == TYPE_DOCK_DIVIDER) {
- dc.getDockedDividerController().positionDockedStackedDivider(windowFrames.mFrame);
windowFrames.mContentFrame.set(windowFrames.mFrame);
if (!windowFrames.mFrame.equals(windowFrames.mLastFrame)) {
mMovedByResize = true;
@@ -1937,13 +1936,9 @@
// animating... let's do something.
final int left = mWindowFrames.mFrame.left;
final int top = mWindowFrames.mFrame.top;
- final Task task = getTask();
- final boolean adjustedForMinimizedDockOrIme = task != null
- && (task.getStack().isAdjustedForMinimizedDockedStack()
- || task.getStack().isAdjustedForIme());
if (mToken.okToAnimate()
&& (mAttrs.privateFlags & PRIVATE_FLAG_NO_MOVE_ANIMATION) == 0
- && !isDragResizing() && !adjustedForMinimizedDockOrIme
+ && !isDragResizing()
&& getWindowConfiguration().hasMovementAnimations()
&& !mWinAnimator.mLastHidden
&& !mSeamlesslyRotated) {
@@ -2412,13 +2407,6 @@
}
}
- void applyAdjustForImeIfNeeded() {
- final Task task = getTask();
- if (task != null && task.getStack() != null && task.getStack().isAdjustedForIme()) {
- task.getStack().applyAdjustForImeIfNeeded(task);
- }
- }
-
@Override
void switchUser(int userId) {
super.switchUser(userId);
@@ -4308,10 +4296,6 @@
}
}
- if (mAttrs.type == TYPE_INPUT_METHOD) {
- getDisplayContent().mDividerControllerLocked.resetImeHideRequested();
- }
-
return true;
}