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

Commit decfc0d4 authored by Biswarup Pal's avatar Biswarup Pal Committed by Android (Google) Code Review
Browse files

Merge "Revert "Remove docked task drag resizing mode""

parents 0451de39 c37696a3
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -249,6 +249,11 @@ interface IActivityTaskManager {
    /** Returns an interface enabling the management of window organizers. */
    /** Returns an interface enabling the management of window organizers. */
    IWindowOrganizerController getWindowOrganizerController();
    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();
    boolean supportsLocalVoiceInteraction();


    // Get device configuration
    // Get device configuration
+1 −1
Original line number Original line Diff line number Diff line
@@ -394,7 +394,7 @@ public abstract class WallpaperService extends Service {
            public void resized(ClientWindowFrames frames, boolean reportDraw,
            public void resized(ClientWindowFrames frames, boolean reportDraw,
                    MergedConfiguration mergedConfiguration, InsetsState insetsState,
                    MergedConfiguration mergedConfiguration, InsetsState insetsState,
                    boolean forceLayout, boolean alwaysConsumeSystemBars, int displayId,
                    boolean forceLayout, boolean alwaysConsumeSystemBars, int displayId,
                    int syncSeqId, boolean dragResizing) {
                    int syncSeqId, int resizeMode) {
                Message msg = mCaller.obtainMessageIO(MSG_WINDOW_RESIZED,
                Message msg = mCaller.obtainMessageIO(MSG_WINDOW_RESIZED,
                        reportDraw ? 1 : 0,
                        reportDraw ? 1 : 0,
                        mergedConfiguration);
                        mergedConfiguration);
+1 −1
Original line number Original line Diff line number Diff line
@@ -57,7 +57,7 @@ oneway interface IWindow {
    void resized(in ClientWindowFrames frames, boolean reportDraw,
    void resized(in ClientWindowFrames frames, boolean reportDraw,
            in MergedConfiguration newMergedConfiguration, in InsetsState insetsState,
            in MergedConfiguration newMergedConfiguration, in InsetsState insetsState,
            boolean forceLayout, boolean alwaysConsumeSystemBars, int displayId,
            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.
     * Called when this window retrieved control over a specified set of insets sources.
+6 −0
Original line number Original line Diff line number Diff line
@@ -456,6 +456,12 @@ interface IWindowManager
    @UnsupportedAppUsage
    @UnsupportedAppUsage
    int getDockedStackSide();
    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.
     * Registers a listener that will be called when the pinned task state changes.
     */
     */
+16 −11
Original line number Original line 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.WINDOW_ATTRIBUTES;
import static android.view.ViewRootImplProto.WIN_FRAME;
import static android.view.ViewRootImplProto.WIN_FRAME;
import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION;
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_NAVIGATION_BARS;
import static android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS;
import static android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS;
import static android.view.WindowInsetsController.APPEARANCE_LOW_PROFILE_BARS;
import static android.view.WindowInsetsController.APPEARANCE_LOW_PROFILE_BARS;
@@ -513,6 +515,7 @@ public final class ViewRootImpl implements ViewParent,
    private boolean mPendingDragResizing;
    private boolean mPendingDragResizing;
    private boolean mDragResizing;
    private boolean mDragResizing;
    private boolean mInvalidateRootRequested;
    private boolean mInvalidateRootRequested;
    private int mResizeMode = RESIZE_MODE_INVALID;
    private int mCanvasOffsetX;
    private int mCanvasOffsetX;
    private int mCanvasOffsetY;
    private int mCanvasOffsetY;
    private boolean mActivityRelaunched;
    private boolean mActivityRelaunched;
@@ -1790,7 +1793,7 @@ public final class ViewRootImpl implements ViewParent,
        CompatibilityInfo.applyOverrideScaleIfNeeded(mergedConfiguration);
        CompatibilityInfo.applyOverrideScaleIfNeeded(mergedConfiguration);
        final boolean forceNextWindowRelayout = args.argi1 != 0;
        final boolean forceNextWindowRelayout = args.argi1 != 0;
        final int displayId = args.argi3;
        final int displayId = args.argi3;
        final boolean dragResizing = args.argi5 != 0;
        final int resizeMode = args.argi5;


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


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


@@ -3010,7 +3015,7 @@ public final class ViewRootImpl implements ViewParent,
                        frame.width() < desiredWindowWidth && frame.width() != mWidth)
                        frame.width() < desiredWindowWidth && frame.width() != mWidth)
                || (lp.height == ViewGroup.LayoutParams.WRAP_CONTENT &&
                || (lp.height == ViewGroup.LayoutParams.WRAP_CONTENT &&
                        frame.height() < desiredWindowHeight && frame.height() != mHeight));
                        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
        // 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
        // relaunching), so we need to force a call into window manager to pick up the latest
@@ -3257,7 +3262,7 @@ public final class ViewRootImpl implements ViewParent,
                                        && mWinFrame.height() == mPendingBackDropFrame.height();
                                        && mWinFrame.height() == mPendingBackDropFrame.height();
                        // TODO: Need cutout?
                        // TODO: Need cutout?
                        startDragResizing(mPendingBackDropFrame, !backdropSizeMatchesFrame,
                        startDragResizing(mPendingBackDropFrame, !backdropSizeMatchesFrame,
                                mAttachInfo.mContentInsets, mAttachInfo.mStableInsets);
                                mAttachInfo.mContentInsets, mAttachInfo.mStableInsets, mResizeMode);
                    } else {
                    } else {
                        // We shouldn't come here, but if we come we should end the resize.
                        // We shouldn't come here, but if we come we should end the resize.
                        endDragResizing();
                        endDragResizing();
@@ -8825,7 +8830,7 @@ public final class ViewRootImpl implements ViewParent,
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    private void dispatchResized(ClientWindowFrames frames, boolean reportDraw,
    private void dispatchResized(ClientWindowFrames frames, boolean reportDraw,
            MergedConfiguration mergedConfiguration, InsetsState insetsState, boolean forceLayout,
            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);
        Message msg = mHandler.obtainMessage(reportDraw ? MSG_RESIZED_REPORT : MSG_RESIZED);
        SomeArgs args = SomeArgs.obtain();
        SomeArgs args = SomeArgs.obtain();
        final boolean sameProcessCall = (Binder.getCallingPid() == android.os.Process.myPid());
        final boolean sameProcessCall = (Binder.getCallingPid() == android.os.Process.myPid());
@@ -8847,7 +8852,7 @@ public final class ViewRootImpl implements ViewParent,
        args.argi2 = alwaysConsumeSystemBars ? 1 : 0;
        args.argi2 = alwaysConsumeSystemBars ? 1 : 0;
        args.argi3 = displayId;
        args.argi3 = displayId;
        args.argi4 = syncSeqId;
        args.argi4 = syncSeqId;
        args.argi5 = dragResizing ? 1 : 0;
        args.argi5 = resizeMode;


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


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