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

Commit 3072d027 authored by Tiger Huang's avatar Tiger Huang
Browse files

Remove RELAYOUT_RES_IN_TOUCH_MODE

When WindowManagerService.mInTouchMode is changed, we will set the new
mode to InputManagerService, and clients will be notified via
ViewRootImpl.WindowInputEventReceiver#onTouchModeChanged. We don't need
the flag to bring the information to the client.

This is also a step to make relayout an oneway binder call.

Bug: 161810301
Test: Invoke View#requestFocusFromTouch on one window and see if another
      window can receive OnTouchModeChangeListener#onTouchModeChanged.
Change-Id: Ic149c95bee89b2be83a85eb4858131224b63a7c8
parent 54102c21
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -3137,11 +3137,8 @@ public final class ViewRootImpl implements ViewParent,
            // possible that checking the most recent value is actually more
            // correct here.
            if (!mStopped || wasReportNextDraw) {
                boolean focusChangedDueToTouchMode = ensureTouchModeLocally(
                        (relayoutResult&WindowManagerGlobal.RELAYOUT_RES_IN_TOUCH_MODE) != 0);
                if (focusChangedDueToTouchMode || mWidth != host.getMeasuredWidth()
                        || mHeight != host.getMeasuredHeight() || dispatchApplyInsets ||
                        updatedConfiguration) {
                if (mWidth != host.getMeasuredWidth() || mHeight != host.getMeasuredHeight()
                        || dispatchApplyInsets || updatedConfiguration) {
                    int childWidthMeasureSpec = getRootMeasureSpec(mWidth, lp.width,
                            lp.privateFlags);
                    int childHeightMeasureSpec = getRootMeasureSpec(mHeight, lp.height,
+7 −13
Original line number Diff line number Diff line
@@ -59,48 +59,42 @@ public final class WindowManagerGlobal {

    private static boolean sUseBLASTAdapter = false;

    /**
     * The user is navigating with keys (not the touch screen), so
     * navigational focus should be shown.
     */
    public static final int RELAYOUT_RES_IN_TOUCH_MODE = 0x1;

    /**
     * This is the first time the window is being drawn,
     * so the client must call drawingFinished() when done
     */
    public static final int RELAYOUT_RES_FIRST_TIME = 0x2;
    public static final int RELAYOUT_RES_FIRST_TIME = 1;

    /**
     * The window manager has changed the surface from the last call.
     */
    public static final int RELAYOUT_RES_SURFACE_CHANGED = 0x4;
    public static final int RELAYOUT_RES_SURFACE_CHANGED = 1 << 1;

    /**
     * The window is being resized by dragging on the docked divider. The client should render
     * at (0, 0) and extend its background to the background frame passed into
     * {@link IWindow#resized}.
     */
    public static final int RELAYOUT_RES_DRAG_RESIZING_DOCKED = 0x8;
    public static final int RELAYOUT_RES_DRAG_RESIZING_DOCKED = 1 << 2;

    /**
     * The window is being resized by dragging one of the window corners,
     * in this case the surface would be fullscreen-sized. The client should
     * render to the actual frame location (instead of (0,curScrollY)).
     */
    public static final int RELAYOUT_RES_DRAG_RESIZING_FREEFORM = 0x10;
    public static final int RELAYOUT_RES_DRAG_RESIZING_FREEFORM = 1 << 3;

    /**
     * The window manager has changed the size of the surface from the last call.
     */
    public static final int RELAYOUT_RES_SURFACE_RESIZED = 0x20;
    public static final int RELAYOUT_RES_SURFACE_RESIZED = 1 << 4;

    /**
     * In multi-window we force show the system bars. Because we don't want that the surface size
     * changes in this mode, we instead have a flag whether the system bar sizes should always be
     * consumed, so the app is treated like there is no virtual system bars at all.
     */
    public static final int RELAYOUT_RES_CONSUME_ALWAYS_SYSTEM_BARS = 0x40;
    public static final int RELAYOUT_RES_CONSUME_ALWAYS_SYSTEM_BARS = 1 << 5;

    /**
     * This flag indicates the client should not directly submit it's next frame,
@@ -108,7 +102,7 @@ public final class WindowManagerGlobal {
     * {@link WindowManagerService#finishDrawing}. This is used by the WM
     * BLASTSyncEngine to synchronize rendering of multiple windows.
     */
    public static final int RELAYOUT_RES_BLAST_SYNC = 0x80;
    public static final int RELAYOUT_RES_BLAST_SYNC = 1 << 6;

    /**
     * Flag for relayout: the client will be later giving
+1 −2
Original line number Diff line number Diff line
@@ -327,8 +327,7 @@ public class WindowlessWindowManager implements IWindowSession {
            outInsetsState.set(mInsetsState);
        }

        // Include whether the window is in touch mode.
        return isInTouchMode() ? WindowManagerGlobal.RELAYOUT_RES_IN_TOUCH_MODE : 0;
        return 0;
    }

    @Override
+0 −2
Original line number Diff line number Diff line
@@ -2483,8 +2483,6 @@ public class WindowManagerService extends IWindowManager.Stub
            ProtoLog.v(WM_DEBUG_FOCUS, "Relayout of %s: focusMayChange=%b",
                    win, focusMayChange);

            result |= mInTouchMode ? WindowManagerGlobal.RELAYOUT_RES_IN_TOUCH_MODE : 0;

            if (DEBUG_LAYOUT) {
                Slog.v(TAG_WM, "Relayout complete " + win + ": outFrames=" + outFrames);
            }