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

Commit 70c55635 authored by Harry Cutts's avatar Harry Cutts
Browse files

Fix logic error in SensorInputMapper::createSensor

Since tryGetProperty returns false when it hasn't loaded a property
successfully, the previous code was equivalent to a no-op.

Bug: 272048386
Test: atest inputmapper_tests
Change-Id: I6c95a34dfa24cc86dd9a79096097db04d2400f57
parent 849d7822
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -218,7 +218,7 @@ SensorInputMapper::Sensor SensorInputMapper::createSensor(InputDeviceSensorType
    transform(prefix.begin(), prefix.end(), prefix.begin(), ::tolower);

    int32_t reportingMode = 0;
    if (!tryGetProperty(prefix + ".reportingMode", reportingMode)) {
    if (tryGetProperty(prefix + ".reportingMode", reportingMode)) {
        sensorInfo.flags |= (reportingMode & REPORTING_MODE_MASK) << REPORTING_MODE_SHIFT;
    }