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

Commit b255215a authored by Harry Cutts's avatar Harry Cutts
Browse files

Fix max touch count calculation in TouchpadInputMapper

It seems I got confused between InputDeviceContext.hasKeyCode and
hasScanCode.

Bug: 251196347
Test: check that max_touch_cnt in the HardwareProperties is set
      correctly (e.g. with the tests from ag/20691427)
Change-Id: Ief9144deb90360e1f12f35316b174a40de8c3db4
parent ff9c00dd
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -28,11 +28,11 @@ namespace android {
namespace {

short getMaxTouchCount(const InputDeviceContext& context) {
    if (context.hasKeyCode(BTN_TOOL_QUINTTAP)) return 5;
    if (context.hasKeyCode(BTN_TOOL_QUADTAP)) return 4;
    if (context.hasKeyCode(BTN_TOOL_TRIPLETAP)) return 3;
    if (context.hasKeyCode(BTN_TOOL_DOUBLETAP)) return 2;
    if (context.hasKeyCode(BTN_TOOL_FINGER)) return 1;
    if (context.hasScanCode(BTN_TOOL_QUINTTAP)) return 5;
    if (context.hasScanCode(BTN_TOOL_QUADTAP)) return 4;
    if (context.hasScanCode(BTN_TOOL_TRIPLETAP)) return 3;
    if (context.hasScanCode(BTN_TOOL_DOUBLETAP)) return 2;
    if (context.hasScanCode(BTN_TOOL_FINGER)) return 1;
    return 0;
}