Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e67960ec authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Force pinned windows to always be scaleable." into nyc-dev

parents cc69bed6 1b5ea72b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -694,6 +694,14 @@ public class ActivityManager {
        public static boolean activitiesCanRequestVisibleBehind(int stackId) {
            return stackId == FULLSCREEN_WORKSPACE_STACK_ID;
        }

        /**
         * Returns true if this stack may be scaled without resizing,
         * and windows within may need to be configured as such.
         */
        public static boolean windowsAreScaleable(int stackId) {
            return stackId == PINNED_STACK_ID;
        }
    }

    /**
+18 −16
Original line number Diff line number Diff line
@@ -554,6 +554,15 @@ public class TaskStack implements DimLayer.DimLayerUser,
        if (toTop) {
            mDisplayContent.moveStack(this, true);
        }

        if (StackId.windowsAreScaleable(mStackId)) {
            // We force windows out of SCALING_MODE_FREEZE
            // so that we can continue to animate them
            // while a resize is pending.
            forceWindowsScaleable(task, true);
        } else {
            forceWindowsScaleable(task, false);
        }
        EventLog.writeEvent(EventLogTags.WM_TASK_MOVED, task.mTaskId, toTop ? 1 : 0, position);
    }

@@ -1279,11 +1288,10 @@ public class TaskStack implements DimLayer.DimLayerUser,
        return true;
    }

    void forceWindowsScaleable(boolean force) {
    void forceWindowsScaleable(Task task, boolean force) {
        SurfaceControl.openTransaction();
        try {
            for (int taskNdx = mTasks.size() - 1; taskNdx >= 0; --taskNdx) {
                final ArrayList<AppWindowToken> activities = mTasks.get(taskNdx).mAppTokens;
            final ArrayList<AppWindowToken> activities = task.mAppTokens;
            for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
                final ArrayList<WindowState> windows = activities.get(activityNdx).allAppWindows;
                for (int winNdx = windows.size() - 1; winNdx >= 0; --winNdx) {
@@ -1294,7 +1302,6 @@ public class TaskStack implements DimLayer.DimLayerUser,
                    winAnimator.mSurfaceController.forceScaleableInTransaction(force);
                }
            }
            }
        } finally {
            SurfaceControl.closeTransaction();
        }
@@ -1303,10 +1310,6 @@ public class TaskStack implements DimLayer.DimLayerUser,
    @Override  // AnimatesBounds
    public void onAnimationStart() {
        synchronized (mService.mWindowMap) {
            // We force windows out of SCALING_MODE_FREEZE
            // so that we can continue to animate them
            // while a resize is pending.
            forceWindowsScaleable(true);
            mFreezeMovementAnimations = true;
            mBoundsAnimating = true;
        }
@@ -1317,7 +1320,6 @@ public class TaskStack implements DimLayer.DimLayerUser,
        synchronized (mService.mWindowMap) {
            mFreezeMovementAnimations = false;
            mBoundsAnimating = false;
            forceWindowsScaleable(false);
            mService.requestTraversal();
        }
        if (mStackId == PINNED_STACK_ID) {
+6 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.server.wm;

import static android.app.ActivityManager.StackId;
import static android.app.ActivityManager.StackId.PINNED_STACK_ID;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
import static android.view.WindowManager.LayoutParams.FLAG_SCALED;
@@ -1695,6 +1696,11 @@ class WindowStateAnimator {
     * @return Returns true if the surface was successfully shown.
     */
    private boolean showSurfaceRobustlyLocked() {
        final Task task = mWin.getTask();
        if (task != null && StackId.windowsAreScaleable(task.mStack.mStackId)) {
            mSurfaceController.forceScaleableInTransaction(true);
        }

        boolean shown = mSurfaceController.showRobustlyInTransaction();
        if (!shown)
            return false;