input: Remove prefix from InputDeviceSensorAccuracy enum
This is an enum class, so the value identifiers aren't in the global
namespace and therefore don't need to be Smurf-named.
Bug: 245989146
Change-Id: I7ec70dad5651eddcb55f61c3ebaeffc2e31f251d
Test: m checkinput
Flag: EXEMPT refactor
diff --git a/include/input/InputDevice.h b/include/input/InputDevice.h
index 6b45dd3..ea1e4ae 100644
--- a/include/input/InputDevice.h
+++ b/include/input/InputDevice.h
@@ -111,12 +111,12 @@
};
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 {
diff --git a/services/inputflinger/reader/mapper/SensorInputMapper.cpp b/services/inputflinger/reader/mapper/SensorInputMapper.cpp
index 4233f78..1f6600d 100644
--- a/services/inputflinger/reader/mapper/SensorInputMapper.cpp
+++ b/services/inputflinger/reader/mapper/SensorInputMapper.cpp
@@ -212,7 +212,7 @@
// 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),
diff --git a/services/inputflinger/reader/mapper/SensorInputMapper.h b/services/inputflinger/reader/mapper/SensorInputMapper.h
index 63bc151..7974efe 100644
--- a/services/inputflinger/reader/mapper/SensorInputMapper.h
+++ b/services/inputflinger/reader/mapper/SensorInputMapper.h
@@ -101,7 +101,7 @@
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;
diff --git a/services/inputflinger/tests/SensorInputMapper_test.cpp b/services/inputflinger/tests/SensorInputMapper_test.cpp
index 2c12653..ac2e99e 100644
--- a/services/inputflinger/tests/SensorInputMapper_test.cpp
+++ b/services/inputflinger/tests/SensorInputMapper_test.cpp
@@ -125,7 +125,7 @@
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 @@
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);