Plumbing for SurfaceControl#setInputWindowInfo.
The standard SurfaceControl plumbing, plus moving InputWindowInfo from
the services jar to the framework jar so that it is accessible from
SurfaceControl.
Bug: 80101428
Bug: 113136004
Bug: 111440400
Test: None
Change-Id: I3443a98cd04ac6b36977e1874641a34c6befca34
diff --git a/core/jni/android_view_SurfaceControl.cpp b/core/jni/android_view_SurfaceControl.cpp
index 4eda3ab..ec9c860 100644
--- a/core/jni/android_view_SurfaceControl.cpp
+++ b/core/jni/android_view_SurfaceControl.cpp
@@ -19,6 +19,7 @@
#include "android_os_Parcel.h"
#include "android_util_Binder.h"
+#include "android_hardware_input_InputWindowHandle.h"
#include "android/graphics/Bitmap.h"
#include "android/graphics/GraphicsJNI.h"
#include "android/graphics/Region.h"
@@ -324,6 +325,18 @@
transaction->setAlpha(ctrl, alpha);
}
+static void nativeSetInputWindowInfo(JNIEnv* env, jclass clazz, jlong transactionObj,
+ jlong nativeObject, jobject inputWindow) {
+ auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj);
+
+ sp<NativeInputWindowHandle> handle = android_server_InputWindowHandle_getHandle(
+ env, inputWindow);
+ handle->updateInfo();
+
+ SurfaceControl* const ctrl = reinterpret_cast<SurfaceControl *>(nativeObject);
+ transaction->setInputWindowInfo(ctrl, *handle->getInfo());
+}
+
static void nativeSetColor(JNIEnv* env, jclass clazz, jlong transactionObj,
jlong nativeObject, jfloatArray fColor) {
auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj);
@@ -930,6 +943,8 @@
(void*)nativeScreenshot },
{"nativeCaptureLayers", "(Landroid/os/IBinder;Landroid/graphics/Rect;F)Landroid/graphics/GraphicBuffer;",
(void*)nativeCaptureLayers },
+ {"nativeSetInputWindowInfo", "(JJLandroid/view/InputWindowHandle;)V",
+ (void*)nativeSetInputWindowInfo },
};
int register_android_view_SurfaceControl(JNIEnv* env)