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

Commit 9faa4467 authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Use sysprop flags on host

Now that sysprop is available for host, we no longer need to guard the
code with #ifdef.

Bug: 261586828
Test: m
Change-Id: I5b97415d2c52b465074e345a843e6d9e1f08171d
parent a84abc85
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ cc_defaults {
        "libcutils",
        "libjsoncpp",
        "liblog",
        "libPlatformProperties",
        "libstatslog",
        "libutils",
    ],
@@ -89,7 +90,6 @@ cc_defaults {
    target: {
        android: {
            shared_libs: [
                "libPlatformProperties",
                "libinput",
            ],
        },
+0 −6
Original line number Diff line number Diff line
@@ -20,9 +20,7 @@

#include <algorithm>

#if defined(__ANDROID__)
#include <android/sysprop/InputProperties.sysprop.h>
#endif
#include <ftl/flags.h>

#include "CursorInputMapper.h"
@@ -213,11 +211,7 @@ void InputDevice::addEventHubDevice(int32_t eventHubId, bool populateMappers) {

    // Touchscreens and touchpad devices.
    static const bool ENABLE_TOUCHPAD_GESTURES_LIBRARY =
#if defined(__ANDROID__)
            sysprop::InputProperties::enable_touchpad_gestures_library().value_or(false);
#else
            false;
#endif
    if (ENABLE_TOUCHPAD_GESTURES_LIBRARY && classes.test(InputDeviceClass::TOUCHPAD) &&
        classes.test(InputDeviceClass::TOUCH_MT)) {
        mappers.push_back(std::make_unique<TouchpadInputMapper>(*contextPtr));
+1 −8
Original line number Diff line number Diff line
@@ -16,10 +16,8 @@

#include "../Macros.h"

#include "MultiTouchInputMapper.h"
#if defined(__ANDROID__)
#include <android/sysprop/InputProperties.sysprop.h>
#endif
#include "MultiTouchInputMapper.h"

namespace android {

@@ -218,12 +216,7 @@ bool MultiTouchInputMapper::hasStylus() const {

bool MultiTouchInputMapper::shouldSimulateStylusWithTouch() const {
    static const bool SIMULATE_STYLUS_WITH_TOUCH =
#if defined(__ANDROID__)
            sysprop::InputProperties::simulate_stylus_with_touch().value_or(false);
#else
            // Disable this developer feature where sysproperties are not available
            false;
#endif
    return SIMULATE_STYLUS_WITH_TOUCH &&
            mParameters.deviceType == Parameters::DeviceType::TOUCH_SCREEN;
}