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

Commit ccdab44d authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge changes Ie6c1ea33,Id1af37e6,I9c474f7a,I439c9b66

* changes:
  Reset create state in moveTaskToStack
  Divider tuning
  Fix transition to recents in docked mode
  Fix flicker and other weirdness
parents 89270a44 9349e65a
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -560,11 +560,13 @@ public class ActivityManager {
        }

        /**
         * Returns true if the windows of tasks being moved to this stack should be preserved so
         * there isn't a display gap.
         * Returns true if the windows of tasks being moved to the target stack from the source
         * stack should be replaced, meaning that window manager will keep the old window around
         * until the new is ready.
         */
        public static boolean preserveWindowOnTaskMove(int stackId) {
            return stackId == FULLSCREEN_WORKSPACE_STACK_ID || stackId == DOCKED_STACK_ID;
        public static boolean replaceWindowsOnTaskMove(int sourceStackId, int targetStackId) {
            return sourceStackId == FREEFORM_WORKSPACE_STACK_ID
                    || targetStackId == FREEFORM_WORKSPACE_STACK_ID;
        }

        /**
+5 −0
Original line number Diff line number Diff line
@@ -381,4 +381,9 @@ interface IWindowManager
     * @param receiver The receiver to deliver the results to.
     */
    void requestAppKeyboardShortcuts(IResultReceiver receiver);

    /**
     * Retrieves the current stable insets from the primary display.
     */
    void getStableInsets(out Rect outInsets);
}
+22 −2
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ public class DividerSnapAlgorithm {
    private final Rect mInsets = new Rect();
    private final int mSnapMode;
    private final float mFixedRatio;
    private boolean mIsHorizontalDivision;

    /** The first target which is still splitting the screen */
    private final SnapTarget mFirstSplitTarget;
@@ -78,6 +79,7 @@ public class DividerSnapAlgorithm {
        mDividerSize = dividerSize;
        mDisplayWidth = displayWidth;
        mDisplayHeight = displayHeight;
        mIsHorizontalDivision = isHorizontalDivision;
        mInsets.set(insets);
        mSnapMode = res.getInteger(
                com.android.internal.R.integer.config_dockedStackDividerSnapMode);
@@ -130,10 +132,12 @@ public class DividerSnapAlgorithm {

    public float calculateDismissingFraction(int position) {
        if (position < mFirstSplitTarget.position) {
            return 1f - (float) position / mFirstSplitTarget.position;
            return 1f - (float) (position - getStartInset())
                    / (mFirstSplitTarget.position - getStartInset());
        } else if (position > mLastSplitTarget.position) {
            return (float) (position - mLastSplitTarget.position)
                    / (mDismissEndTarget.position - mLastSplitTarget.position);
                    / (mDismissEndTarget.position - getEndInset()
                            - mLastSplitTarget.position - mDividerSize);
        }
        return 0f;
    }
@@ -167,6 +171,22 @@ public class DividerSnapAlgorithm {
        return mDismissEndTarget;
    }

    private int getStartInset() {
        if (mIsHorizontalDivision) {
            return mInsets.top;
        } else {
            return mInsets.left;
        }
    }

    private int getEndInset() {
        if (mIsHorizontalDivision) {
            return mInsets.bottom;
        } else {
            return mInsets.right;
        }
    }

    private SnapTarget snap(int position, boolean hardDismiss) {
        int minIndex = -1;
        float minDistance = Float.MAX_VALUE;
+13 −0
Original line number Diff line number Diff line
@@ -321,6 +321,19 @@ public final class Rect implements Parcelable {
        bottom -= dy;
    }

    /**
     * Insets the rectangle on all sides specified by the dimensions of the {@code insets}
     * rectangle.
     * @hide
     * @param insets The rectangle specifying the insets on all side.
     */
    public void inset(Rect insets) {
        left += insets.left;
        top += insets.top;
        right -= insets.right;
        bottom -= insets.bottom;
    }

    /**
     * Returns true if (x,y) is inside the rectangle. The left and top are
     * considered to be inside, while the right and bottom are not. This means
+3 −6
Original line number Diff line number Diff line
@@ -103,12 +103,9 @@ public class RecentsConfiguration {
    /**
     * Updates the configuration based on the current state of the system
     */
    void update(Rect windowRect) {
        // Recompute some values based on the given state, since we can not rely on the resource
        // system to get certain values.
        boolean isLandscape = windowRect.width() > windowRect.height();
        hasTransposedNavBar = isLandscape && !isXLargeScreen;
        hasTransposedSearchBar = isLandscape && !isXLargeScreen;
    void update(Rect systemInsets) {
        hasTransposedNavBar = systemInsets.right > 0;
        hasTransposedSearchBar = systemInsets.right > 0;
    }

    /**
Loading