Improve EventHub const-correctness
Ensure that all methods that "get" state from event hub are
const-correct. While some "set" methods can also be const in event hub
because they write to the system (side effect) instead of changing
state, we leave these as non-const to make it easier for testing.
Bug: None
Test: atest inputflinger_tests
Change-Id: I086b50458203a2395b1960e2bc1102610a3c0801
diff --git a/include/input/KeyLayoutMap.h b/include/input/KeyLayoutMap.h
index 1da78aa..a6c696d 100644
--- a/include/input/KeyLayoutMap.h
+++ b/include/input/KeyLayoutMap.h
@@ -78,7 +78,7 @@
std::optional<AxisInfo> mapAxis(int32_t scanCode) const;
const std::string getLoadFileName() const;
// Return pair of sensor type and sensor data index, for the input device abs code
- base::Result<std::pair<InputDeviceSensorType, int32_t>> mapSensor(int32_t absCode);
+ base::Result<std::pair<InputDeviceSensorType, int32_t>> mapSensor(int32_t absCode) const;
virtual ~KeyLayoutMap();