Loading services/core/java/com/android/server/wm/DisplayContent.java +2 −2 Original line number Diff line number Diff line Loading @@ -234,7 +234,7 @@ class DisplayContent { for (int taskNdx = tasks.size() - 1; taskNdx >= 0; --taskNdx) { final Task task = tasks.get(taskNdx); task.getBounds(mTmpRect); if (mTmpRect.contains(x, y)) { if (task.inFreeformWorkspace() && mTmpRect.contains(x, y)) { return task.mTaskId; } } Loading Loading @@ -299,7 +299,7 @@ class DisplayContent { * (For freeform focused task, the below logic will first remove the enlarged * area, then add back the inner area.) */ final boolean isFreeformed = win.inFreeformWorkspace(); final boolean isFreeformed = task.inFreeformWorkspace(); if (task != focusedTask || isFreeformed) { mTmpRect.set(win.mVisibleFrame); mTmpRect.intersect(win.mVisibleInsets); Loading services/core/java/com/android/server/wm/Task.java +4 −0 Original line number Diff line number Diff line Loading @@ -426,6 +426,10 @@ class Task implements DimLayer.DimLayerUser { return (tokensCount != 0) && mAppTokens.get(tokensCount - 1).showForAllUsers; } boolean inFreeformWorkspace() { return mStack != null && mStack.mStackId == FREEFORM_WORKSPACE_STACK_ID; } @Override public boolean isFullscreen() { return mFullscreen; Loading services/core/java/com/android/server/wm/TaskPositioner.java +13 −2 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ class TaskPositioner implements DimLayer.DimLayerUser { private int mTaskId; private TaskStack mStack; private boolean mResizing; private final Rect mWindowOriginalBounds = new Rect(); private final Rect mWindowDragBounds = new Rect(); private float mStartDragX; Loading Loading @@ -131,8 +132,8 @@ class TaskPositioner implements DimLayer.DimLayerUser { notifyMoveLocked(newX, newY); } try { mService.mActivityManager.resizeTask(mTaskId, mWindowDragBounds, true /* resizedByUser */); mService.mActivityManager.resizeTask( mTaskId, mWindowDragBounds, true /* resizedByUser */); } catch(RemoteException e) {} } break; Loading @@ -152,6 +153,11 @@ class TaskPositioner implements DimLayer.DimLayerUser { } if (endDrag) { mResizing = false; try { mService.mActivityManager.resizeTask( mTaskId, mWindowDragBounds, true /* resizedByUser */); } catch(RemoteException e) {} // Post back to WM to handle clean-ups. We still need the input // event handler for the last finishInputEvent()! mService.mH.sendEmptyMessage(H.FINISH_TASK_POSITIONING); Loading Loading @@ -280,6 +286,10 @@ class TaskPositioner implements DimLayer.DimLayerUser { mService.resumeRotationLocked(); } boolean isTaskResizing(final Task task) { return mResizing && task != null && mTaskId == task.mTaskId; } void startDragLocked(WindowState win, boolean resize, float startX, float startY) { if (DEBUG_TASK_POSITIONING) { Slog.d(TAG, "startDragLocked: win=" + win + ", resize=" + resize Loading @@ -300,6 +310,7 @@ class TaskPositioner implements DimLayer.DimLayerUser { if (startY > visibleFrame.bottom) { mCtrlType |= CTRL_BOTTOM; } mResizing = true; } final Task task = win.getTask(); Loading services/core/java/com/android/server/wm/WindowState.java +14 −5 Original line number Diff line number Diff line Loading @@ -557,7 +557,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { final Task task = mAppToken != null ? getTask() : null; final boolean nonFullscreenTask = task != null && !task.isFullscreen(); final boolean freeformWorkspace = inFreeformWorkspace(); final boolean freeformWorkspace = task != null && task.inFreeformWorkspace(); if (nonFullscreenTask) { task.getBounds(mContainingFrame); final WindowState imeWin = mService.mInputMethodWindow; Loading Loading @@ -897,6 +897,11 @@ final class WindowState implements WindowManagerPolicy.WindowState { return stack == null ? mDisplayContent : stack.getDisplayContent(); } public DisplayInfo getDisplayInfo() { final DisplayContent displayContent = getDisplayContent(); return displayContent != null ? displayContent.getDisplayInfo() : null; } public int getDisplayId() { final DisplayContent displayContent = getDisplayContent(); if (displayContent == null) { Loading Loading @@ -935,7 +940,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { if (task != null) { task.getBounds(bounds); if (forTouch == BOUNDS_FOR_TOUCH) { if (inFreeformWorkspace()) { if (task.inFreeformWorkspace()) { final int delta = calculatePixelFromDp(RESIZE_HANDLE_WIDTH_IN_DP); bounds.inset(-delta, -delta); } Loading Loading @@ -1668,9 +1673,13 @@ final class WindowState implements WindowManagerPolicy.WindowState { } boolean inFreeformWorkspace() { final Task task = getTask(); return task != null && task.mStack != null && task.mStack.mStackId == FREEFORM_WORKSPACE_STACK_ID; final Task task = mAppToken != null ? getTask() : null; return task != null && task.inFreeformWorkspace(); } boolean isDragResizing() { final Task task = mAppToken != null ? getTask() : null; return mService.mTaskPositioner != null && mService.mTaskPositioner.isTaskResizing(task); } private int calculatePixelFromDp(int dp) { Loading services/core/java/com/android/server/wm/WindowStateAnimator.java +31 −7 Original line number Diff line number Diff line Loading @@ -803,10 +803,19 @@ class WindowStateAnimator { // size. width = w.mRequestedWidth; height = w.mRequestedHeight; } else { // When we're doing a drag-resizing, request a surface that's fullscreen size, // so that we don't need to reallocate during the process. This also prevents // buffer drops due to size mismatch. final DisplayInfo displayInfo = w.getDisplayInfo(); if (displayInfo != null && w.isDragResizing()) { width = displayInfo.logicalWidth; height = displayInfo.logicalHeight; } else { width = w.mCompatFrame.width(); height = w.mCompatFrame.height(); } } // Something is wrong and SurfaceFlinger will not like this, // try to revert to sane values Loading Loading @@ -1315,9 +1324,15 @@ class WindowStateAnimator { final boolean fullscreen = w.isFullscreen(displayInfo.appWidth, displayInfo.appHeight); final Rect clipRect = mTmpClipRect; if (w.isDragResizing()) { // When we're doing a drag-resizing, the surface is set up to cover full screen. // Set the clip rect to be the same size so that we don't get any scaling. clipRect.set(0, 0, displayInfo.logicalWidth, displayInfo.logicalHeight); } else { // We use the clip rect as provided by the tranformation for non-fullscreen windows to // avoid premature clipping with the system decor rect. clipRect.set((mHasClipRect && !fullscreen) ? mClipRect : w.mSystemDecorRect); } // Expand the clip rect for surface insets. final WindowManager.LayoutParams attrs = w.mAttrs; Loading Loading @@ -1390,10 +1405,19 @@ class WindowStateAnimator { // size. width = w.mRequestedWidth; height = w.mRequestedHeight; } else { // When we're doing a drag-resizing, request a surface that's fullscreen size, // so that we don't need to reallocate during the process. This also prevents // buffer drops due to size mismatch. final DisplayInfo displayInfo = w.getDisplayInfo(); if (displayInfo != null && w.isDragResizing()) { width = displayInfo.logicalWidth; height = displayInfo.logicalHeight; } else { width = w.mCompatFrame.width(); height = w.mCompatFrame.height(); } } // Something is wrong and SurfaceFlinger will not like this, // try to revert to sane values Loading Loading
services/core/java/com/android/server/wm/DisplayContent.java +2 −2 Original line number Diff line number Diff line Loading @@ -234,7 +234,7 @@ class DisplayContent { for (int taskNdx = tasks.size() - 1; taskNdx >= 0; --taskNdx) { final Task task = tasks.get(taskNdx); task.getBounds(mTmpRect); if (mTmpRect.contains(x, y)) { if (task.inFreeformWorkspace() && mTmpRect.contains(x, y)) { return task.mTaskId; } } Loading Loading @@ -299,7 +299,7 @@ class DisplayContent { * (For freeform focused task, the below logic will first remove the enlarged * area, then add back the inner area.) */ final boolean isFreeformed = win.inFreeformWorkspace(); final boolean isFreeformed = task.inFreeformWorkspace(); if (task != focusedTask || isFreeformed) { mTmpRect.set(win.mVisibleFrame); mTmpRect.intersect(win.mVisibleInsets); Loading
services/core/java/com/android/server/wm/Task.java +4 −0 Original line number Diff line number Diff line Loading @@ -426,6 +426,10 @@ class Task implements DimLayer.DimLayerUser { return (tokensCount != 0) && mAppTokens.get(tokensCount - 1).showForAllUsers; } boolean inFreeformWorkspace() { return mStack != null && mStack.mStackId == FREEFORM_WORKSPACE_STACK_ID; } @Override public boolean isFullscreen() { return mFullscreen; Loading
services/core/java/com/android/server/wm/TaskPositioner.java +13 −2 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ class TaskPositioner implements DimLayer.DimLayerUser { private int mTaskId; private TaskStack mStack; private boolean mResizing; private final Rect mWindowOriginalBounds = new Rect(); private final Rect mWindowDragBounds = new Rect(); private float mStartDragX; Loading Loading @@ -131,8 +132,8 @@ class TaskPositioner implements DimLayer.DimLayerUser { notifyMoveLocked(newX, newY); } try { mService.mActivityManager.resizeTask(mTaskId, mWindowDragBounds, true /* resizedByUser */); mService.mActivityManager.resizeTask( mTaskId, mWindowDragBounds, true /* resizedByUser */); } catch(RemoteException e) {} } break; Loading @@ -152,6 +153,11 @@ class TaskPositioner implements DimLayer.DimLayerUser { } if (endDrag) { mResizing = false; try { mService.mActivityManager.resizeTask( mTaskId, mWindowDragBounds, true /* resizedByUser */); } catch(RemoteException e) {} // Post back to WM to handle clean-ups. We still need the input // event handler for the last finishInputEvent()! mService.mH.sendEmptyMessage(H.FINISH_TASK_POSITIONING); Loading Loading @@ -280,6 +286,10 @@ class TaskPositioner implements DimLayer.DimLayerUser { mService.resumeRotationLocked(); } boolean isTaskResizing(final Task task) { return mResizing && task != null && mTaskId == task.mTaskId; } void startDragLocked(WindowState win, boolean resize, float startX, float startY) { if (DEBUG_TASK_POSITIONING) { Slog.d(TAG, "startDragLocked: win=" + win + ", resize=" + resize Loading @@ -300,6 +310,7 @@ class TaskPositioner implements DimLayer.DimLayerUser { if (startY > visibleFrame.bottom) { mCtrlType |= CTRL_BOTTOM; } mResizing = true; } final Task task = win.getTask(); Loading
services/core/java/com/android/server/wm/WindowState.java +14 −5 Original line number Diff line number Diff line Loading @@ -557,7 +557,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { final Task task = mAppToken != null ? getTask() : null; final boolean nonFullscreenTask = task != null && !task.isFullscreen(); final boolean freeformWorkspace = inFreeformWorkspace(); final boolean freeformWorkspace = task != null && task.inFreeformWorkspace(); if (nonFullscreenTask) { task.getBounds(mContainingFrame); final WindowState imeWin = mService.mInputMethodWindow; Loading Loading @@ -897,6 +897,11 @@ final class WindowState implements WindowManagerPolicy.WindowState { return stack == null ? mDisplayContent : stack.getDisplayContent(); } public DisplayInfo getDisplayInfo() { final DisplayContent displayContent = getDisplayContent(); return displayContent != null ? displayContent.getDisplayInfo() : null; } public int getDisplayId() { final DisplayContent displayContent = getDisplayContent(); if (displayContent == null) { Loading Loading @@ -935,7 +940,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { if (task != null) { task.getBounds(bounds); if (forTouch == BOUNDS_FOR_TOUCH) { if (inFreeformWorkspace()) { if (task.inFreeformWorkspace()) { final int delta = calculatePixelFromDp(RESIZE_HANDLE_WIDTH_IN_DP); bounds.inset(-delta, -delta); } Loading Loading @@ -1668,9 +1673,13 @@ final class WindowState implements WindowManagerPolicy.WindowState { } boolean inFreeformWorkspace() { final Task task = getTask(); return task != null && task.mStack != null && task.mStack.mStackId == FREEFORM_WORKSPACE_STACK_ID; final Task task = mAppToken != null ? getTask() : null; return task != null && task.inFreeformWorkspace(); } boolean isDragResizing() { final Task task = mAppToken != null ? getTask() : null; return mService.mTaskPositioner != null && mService.mTaskPositioner.isTaskResizing(task); } private int calculatePixelFromDp(int dp) { Loading
services/core/java/com/android/server/wm/WindowStateAnimator.java +31 −7 Original line number Diff line number Diff line Loading @@ -803,10 +803,19 @@ class WindowStateAnimator { // size. width = w.mRequestedWidth; height = w.mRequestedHeight; } else { // When we're doing a drag-resizing, request a surface that's fullscreen size, // so that we don't need to reallocate during the process. This also prevents // buffer drops due to size mismatch. final DisplayInfo displayInfo = w.getDisplayInfo(); if (displayInfo != null && w.isDragResizing()) { width = displayInfo.logicalWidth; height = displayInfo.logicalHeight; } else { width = w.mCompatFrame.width(); height = w.mCompatFrame.height(); } } // Something is wrong and SurfaceFlinger will not like this, // try to revert to sane values Loading Loading @@ -1315,9 +1324,15 @@ class WindowStateAnimator { final boolean fullscreen = w.isFullscreen(displayInfo.appWidth, displayInfo.appHeight); final Rect clipRect = mTmpClipRect; if (w.isDragResizing()) { // When we're doing a drag-resizing, the surface is set up to cover full screen. // Set the clip rect to be the same size so that we don't get any scaling. clipRect.set(0, 0, displayInfo.logicalWidth, displayInfo.logicalHeight); } else { // We use the clip rect as provided by the tranformation for non-fullscreen windows to // avoid premature clipping with the system decor rect. clipRect.set((mHasClipRect && !fullscreen) ? mClipRect : w.mSystemDecorRect); } // Expand the clip rect for surface insets. final WindowManager.LayoutParams attrs = w.mAttrs; Loading Loading @@ -1390,10 +1405,19 @@ class WindowStateAnimator { // size. width = w.mRequestedWidth; height = w.mRequestedHeight; } else { // When we're doing a drag-resizing, request a surface that's fullscreen size, // so that we don't need to reallocate during the process. This also prevents // buffer drops due to size mismatch. final DisplayInfo displayInfo = w.getDisplayInfo(); if (displayInfo != null && w.isDragResizing()) { width = displayInfo.logicalWidth; height = displayInfo.logicalHeight; } else { width = w.mCompatFrame.width(); height = w.mCompatFrame.height(); } } // Something is wrong and SurfaceFlinger will not like this, // try to revert to sane values Loading