From 8a86719c7f10df782b47b15efa515506c1140b5a Mon Sep 17 00:00:00 2001 From: Prabir Pradhan Date: Fri, 27 Aug 2021 16:56:39 -0700 Subject: [PATCH] Report gui::DisplayInfo to clients with window info changes InputFlinger needs to know specifications about displays such as orientation and projection from SurfaceFlinger to support the MotionEvent#getRaw API, which returns coordinates in logical display space at the moment. The DisplayInfo is added only to support input dispatching, and it should not be used by other clients. Bug: 179274888 Test: presubmit Test: manual, ensure input works Change-Id: Ieb50e53ff09cd2d920f5119a672c0895dc0b8789 --- core/jni/android_window_WindowInfosListener.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/jni/android_window_WindowInfosListener.cpp b/core/jni/android_window_WindowInfosListener.cpp index ab88b537f96bc..b20addb4611de 100644 --- a/core/jni/android_window_WindowInfosListener.cpp +++ b/core/jni/android_window_WindowInfosListener.cpp @@ -27,6 +27,7 @@ namespace android { +using gui::DisplayInfo; using gui::WindowInfo; namespace { @@ -42,7 +43,8 @@ struct WindowInfosListener : public gui::WindowInfosListener { WindowInfosListener(JNIEnv* env, jobject listener) : mListener(env->NewWeakGlobalRef(listener)) {} - void onWindowInfosChanged(const std::vector& windowInfos) override { + void onWindowInfosChanged(const std::vector& windowInfos, + const std::vector& /*displayInfos*/) override { JNIEnv* env = AndroidRuntime::getJNIEnv(); LOG_ALWAYS_FATAL_IF(env == nullptr, "Unable to retrieve JNIEnv in onWindowInfoChanged.");