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

Commit c37696a3 authored by Jorge Gil's avatar Jorge Gil Committed by Android (Google) Code Review
Browse files

Revert "Remove docked task drag resizing mode"

This reverts commit 42c25db0.

Reason for revert: b/262412047

Change-Id: Iab60722f5a3624deb611535deb0020b89be1d5fe
parent 42c25db0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -249,6 +249,11 @@ interface IActivityTaskManager {
    /** Returns an interface enabling the management of window organizers. */
    IWindowOrganizerController getWindowOrganizerController();

    /**
     * Sets whether we are currently in an interactive split screen resize operation where we
     * are changing the docked stack size.
     */
    void setSplitScreenResizing(boolean resizing);
    boolean supportsLocalVoiceInteraction();

    // Get device configuration
+1 −1
Original line number Diff line number Diff line
@@ -394,7 +394,7 @@ public abstract class WallpaperService extends Service {
            public void resized(ClientWindowFrames frames, boolean reportDraw,
                    MergedConfiguration mergedConfiguration, InsetsState insetsState,
                    boolean forceLayout, boolean alwaysConsumeSystemBars, int displayId,
                    int syncSeqId, boolean dragResizing) {
                    int syncSeqId, int resizeMode) {
                Message msg = mCaller.obtainMessageIO(MSG_WINDOW_RESIZED,
                        reportDraw ? 1 : 0,
                        mergedConfiguration);
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ oneway interface IWindow {
    void resized(in ClientWindowFrames frames, boolean reportDraw,
            in MergedConfiguration newMergedConfiguration, in InsetsState insetsState,
            boolean forceLayout, boolean alwaysConsumeSystemBars, int displayId,
            int syncSeqId, boolean dragResizing);
            int syncSeqId, int resizeMode);

    /**
     * Called when this window retrieved control over a specified set of insets sources.
+6 −0
Original line number Diff line number Diff line
@@ -457,6 +457,12 @@ interface IWindowManager
    @UnsupportedAppUsage
    int getDockedStackSide();

    /**
     * Sets the region the user can touch the divider. This region will be excluded from the region
     * which is used to cause a focus switch when dispatching touch.
     */
    void setDockedTaskDividerTouchRegion(in Rect touchableRegion);

    /**
     * Registers a listener that will be called when the pinned task state changes.
     */
+16 −11
Original line number Diff line number Diff line
@@ -51,6 +51,8 @@ import static android.view.ViewRootImplProto.WIDTH;
import static android.view.ViewRootImplProto.WINDOW_ATTRIBUTES;
import static android.view.ViewRootImplProto.WIN_FRAME;
import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION;
import static android.view.WindowCallbacks.RESIZE_MODE_FREEFORM;
import static android.view.WindowCallbacks.RESIZE_MODE_INVALID;
import static android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS;
import static android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS;
import static android.view.WindowInsetsController.APPEARANCE_LOW_PROFILE_BARS;
@@ -515,6 +517,7 @@ public final class ViewRootImpl implements ViewParent,
    private boolean mPendingDragResizing;
    private boolean mDragResizing;
    private boolean mInvalidateRootRequested;
    private int mResizeMode = RESIZE_MODE_INVALID;
    private int mCanvasOffsetX;
    private int mCanvasOffsetY;
    private boolean mActivityRelaunched;
@@ -1787,7 +1790,7 @@ public final class ViewRootImpl implements ViewParent,
        CompatibilityInfo.applyOverrideScaleIfNeeded(mergedConfiguration);
        final boolean forceNextWindowRelayout = args.argi1 != 0;
        final int displayId = args.argi3;
        final boolean dragResizing = args.argi5 != 0;
        final int resizeMode = args.argi5;

        final Rect frame = frames.frame;
        final Rect displayFrame = frames.displayFrame;
@@ -1803,14 +1806,16 @@ public final class ViewRootImpl implements ViewParent,
        final boolean attachedFrameChanged = LOCAL_LAYOUT
                && !Objects.equals(mTmpFrames.attachedFrame, attachedFrame);
        final boolean displayChanged = mDisplay.getDisplayId() != displayId;
        final boolean resizeModeChanged = mResizeMode != resizeMode;
        final boolean compatScaleChanged = mTmpFrames.compatScale != compatScale;
        if (msg == MSG_RESIZED && !frameChanged && !configChanged && !attachedFrameChanged
                && !displayChanged && !forceNextWindowRelayout
                && !displayChanged && !resizeModeChanged && !forceNextWindowRelayout
                && !compatScaleChanged) {
            return;
        }

        mPendingDragResizing = dragResizing;
        mPendingDragResizing = resizeMode != RESIZE_MODE_INVALID;
        mResizeMode = resizeMode;
        mTmpFrames.compatScale = compatScale;
        mInvCompatScale = 1f / compatScale;

@@ -2970,7 +2975,7 @@ public final class ViewRootImpl implements ViewParent,
                        frame.width() < desiredWindowWidth && frame.width() != mWidth)
                || (lp.height == ViewGroup.LayoutParams.WRAP_CONTENT &&
                        frame.height() < desiredWindowHeight && frame.height() != mHeight));
        windowShouldResize |= mDragResizing && mPendingDragResizing;
        windowShouldResize |= mDragResizing && mResizeMode == RESIZE_MODE_FREEFORM;

        // If the activity was just relaunched, it might have unfrozen the task bounds (while
        // relaunching), so we need to force a call into window manager to pick up the latest
@@ -3217,7 +3222,7 @@ public final class ViewRootImpl implements ViewParent,
                                        && mWinFrame.height() == mPendingBackDropFrame.height();
                        // TODO: Need cutout?
                        startDragResizing(mPendingBackDropFrame, !backdropSizeMatchesFrame,
                                mAttachInfo.mContentInsets, mAttachInfo.mStableInsets);
                                mAttachInfo.mContentInsets, mAttachInfo.mStableInsets, mResizeMode);
                    } else {
                        // We shouldn't come here, but if we come we should end the resize.
                        endDragResizing();
@@ -8775,7 +8780,7 @@ public final class ViewRootImpl implements ViewParent,
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    private void dispatchResized(ClientWindowFrames frames, boolean reportDraw,
            MergedConfiguration mergedConfiguration, InsetsState insetsState, boolean forceLayout,
            boolean alwaysConsumeSystemBars, int displayId, int syncSeqId, boolean dragResizing) {
            boolean alwaysConsumeSystemBars, int displayId, int syncSeqId, int resizeMode) {
        Message msg = mHandler.obtainMessage(reportDraw ? MSG_RESIZED_REPORT : MSG_RESIZED);
        SomeArgs args = SomeArgs.obtain();
        final boolean sameProcessCall = (Binder.getCallingPid() == android.os.Process.myPid());
@@ -8797,7 +8802,7 @@ public final class ViewRootImpl implements ViewParent,
        args.argi2 = alwaysConsumeSystemBars ? 1 : 0;
        args.argi3 = displayId;
        args.argi4 = syncSeqId;
        args.argi5 = dragResizing ? 1 : 0;
        args.argi5 = resizeMode;

        msg.obj = args;
        mHandler.sendMessage(msg);
@@ -10189,11 +10194,11 @@ public final class ViewRootImpl implements ViewParent,
        public void resized(ClientWindowFrames frames, boolean reportDraw,
                MergedConfiguration mergedConfiguration, InsetsState insetsState,
                boolean forceLayout, boolean alwaysConsumeSystemBars, int displayId, int syncSeqId,
                boolean dragResizing) {
                int resizeMode) {
            final ViewRootImpl viewAncestor = mViewAncestor.get();
            if (viewAncestor != null) {
                viewAncestor.dispatchResized(frames, reportDraw, mergedConfiguration, insetsState,
                        forceLayout, alwaysConsumeSystemBars, displayId, syncSeqId, dragResizing);
                        forceLayout, alwaysConsumeSystemBars, displayId, syncSeqId, resizeMode);
            }
        }

@@ -10398,13 +10403,13 @@ public final class ViewRootImpl implements ViewParent,
     * Start a drag resizing which will inform all listeners that a window resize is taking place.
     */
    private void startDragResizing(Rect initialBounds, boolean fullscreen, Rect systemInsets,
            Rect stableInsets) {
            Rect stableInsets, int resizeMode) {
        if (!mDragResizing) {
            mDragResizing = true;
            if (mUseMTRenderer) {
                for (int i = mWindowCallbacks.size() - 1; i >= 0; i--) {
                    mWindowCallbacks.get(i).onWindowDragResizeStart(
                            initialBounds, fullscreen, systemInsets, stableInsets);
                            initialBounds, fullscreen, systemInsets, stableInsets, resizeMode);
                }
            }
            mFullRedrawNeeded = true;
Loading