Skip to content

Commit 16d3bf0

Browse files
Treehugger RobotAndroid (Google) Code Review
authored andcommitted
Merge "input: Remove prefix from InputDeviceSensorAccuracy enum" into main
2 parents e255db9 + ff63fe1 commit 16d3bf0

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

include/input/InputDevice.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ enum class InputDeviceSensorType : int32_t {
111111
};
112112

113113
enum class InputDeviceSensorAccuracy : int32_t {
114-
ACCURACY_NONE = 0,
115-
ACCURACY_LOW = 1,
116-
ACCURACY_MEDIUM = 2,
117-
ACCURACY_HIGH = 3,
114+
NONE = 0,
115+
LOW = 1,
116+
MEDIUM = 2,
117+
HIGH = 3,
118118

119-
ftl_last = ACCURACY_HIGH,
119+
ftl_last = HIGH,
120120
};
121121

122122
enum class InputDeviceSensorReportingMode : int32_t {

services/inputflinger/reader/mapper/SensorInputMapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ SensorInputMapper::Sensor SensorInputMapper::createSensor(InputDeviceSensorType
212212
// One input device can only have 1 sensor for each sensor Type.
213213
InputDeviceSensorInfo sensorInfo(identifier.name, std::to_string(identifier.vendor),
214214
identifier.version, sensorType,
215-
InputDeviceSensorAccuracy::ACCURACY_HIGH,
215+
InputDeviceSensorAccuracy::HIGH,
216216
/*maxRange=*/axis.max, /*resolution=*/axis.scale,
217217
/*power=*/config.getFloat(prefix + ".power").value_or(0.0f),
218218
/*minDelay=*/config.getInt(prefix + ".minDelay").value_or(0),

services/inputflinger/reader/mapper/SensorInputMapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class SensorInputMapper : public InputMapper {
101101
std::array<int32_t, SENSOR_VEC_LEN> dataVec;
102102
void resetValue() {
103103
this->enabled = false;
104-
this->accuracy = InputDeviceSensorAccuracy::ACCURACY_NONE;
104+
this->accuracy = InputDeviceSensorAccuracy::NONE;
105105
this->samplingPeriod = std::chrono::nanoseconds(0);
106106
this->maxBatchReportLatency = std::chrono::nanoseconds(0);
107107
this->lastSampleTimeNs = std::nullopt;

services/inputflinger/tests/SensorInputMapper_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ TEST_F(SensorInputMapperTest, ProcessAccelerometerSensor) {
125125
ASSERT_EQ(arg.source, AINPUT_SOURCE_SENSOR);
126126
ASSERT_EQ(arg.deviceId, DEVICE_ID);
127127
ASSERT_EQ(arg.sensorType, InputDeviceSensorType::ACCELEROMETER);
128-
ASSERT_EQ(arg.accuracy, InputDeviceSensorAccuracy::ACCURACY_HIGH);
128+
ASSERT_EQ(arg.accuracy, InputDeviceSensorAccuracy::HIGH);
129129
ASSERT_EQ(arg.hwTimestamp, ARBITRARY_TIME);
130130
ASSERT_EQ(arg.values, values);
131131
mMapper->flushSensor(InputDeviceSensorType::ACCELEROMETER);
@@ -170,7 +170,7 @@ TEST_F(SensorInputMapperTest, ProcessGyroscopeSensor) {
170170
ASSERT_EQ(arg.source, AINPUT_SOURCE_SENSOR);
171171
ASSERT_EQ(arg.deviceId, DEVICE_ID);
172172
ASSERT_EQ(arg.sensorType, InputDeviceSensorType::GYROSCOPE);
173-
ASSERT_EQ(arg.accuracy, InputDeviceSensorAccuracy::ACCURACY_HIGH);
173+
ASSERT_EQ(arg.accuracy, InputDeviceSensorAccuracy::HIGH);
174174
ASSERT_EQ(arg.hwTimestamp, ARBITRARY_TIME);
175175
ASSERT_EQ(arg.values, values);
176176
mMapper->flushSensor(InputDeviceSensorType::GYROSCOPE);

0 commit comments

Comments
 (0)