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

Commit ecf67228 authored by Filip Gruszczynski's avatar Filip Gruszczynski
Browse files

Exclude status and nav bar from focus monitor.

Bug: 26037712
Change-Id: Ie1cd442339f6d7e95ac949eb59b5da9a7a13559b
parent ee15241a
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -110,6 +110,8 @@ class DisplayContent {

    final DimLayerController mDimLayerController;

    final ArrayList<WindowState> mTapExcludedWindows = new ArrayList<>();

    /**
     * @param display May not be null.
     * @param service You know.
@@ -412,6 +414,11 @@ class DisplayContent {
            inputMethod.getTouchableRegion(mTmpRegion);
            mTouchExcludeRegion.op(mTmpRegion, Region.Op.UNION);
        }
        for (int i = mTapExcludedWindows.size() - 1; i >= 0; i--) {
            WindowState win = mTapExcludedWindows.get(i);
            win.getTouchableRegion(mTmpRegion);
            mTouchExcludeRegion.op(mTmpRegion, Region.Op.UNION);
        }
        if (mTapDetector != null) {
            mTapDetector.setTouchExcludeRegion(mTouchExcludeRegion, mNonResizeableRegion);
        }
+11 −1
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER;
import static android.view.WindowManager.LayoutParams.TYPE_DREAM;
import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD;
import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG;
import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR;
import static android.view.WindowManager.LayoutParams.TYPE_PRIVATE_PRESENTATION;
import static android.view.WindowManager.LayoutParams.TYPE_QS_DIALOG;
import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR;
@@ -1966,6 +1967,10 @@ public class WindowManagerService extends IWindowManager.Stub

            res = WindowManagerGlobal.ADD_OKAY;

            if (type == TYPE_STATUS_BAR || type == TYPE_NAVIGATION_BAR) {
                displayContent.mTapExcludedWindows.add(win);
            }

            origId = Binder.clearCallingIdentity();

            if (addToken) {
@@ -2309,6 +2314,11 @@ public class WindowManagerService extends IWindowManager.Stub
            Slog.w(TAG_WM, "Removing window " + win, e);
        }

        final int type = win.mAttrs.type;
        if (type == TYPE_STATUS_BAR || type == TYPE_NAVIGATION_BAR) {
            final DisplayContent displaycontent = win.getDisplayContent();
            displaycontent.mTapExcludedWindows.remove(win);
        }
        mPolicy.removeWindowLw(win);
        win.removeLocked();

@@ -2364,7 +2374,7 @@ public class WindowManagerService extends IWindowManager.Stub
            }
        }

        if (win.mAttrs.type == TYPE_WALLPAPER) {
        if (type == TYPE_WALLPAPER) {
            mWallpaperControllerLocked.clearLastWallpaperTimeoutTime();
            getDefaultDisplayContentLocked().pendingLayoutChanges |=
                    WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;