MrARM Slack <
mrarm...@gmail.com> 於 2020年2月16日 週日 上午5:22寫道:
Fine. Now I know the correct input device which generates
the input events. (Device 24 in PC and Device 15 in phone)
However, they look all the same in both cases.
Ah! I also suspect that. Thank you for confirming it.
The patch was contributed by Jon Doe.
I don't understand it enough.
What I thought is the patch should only affect input devices
with absolute coordinate pointing with wheel.
Such devices are usually used in VMs.
(that's why I asked if you tested on VM the first time)
It should not affect normal mouses.
Dig into the patch, I found a suspicious point:
From line 2871-2895
if (!mParameters.hasAbsAxis) {
...
if (mPointerController != NULL) {
...
} else {
...
}
} else {
Theoretically it replaces the original code from
line 2836-2863:
if (mSource == AINPUT_SOURCE_MOUSE) {
...
} else {
...
}
However, the logic is not the same.
((mPointerController != NULL) vs (mSource == AINPUT_SOURCE_MOUSE))
That's strange.
Since at first the patch was contributed to Android 7.x (nougat-x86)
and then forward ported to Android 8 ~ 10.
I suspect if the forward porting has some issues.
So I checked the patch in nougat-x86:
https://osdn.net/projects/android-x86/scm/git/frameworks-native/commits/6084c3ffaba854080c32edfa77aa616a9fc309b4
Bingo! In line 2639-2666 it says:
if (mPointerController != NULL) {
...
} else {
...
}
That is, it has the same logic as Jon's patch.
So it seems AOSP made some changes but the patch
doesn't consider that. Using 'git blame' shows the patch
in AOSP changed the logic:
https://osdn.net/projects/android-x86/scm/git/frameworks-native/commits/78f97b3263053c388080a738b56499139517c3b6
(see line 2672 after applied that patch)
According to the info, please help me to confirm these:
* Test Android-x86 7.1-r3. I think it should work.
* Apply the following patch to Android-x86 9.0-rc2:
diff --git a/services/inputflinger/InputReader.cpp
b/services/inputflinger/InputReader.cpp
index 810bc56..eabe77f 100644
--- a/services/inputflinger/InputReader.cpp
+++ b/services/inputflinger/InputReader.cpp
@@ -2879,7 +2879,7 @@ void CursorInputMapper::sync(nsecs_t when) {
rotateDelta(mOrientation, &deltaX, &deltaY);
}
mPointerVelocityControl.move(when, &deltaX, &deltaY);
- if (mPointerController != NULL) {
+ if (mSource == AINPUT_SOURCE_MOUSE) {
if (moved) {
mPointerController->move(deltaX, deltaY);
}
(applied to frameworks/native)
It should work, I hope. Let me know the results.