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

Commit 9d5c72bb authored by Harry Cutts's avatar Harry Cutts
Browse files

TouchInputMapper: remove gestureMode parameter

This was being set from an evdev property and potentially from IDC
files. It seems that at some point [0] it affected the way pointers were
drawn for touchpads in the old stack, but it's no longer used.

[0]: the farthest back I was able to easily trace this field in the code
     history was to change I5f571fe86eb570885ae994e1f0552fb558930346

Test: $ atest --host inputflinger_tests
Flag: EXEMPT refactor
Bug: 245989146
Change-Id: I1538c0c6f23f33a27e346f6cbc0e1181d5beb005
parent c64dbd29
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -354,25 +354,7 @@ void TouchInputMapper::resolveExternalStylusPresence() {
TouchInputMapper::Parameters TouchInputMapper::computeParameters(
        const InputDeviceContext& deviceContext) {
    Parameters parameters;
    // Use the pointer presentation mode for devices that do not support distinct
    // multitouch.  The spot-based presentation relies on being able to accurately
    // locate two or more fingers on the touch pad.
    parameters.gestureMode = deviceContext.hasInputProperty(INPUT_PROP_SEMI_MT)
            ? Parameters::GestureMode::SINGLE_TOUCH
            : Parameters::GestureMode::MULTI_TOUCH;

    const PropertyMap& config = deviceContext.getConfiguration();
    std::optional<std::string> gestureModeString = config.getString("touch.gestureMode");
    if (gestureModeString.has_value()) {
        if (*gestureModeString == "single-touch") {
            parameters.gestureMode = Parameters::GestureMode::SINGLE_TOUCH;
        } else if (*gestureModeString == "multi-touch") {
            parameters.gestureMode = Parameters::GestureMode::MULTI_TOUCH;
        } else if (*gestureModeString != "default") {
            ALOGW("Invalid value for touch.gestureMode: '%s'", gestureModeString->c_str());
        }
    }

    parameters.deviceType = computeDeviceType(deviceContext);

    parameters.orientationAware =
@@ -467,8 +449,6 @@ TouchInputMapper::Parameters::DeviceType TouchInputMapper::computeDeviceType(
void TouchInputMapper::dumpParameters(std::string& dump) {
    dump += INDENT3 "Parameters:\n";

    dump += INDENT4 "GestureMode: " + ftl::enum_string(mParameters.gestureMode) + "\n";

    dump += INDENT4 "DeviceType: " + ftl::enum_string(mParameters.deviceType) + "\n";

    dump += StringPrintf(INDENT4 "AssociatedDisplay: hasAssociatedDisplay=%s, isExternal=%s, "
+0 −8
Original line number Diff line number Diff line
@@ -239,14 +239,6 @@ protected:

        std::string uniqueDisplayId;

        enum class GestureMode {
            SINGLE_TOUCH,
            MULTI_TOUCH,

            ftl_last = MULTI_TOUCH
        };
        GestureMode gestureMode;

        bool wake;

        // The Universal Stylus Initiative (USI) protocol version supported by this device.