Added libui dependencies for input
Allow Input to support Transform class from libui and
add Transform objects to MotionEvent and InputWindowInfo
Test: Builds
Bug: 158476194
Change-Id: Ic6f2507dbead97c2124dde8c8946add377d724c6
diff --git a/include/input/Input.h b/include/input/Input.h
index ac901ae..194db1c 100644
--- a/include/input/Input.h
+++ b/include/input/Input.h
@@ -26,6 +26,7 @@
#include <android/input.h>
#include <math.h>
#include <stdint.h>
+#include <ui/Transform.h>
#include <utils/BitSet.h>
#include <utils/KeyedVector.h>
#include <utils/RefBase.h>
@@ -741,6 +742,7 @@
float mYScale;
float mXOffset;
float mYOffset;
+ ui::Transform mTransform;
float mXPrecision;
float mYPrecision;
float mRawXCursorPosition;
diff --git a/include/input/InputWindow.h b/include/input/InputWindow.h
index f8c759c..6a42ff6 100644
--- a/include/input/InputWindow.h
+++ b/include/input/InputWindow.h
@@ -21,6 +21,7 @@
#include <input/InputTransport.h>
#include <ui/Rect.h>
#include <ui/Region.h>
+#include <ui/Transform.h>
#include <utils/RefBase.h>
#include <utils/Timers.h>
@@ -160,6 +161,9 @@
float windowXScale = 1.0f;
float windowYScale = 1.0f;
+ // Transform applied to individual windows.
+ ui::Transform transform;
+
/*
* This is filled in by the WM relative to the frame and then translated
* to absolute coordinates by SurfaceFlinger once the frame is computed.
diff --git a/include/ui/Rotation.h b/include/ui/Rotation.h
new file mode 120000
index 0000000..095d2ce
--- /dev/null
+++ b/include/ui/Rotation.h
@@ -0,0 +1 @@
+../../libs/ui/include/ui/Rotation.h
\ No newline at end of file
diff --git a/include/ui/Transform.h b/include/ui/Transform.h
new file mode 120000
index 0000000..323f1fd
--- /dev/null
+++ b/include/ui/Transform.h
@@ -0,0 +1 @@
+../../libs/ui/include/ui/Transform.h
\ No newline at end of file
diff --git a/libs/input/Android.bp b/libs/input/Android.bp
index 7037680..0aa325f 100644
--- a/libs/input/Android.bp
+++ b/libs/input/Android.bp
@@ -43,6 +43,14 @@
"libcutils",
],
+ static_libs: [
+ "libui-types",
+ ],
+
+ export_static_lib_headers: [
+ "libui-types",
+ ],
+
target: {
android: {
srcs: [
diff --git a/libs/ui/Android.bp b/libs/ui/Android.bp
index f3edd3c..2acc5bb 100644
--- a/libs/ui/Android.bp
+++ b/libs/ui/Android.bp
@@ -51,22 +51,30 @@
min_sdk_version: "apex_inherit",
shared_libs: [
+ "libbase",
"libutils",
],
static_libs: [
+ "libarect",
"libmath",
],
srcs: [
"ColorSpace.cpp",
+ "Rect.cpp",
+ "Region.cpp",
+ "Transform.cpp",
],
export_include_dirs: [
+ "include",
+ "include_private",
"include_types",
],
export_static_lib_headers: [
+ "libarect",
"libmath",
],
@@ -111,10 +119,7 @@
"HdrCapabilities.cpp",
"PixelFormat.cpp",
"PublicFormat.cpp",
- "Rect.cpp",
- "Region.cpp",
"Size.cpp",
- "Transform.cpp",
"UiConfig.cpp",
],
diff --git a/libs/ui/include/ui/Transform.h b/libs/ui/include/ui/Transform.h
index c6bb598..3e8caf4 100644
--- a/libs/ui/include/ui/Transform.h
+++ b/libs/ui/include/ui/Transform.h
@@ -21,7 +21,6 @@
#include <ostream>
#include <string>
-#include <hardware/hardware.h>
#include <math/mat4.h>
#include <math/vec2.h>
#include <math/vec3.h>
@@ -44,9 +43,9 @@
enum RotationFlags : uint32_t {
ROT_0 = 0,
- FLIP_H = HAL_TRANSFORM_FLIP_H,
- FLIP_V = HAL_TRANSFORM_FLIP_V,
- ROT_90 = HAL_TRANSFORM_ROT_90,
+ FLIP_H = 1, // HAL_TRANSFORM_FLIP_H
+ FLIP_V = 2, // HAL_TRANSFORM_FLIP_V
+ ROT_90 = 4, // HAL_TRANSFORM_ROT_90
ROT_180 = FLIP_H | FLIP_V,
ROT_270 = ROT_180 | ROT_90,
ROT_INVALID = 0x80
diff --git a/services/inputflinger/Android.bp b/services/inputflinger/Android.bp
index f685628..5930f0a 100644
--- a/services/inputflinger/Android.bp
+++ b/services/inputflinger/Android.bp
@@ -111,6 +111,7 @@
"libcutils",
"libinput",
"liblog",
+ "libui",
"libutils",
],
header_libs: [
diff --git a/services/inputflinger/host/Android.bp b/services/inputflinger/host/Android.bp
index b56f356..2a84dcb 100644
--- a/services/inputflinger/host/Android.bp
+++ b/services/inputflinger/host/Android.bp
@@ -63,5 +63,6 @@
],
static_libs: [
"libarect",
+ "libui-types",
],
}