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

Commit b600bc29 authored by Robert Carr's avatar Robert Carr
Browse files

Cleanup Input left-overs.

Clean-up some left over code from the old input list
generation and consumer management.

Bug: 80101428
Bug: 113136004
Bug: 111440400
Change-Id: Ibd9cd49eb8ab1dea180e602a9e881e312bea5a28
parent e92c80c0
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -136,6 +136,12 @@ class InputConsumerImpl implements IBinder.DeathRecipient {
        t.setRelativeLayer(mInputSurface, w.getSurfaceControl(), 1);
    }

    void show(SurfaceControl.Transaction t, int layer) {
        t.show(mInputSurface);
        t.setInputWindowInfo(mInputSurface, mWindowHandle);
        t.setLayer(mInputSurface, layer);
    }

    private int getLayerLw(int windowType) {
        return mService.mPolicy.getWindowLayerFromTypeLw(windowType)
                * WindowManagerService.TYPE_LAYER_MULTIPLIER
+7 −25
Original line number Diff line number Diff line
@@ -62,9 +62,8 @@ final class InputMonitor {
    // When true, need to call updateInputWindowsLw().
    private boolean mUpdateInputWindowsNeeded = true;

    // Array of window handles to provide to the input dispatcher.
    private InputWindowHandle[] mInputWindowHandles;
    private int mInputWindowHandleCount;
    // Currently focused input window handle.
    private InputWindowHandle mFocusedInputWindowHandle;

    private boolean mDisableWallpaperTouchEvents;
    private final Rect mTmpRect = new Rect();
@@ -190,18 +189,7 @@ final class InputMonitor {
    }


    private void addInputWindowHandle(final InputWindowHandle windowHandle) {
        if (mInputWindowHandles == null) {
            mInputWindowHandles = new InputWindowHandle[16];
        }
        if (mInputWindowHandleCount >= mInputWindowHandles.length) {
            mInputWindowHandles = Arrays.copyOf(mInputWindowHandles,
                    mInputWindowHandleCount * 2);
        }
        mInputWindowHandles[mInputWindowHandleCount++] = windowHandle;
    }

    void addInputWindowHandle(final InputWindowHandle inputWindowHandle,
    void populateInputWindowHandle(final InputWindowHandle inputWindowHandle,
            final WindowState child, int flags, final int type, final boolean isVisible,
            final boolean hasFocus, final boolean hasWallpaper) {
        // Add a window to our list of input windows.
@@ -240,12 +228,9 @@ final class InputMonitor {
            Slog.d(TAG_WM, "addInputWindowHandle: "
                    + child + ", " + inputWindowHandle);
        }
        addInputWindowHandle(inputWindowHandle);
    }

    private void clearInputWindowHandlesLw() {
        while (mInputWindowHandleCount != 0) {
            mInputWindowHandles[--mInputWindowHandleCount] = null;
        if (hasFocus) {
            mFocusedInputWindowHandle = inputWindowHandle;
        }
    }

@@ -404,14 +389,11 @@ final class InputMonitor {
                    true /* traverseTopToBottom */);

            if (mAddWallpaperInputConsumerHandle) {
                // No visible wallpaper found, add the wallpaper input consumer at the end.
                addInputWindowHandle(wallpaperInputConsumer.mWindowHandle);
                wallpaperInputConsumer.show(mInputTransaction, 0);
            }

            mInputTransaction.apply();

            clearInputWindowHandlesLw();

            Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER);
        }

@@ -485,7 +467,7 @@ final class InputMonitor {
                mService.mDragDropController.sendDragStartedIfNeededLocked(w);
            }

            addInputWindowHandle(
            populateInputWindowHandle(
                    inputWindowHandle, w, flags, type, isVisible, hasFocus, hasWallpaper);

            if (w.mWinAnimator.hasSurface()) {