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

Commit d6623618 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed logspam and handling subwindows with the input consumer

Bug: 21402648
Change-Id: I4c1c73487dfd19ba452ff2077d8541547f149c3b
parent 801ca67c
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -275,6 +275,13 @@ public interface WindowManagerPolicy {
         */
        public int getSurfaceLayer();

        /**
         * Retrieve the type of the top-level window.
         *
         * @return the base type of the parent window if attached or its own type otherwise
         */
        public int getBaseType();

        /**
         * Return the token for the application (actually activity) that owns
         * this window.  May return null for system windows.
+2 −2
Original line number Diff line number Diff line
@@ -6386,8 +6386,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        immersiveSticky = (vis & View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) != 0;
        final boolean navAllowedHidden = immersive || immersiveSticky;

        if (!navAllowedHidden
                && windowTypeToLayerLw(type) > windowTypeToLayerLw(TYPE_INPUT_CONSUMER)) {
        if (hideNavBarSysui && !navAllowedHidden && windowTypeToLayerLw(win.getBaseType())
                > windowTypeToLayerLw(TYPE_INPUT_CONSUMER)) {
            // We can't hide the navbar from this window otherwise the input consumer would not get
            // the input events.
            vis = (vis & ~View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
+9 −0
Original line number Diff line number Diff line
@@ -780,6 +780,15 @@ final class WindowState implements WindowManagerPolicy.WindowState {
        return mLayer;
    }

    @Override
    public int getBaseType() {
        WindowState win = this;
        while (win.mAttachedWindow != null) {
            win = win.mAttachedWindow;
        }
        return win.mAttrs.type;
    }

    @Override
    public IApplicationToken getAppToken() {
        return mAppToken != null ? mAppToken.appToken : null;