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

Commit 16d3bf05 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "input: Remove prefix from InputDeviceSensorAccuracy enum" into main

parents e255db9b ff63fe16
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -111,12 +111,12 @@ enum class InputDeviceSensorType : int32_t {
};

enum class InputDeviceSensorAccuracy : int32_t {
    ACCURACY_NONE = 0,
    ACCURACY_LOW = 1,
    ACCURACY_MEDIUM = 2,
    ACCURACY_HIGH = 3,
    NONE = 0,
    LOW = 1,
    MEDIUM = 2,
    HIGH = 3,

    ftl_last = ACCURACY_HIGH,
    ftl_last = HIGH,
};

enum class InputDeviceSensorReportingMode : int32_t {
+1 −1
Original line number Diff line number Diff line
@@ -212,7 +212,7 @@ SensorInputMapper::Sensor SensorInputMapper::createSensor(InputDeviceSensorType
    // One input device can only have 1 sensor for each sensor Type.
    InputDeviceSensorInfo sensorInfo(identifier.name, std::to_string(identifier.vendor),
                                     identifier.version, sensorType,
                                     InputDeviceSensorAccuracy::ACCURACY_HIGH,
                                     InputDeviceSensorAccuracy::HIGH,
                                     /*maxRange=*/axis.max, /*resolution=*/axis.scale,
                                     /*power=*/config.getFloat(prefix + ".power").value_or(0.0f),
                                     /*minDelay=*/config.getInt(prefix + ".minDelay").value_or(0),
+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ private:
        std::array<int32_t, SENSOR_VEC_LEN> dataVec;
        void resetValue() {
            this->enabled = false;
            this->accuracy = InputDeviceSensorAccuracy::ACCURACY_NONE;
            this->accuracy = InputDeviceSensorAccuracy::NONE;
            this->samplingPeriod = std::chrono::nanoseconds(0);
            this->maxBatchReportLatency = std::chrono::nanoseconds(0);
            this->lastSampleTimeNs = std::nullopt;
+2 −2
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ TEST_F(SensorInputMapperTest, ProcessAccelerometerSensor) {
    ASSERT_EQ(arg.source, AINPUT_SOURCE_SENSOR);
    ASSERT_EQ(arg.deviceId, DEVICE_ID);
    ASSERT_EQ(arg.sensorType, InputDeviceSensorType::ACCELEROMETER);
    ASSERT_EQ(arg.accuracy, InputDeviceSensorAccuracy::ACCURACY_HIGH);
    ASSERT_EQ(arg.accuracy, InputDeviceSensorAccuracy::HIGH);
    ASSERT_EQ(arg.hwTimestamp, ARBITRARY_TIME);
    ASSERT_EQ(arg.values, values);
    mMapper->flushSensor(InputDeviceSensorType::ACCELEROMETER);
@@ -170,7 +170,7 @@ TEST_F(SensorInputMapperTest, ProcessGyroscopeSensor) {
    ASSERT_EQ(arg.source, AINPUT_SOURCE_SENSOR);
    ASSERT_EQ(arg.deviceId, DEVICE_ID);
    ASSERT_EQ(arg.sensorType, InputDeviceSensorType::GYROSCOPE);
    ASSERT_EQ(arg.accuracy, InputDeviceSensorAccuracy::ACCURACY_HIGH);
    ASSERT_EQ(arg.accuracy, InputDeviceSensorAccuracy::HIGH);
    ASSERT_EQ(arg.hwTimestamp, ARBITRARY_TIME);
    ASSERT_EQ(arg.values, values);
    mMapper->flushSensor(InputDeviceSensorType::GYROSCOPE);