diff options
Diffstat (limited to 'com/android/server/wm/WindowState.java')
-rw-r--r-- | com/android/server/wm/WindowState.java | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/com/android/server/wm/WindowState.java b/com/android/server/wm/WindowState.java index e1715284..4ff0f391 100644 --- a/com/android/server/wm/WindowState.java +++ b/com/android/server/wm/WindowState.java @@ -16,7 +16,10 @@ package com.android.server.wm; +import static android.app.ActivityManager.StackId; +import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID; import static android.app.ActivityManager.StackId.INVALID_STACK_ID; +import static android.app.ActivityManager.StackId.PINNED_STACK_ID; import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_CONTENT; @@ -80,6 +83,7 @@ import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_POWER; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_RESIZE; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STARTING_WINDOW; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STARTING_WINDOW_VERBOSE; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_SURFACE_TRACE; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_VISIBILITY; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WALLPAPER_LIGHT; import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; @@ -811,12 +815,13 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP final WindowState imeWin = mService.mInputMethodWindow; // IME is up and obscuring this window. Adjust the window position so it is visible. if (imeWin != null && imeWin.isVisibleNow() && mService.mInputMethodTarget == this) { - if (inFreeformWindowingMode() + final int stackId = getStackId(); + if (stackId == FREEFORM_WORKSPACE_STACK_ID && mContainingFrame.bottom > contentFrame.bottom) { // In freeform we want to move the top up directly. // TODO: Investigate why this is contentFrame not parentFrame. mContainingFrame.top -= mContainingFrame.bottom - contentFrame.bottom; - } else if (!inPinnedWindowingMode() + } else if (stackId != PINNED_STACK_ID && mContainingFrame.bottom > parentFrame.bottom) { // But in docked we want to behave like fullscreen and behave as if the task // were given smaller bounds for the purposes of layout. Skip adjustments for @@ -893,7 +898,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // For pinned workspace the frame isn't limited in any particular // way since SystemUI controls the bounds. For freeform however // we want to keep things inside the content frame. - final Rect limitFrame = task.inPinnedWindowingMode() ? mFrame : mContentFrame; + final Rect limitFrame = task.inPinnedWorkspace() ? mFrame : mContentFrame; // Keep the frame out of the blocked system area, limit it in size to the content area // and make sure that there is always a minimum visible so that the user can drag it // into a usable area.. @@ -1205,7 +1210,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // application when it has finished drawing. if (getOrientationChanging() || dragResizingChanged || isResizedWhileNotDragResizing()) { - if (DEBUG_ANIM || DEBUG_ORIENTATION || DEBUG_RESIZE) { + if (DEBUG_SURFACE_TRACE || DEBUG_ANIM || DEBUG_ORIENTATION || DEBUG_RESIZE) { Slog.v(TAG_WM, "Orientation or resize start waiting for draw" + ", mDrawState=DRAW_PENDING in " + this + ", surfaceController " + winAnimator.mSurfaceController); @@ -1657,9 +1662,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // // Anyway we don't need to synchronize position and content updates for these // windows since they aren't at the base layer and could be moved around anyway. - if (!computeDragResizing() && mAttrs.type == TYPE_BASE_APPLICATION - && !mWinAnimator.isForceScaled() && !isGoneForLayoutLw() - && !getTask().inPinnedWindowingMode()) { + if (!computeDragResizing() && mAttrs.type == TYPE_BASE_APPLICATION && + !mWinAnimator.isForceScaled() && !isGoneForLayoutLw() && + !getTask().inPinnedWorkspace()) { setResizedWhileNotDragResizing(true); } } @@ -2191,6 +2196,12 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP } } + // TODO: Strange usage of word workspace here and above. + boolean inPinnedWorkspace() { + final Task task = getTask(); + return task != null && task.inPinnedWorkspace(); + } + void applyAdjustForImeIfNeeded() { final Task task = getTask(); if (task != null && task.mStack != null && task.mStack.isAdjustedForIme()) { @@ -2224,7 +2235,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP } else { getVisibleBounds(mTmpRect); } - if (inFreeformWindowingMode()) { + if (inFreeformWorkspace()) { // For freeform windows we the touch region to include the whole surface for the // shadows. final DisplayMetrics displayMetrics = getDisplayContent().getDisplayMetrics(); @@ -2360,8 +2371,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // just in case they have the divider at an unstable position. Better // also reset drag resizing state, because the owner can't do it // anymore. - final TaskStack stack = - dc.getSplitScreenPrimaryStackStackIgnoringVisibility(); + final TaskStack stack = dc.getDockedStackIgnoringVisibility(); if (stack != null) { stack.resetDockedStackToMiddle(); } @@ -2928,7 +2938,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP return mTmpRect; } - private int getStackId() { + @Override + public int getStackId() { final TaskStack stack = getStack(); if (stack == null) { return INVALID_STACK_ID; @@ -2972,6 +2983,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP } } + boolean inFreeformWorkspace() { + final Task task = getTask(); + return task != null && task.inFreeformWorkspace(); + } + @Override public boolean isInMultiWindowMode() { final Task task = getTask(); @@ -3089,7 +3105,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // background. return (getDisplayContent().mDividerControllerLocked.isResizing() || mAppToken != null && !mAppToken.mFrozenBounds.isEmpty()) && - !task.inFreeformWindowingMode() && !isGoneForLayoutLw(); + !task.inFreeformWorkspace() && !isGoneForLayoutLw(); } @@ -3679,7 +3695,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // Force the show in the next prepareSurfaceLocked() call. mWinAnimator.mLastAlpha = -1; - if (DEBUG_ANIM) Slog.v(TAG, + if (DEBUG_SURFACE_TRACE || DEBUG_ANIM) Slog.v(TAG, "performShowLocked: mDrawState=HAS_DRAWN in " + this); mWinAnimator.mDrawState = HAS_DRAWN; mService.scheduleAnimationLocked(); @@ -3740,7 +3756,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP windowInfo.accessibilityIdOfAnchor = mAttrs.accessibilityIdOfAnchor; windowInfo.focused = isFocused(); Task task = getTask(); - windowInfo.inPictureInPicture = (task != null) && task.inPinnedWindowingMode(); + windowInfo.inPictureInPicture = (task != null) && task.inPinnedWorkspace(); if (mIsChildWindow) { windowInfo.parentToken = getParentWindow().mClient.asBinder(); @@ -4203,7 +4219,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // If a freeform window is animating from a position where it would be cutoff, it would be // cutoff during the animation. We don't want that, so for the duration of the animation // we ignore the decor cropping and depend on layering to position windows correctly. - final boolean cropToDecor = !(inFreeformWindowingMode() && isAnimatingLw()); + final boolean cropToDecor = !(inFreeformWorkspace() && isAnimatingLw()); if (cropToDecor) { // Intersect with the decor rect, offsetted by window position. systemDecorRect.intersect(decorRect.left - left, decorRect.top - top, @@ -4287,7 +4303,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // scale for the animation using the source hint rect // (see WindowStateAnimator#setSurfaceBoundariesLocked()). if (isDragResizeChanged() || isResizedWhileNotDragResizing() - || (surfaceInsetsChanging() && !inPinnedWindowingMode())) { + || (surfaceInsetsChanging() && !inPinnedWorkspace())) { mLastSurfaceInsets.set(mAttrs.surfaceInsets); setDragResizing(); |