Add support for new input sources.
Added several new coordinate values to MotionEvents to capture
touch major/minor area, tool major/minor area and orientation.
Renamed NDK input constants per convention.
Added InputDevice class in Java which will eventually provide
useful information about available input devices.
Added APIs for manufacturing new MotionEvent objects with multiple
pointers and all necessary coordinate data.
Fixed a bug in the input dispatcher where it could get stuck with
a pointer down forever.
Fixed a bug in the WindowManager where the input window list could
end up containing stale removed windows.
Fixed a bug in the WindowManager where the input channel was being
removed only after the final animation transition had taken place
which caused spurious WINDOW DIED log messages to be printed.
Change-Id: Ie55084da319b20aad29b28a0499b8dd98bb5da68
diff --git a/native/android/input.cpp b/native/android/input.cpp
index a4dde51..4e1b6dcb 100644
--- a/native/android/input.cpp
+++ b/native/android/input.cpp
@@ -38,8 +38,8 @@
return static_cast<const InputEvent*>(event)->getDeviceId();
}
-int32_t AInputEvent_getNature(const AInputEvent* event) {
- return static_cast<const InputEvent*>(event)->getNature();
+int32_t AInputEvent_getSource(const AInputEvent* event) {
+ return static_cast<const InputEvent*>(event)->getSource();
}
int32_t AKeyEvent_getAction(const AInputEvent* key_event) {
@@ -69,6 +69,7 @@
return static_cast<const KeyEvent*>(key_event)->getDownTime();
}
+
int64_t AKeyEvent_getEventTime(const AInputEvent* key_event) {
return static_cast<const KeyEvent*>(key_event)->getEventTime();
}
@@ -141,6 +142,26 @@
return static_cast<const MotionEvent*>(motion_event)->getSize(pointer_index);
}
+float AMotionEvent_getTouchMajor(const AInputEvent* motion_event, size_t pointer_index) {
+ return static_cast<const MotionEvent*>(motion_event)->getTouchMajor(pointer_index);
+}
+
+float AMotionEvent_getTouchMinor(const AInputEvent* motion_event, size_t pointer_index) {
+ return static_cast<const MotionEvent*>(motion_event)->getTouchMinor(pointer_index);
+}
+
+float AMotionEvent_getToolMajor(const AInputEvent* motion_event, size_t pointer_index) {
+ return static_cast<const MotionEvent*>(motion_event)->getToolMajor(pointer_index);
+}
+
+float AMotionEvent_getToolMinor(const AInputEvent* motion_event, size_t pointer_index) {
+ return static_cast<const MotionEvent*>(motion_event)->getToolMinor(pointer_index);
+}
+
+float AMotionEvent_getOrientation(const AInputEvent* motion_event, size_t pointer_index) {
+ return static_cast<const MotionEvent*>(motion_event)->getOrientation(pointer_index);
+}
+
size_t AMotionEvent_getHistorySize(const AInputEvent* motion_event) {
return static_cast<const MotionEvent*>(motion_event)->getHistorySize();
}
@@ -187,6 +208,37 @@
pointer_index, history_index);
}
+float AMotionEvent_getHistoricalTouchMajor(AInputEvent* motion_event, size_t pointer_index,
+ size_t history_index) {
+ return static_cast<const MotionEvent*>(motion_event)->getHistoricalTouchMajor(
+ pointer_index, history_index);
+}
+
+float AMotionEvent_getHistoricalTouchMinor(AInputEvent* motion_event, size_t pointer_index,
+ size_t history_index) {
+ return static_cast<const MotionEvent*>(motion_event)->getHistoricalTouchMinor(
+ pointer_index, history_index);
+}
+
+float AMotionEvent_getHistoricalToolMajor(AInputEvent* motion_event, size_t pointer_index,
+ size_t history_index) {
+ return static_cast<const MotionEvent*>(motion_event)->getHistoricalToolMajor(
+ pointer_index, history_index);
+}
+
+float AMotionEvent_getHistoricalToolMinor(AInputEvent* motion_event, size_t pointer_index,
+ size_t history_index) {
+ return static_cast<const MotionEvent*>(motion_event)->getHistoricalToolMinor(
+ pointer_index, history_index);
+}
+
+float AMotionEvent_getHistoricalOrientation(AInputEvent* motion_event, size_t pointer_index,
+ size_t history_index) {
+ return static_cast<const MotionEvent*>(motion_event)->getHistoricalOrientation(
+ pointer_index, history_index);
+}
+
+
void AInputQueue_attachLooper(AInputQueue* queue, ALooper* looper,
ALooper_callbackFunc* callback, void* data) {
queue->attachLooper(looper, callback, data);