Merge "Include whether in touch mode for WindowlessWindowManager" into rvc-qpr-dev am: 09b7b55659

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I022ad77f205b88bf7c76b403b93b9f516cf85a20
This commit is contained in:
TreeHugger Robot
2021-03-10 23:15:15 +00:00
committed by Automerger Merge Worker

View File

@@ -156,7 +156,10 @@ public class WindowlessWindowManager implements IWindowSession {
mStateForWindow.put(window.asBinder(), state); 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;
} }
/** /**
@@ -207,6 +210,15 @@ public class WindowlessWindowManager implements IWindowSession {
return !PixelFormat.formatHasAlpha(attrs.format); 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 */ /** @hide */
protected SurfaceControl getSurfaceControl(View rootView) { protected SurfaceControl getSurfaceControl(View rootView) {
final ViewRootImpl root = rootView.getViewRootImpl(); final ViewRootImpl root = rootView.getViewRootImpl();
@@ -268,7 +280,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 @Override