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

Commit 0c3e320a authored by Chris Li's avatar Chris Li Committed by Automerger Merge Worker
Browse files

Merge "Include whether in touch mode for WindowlessWindowManager" into sc-dev am: de6aadf2

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13507782

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I86b9b76df2aa5ec85a4632f140e0638807458bc1
parents 0a6e3b8b de6aadf2
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -162,7 +162,10 @@ public class WindowlessWindowManager implements IWindowSession {
            mStateForWindow.put(window.asBinder(), state);
        }

        return WindowManagerGlobal.ADD_OKAY | WindowManagerGlobal.ADD_FLAG_APP_VISIBLE;
        final int res = WindowManagerGlobal.ADD_OKAY | WindowManagerGlobal.ADD_FLAG_APP_VISIBLE;

        // Include whether the window is in touch mode.
        return isInTouchMode() ? res | WindowManagerGlobal.ADD_FLAG_IN_TOUCH_MODE : res;
    }

    /**
@@ -210,6 +213,15 @@ public class WindowlessWindowManager implements IWindowSession {
        return !PixelFormat.formatHasAlpha(attrs.format);
    }

    private boolean isInTouchMode() {
        try {
            return WindowManagerGlobal.getWindowSession().getInTouchMode();
        } catch (RemoteException e) {
            Log.e(TAG, "Unable to check if the window is in touch mode", e);
        }
        return false;
    }

    /** @hide */
    @Nullable
    protected SurfaceControl getSurfaceControl(View rootView) {
@@ -276,7 +288,8 @@ public class WindowlessWindowManager implements IWindowSession {
            }
        }

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

    @Override