Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f941f7a authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Merge "Add ABS_MT_SLOT config to virtual touch screen." into...

Merge "Merge "Add ABS_MT_SLOT config to virtual touch screen." into android13-tests-dev am: 36bccb6b" am: d850a82b

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2234609



Change-Id: Ic70915199b79bbad8a51be2b6787cfc9a1ddbe17
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 7ef2a666 d850a82b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <android/keycodes.h>
#include <errno.h>
#include <fcntl.h>
#include <input/Input.h>
#include <linux/uinput.h>
#include <math.h>
#include <nativehelper/JNIHelp.h>
@@ -271,6 +272,14 @@ static int openUinput(const char* readableName, jint vendorId, jint productId, c
                ALOGE("Error creating touchscreen uinput pressure axis: %s", strerror(errno));
                return -errno;
            }
            uinput_abs_setup slotAbsSetup;
            slotAbsSetup.code = ABS_MT_SLOT;
            slotAbsSetup.absinfo.maximum = MAX_POINTERS;
            slotAbsSetup.absinfo.minimum = 0;
            if (ioctl(fd, UI_ABS_SETUP, &slotAbsSetup) != 0) {
                ALOGE("Error creating touchscreen uinput slots: %s", strerror(errno));
                return -errno;
            }
        }
        if (ioctl(fd, UI_DEV_SETUP, &setup) != 0) {
            ALOGE("Error creating uinput device: %s", strerror(errno));