summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/inputflinger/reader/mapper/gestures/PropertyProvider.cpp12
-rw-r--r--services/inputflinger/reader/mapper/gestures/PropertyProvider.h12
2 files changed, 12 insertions, 12 deletions
diff --git a/services/inputflinger/reader/mapper/gestures/PropertyProvider.cpp b/services/inputflinger/reader/mapper/gestures/PropertyProvider.cpp
index cd18cd3e35..089f45a4e6 100644
--- a/services/inputflinger/reader/mapper/gestures/PropertyProvider.cpp
+++ b/services/inputflinger/reader/mapper/gestures/PropertyProvider.cpp
@@ -68,11 +68,11 @@ const GesturesPropProvider gesturePropProvider = {
.free_fn = freeProperty,
};
-bool PropertyProvider::hasProperty(const std::string name) const {
+bool PropertyProvider::hasProperty(const std::string& name) const {
return mProperties.find(name) != mProperties.end();
}
-GesturesProp& PropertyProvider::getProperty(const std::string name) {
+GesturesProp& PropertyProvider::getProperty(const std::string& name) {
return mProperties.at(name);
}
@@ -84,7 +84,7 @@ std::string PropertyProvider::dump() const {
return dump;
}
-GesturesProp* PropertyProvider::createIntArrayProperty(const std::string name, int* loc,
+GesturesProp* PropertyProvider::createIntArrayProperty(const std::string& name, int* loc,
size_t count, const int* init) {
const auto [it, inserted] =
mProperties.insert(std::pair{name, GesturesProp(name, loc, count, init)});
@@ -92,7 +92,7 @@ GesturesProp* PropertyProvider::createIntArrayProperty(const std::string name, i
return &it->second;
}
-GesturesProp* PropertyProvider::createBoolArrayProperty(const std::string name,
+GesturesProp* PropertyProvider::createBoolArrayProperty(const std::string& name,
GesturesPropBool* loc, size_t count,
const GesturesPropBool* init) {
const auto [it, inserted] =
@@ -101,7 +101,7 @@ GesturesProp* PropertyProvider::createBoolArrayProperty(const std::string name,
return &it->second;
}
-GesturesProp* PropertyProvider::createRealArrayProperty(const std::string name, double* loc,
+GesturesProp* PropertyProvider::createRealArrayProperty(const std::string& name, double* loc,
size_t count, const double* init) {
const auto [it, inserted] =
mProperties.insert(std::pair{name, GesturesProp(name, loc, count, init)});
@@ -109,7 +109,7 @@ GesturesProp* PropertyProvider::createRealArrayProperty(const std::string name,
return &it->second;
}
-GesturesProp* PropertyProvider::createStringProperty(const std::string name, const char** loc,
+GesturesProp* PropertyProvider::createStringProperty(const std::string& name, const char** loc,
const char* const init) {
const auto [it, inserted] = mProperties.insert(std::pair{name, GesturesProp(name, loc, init)});
LOG_ALWAYS_FATAL_IF(!inserted, "Gesture property \"%s\" already exists.", name.c_str());
diff --git a/services/inputflinger/reader/mapper/gestures/PropertyProvider.h b/services/inputflinger/reader/mapper/gestures/PropertyProvider.h
index c21260f6c2..50451a3929 100644
--- a/services/inputflinger/reader/mapper/gestures/PropertyProvider.h
+++ b/services/inputflinger/reader/mapper/gestures/PropertyProvider.h
@@ -31,18 +31,18 @@ extern const GesturesPropProvider gesturePropProvider;
// Implementation of a gestures library property provider, which provides configuration parameters.
class PropertyProvider {
public:
- bool hasProperty(const std::string name) const;
- GesturesProp& getProperty(const std::string name);
+ bool hasProperty(const std::string& name) const;
+ GesturesProp& getProperty(const std::string& name);
std::string dump() const;
// Methods to be called by the gestures library:
- GesturesProp* createIntArrayProperty(const std::string name, int* loc, size_t count,
+ GesturesProp* createIntArrayProperty(const std::string& name, int* loc, size_t count,
const int* init);
- GesturesProp* createBoolArrayProperty(const std::string name, GesturesPropBool* loc,
+ GesturesProp* createBoolArrayProperty(const std::string& name, GesturesPropBool* loc,
size_t count, const GesturesPropBool* init);
- GesturesProp* createRealArrayProperty(const std::string name, double* loc, size_t count,
+ GesturesProp* createRealArrayProperty(const std::string& name, double* loc, size_t count,
const double* init);
- GesturesProp* createStringProperty(const std::string name, const char** loc,
+ GesturesProp* createStringProperty(const std::string& name, const char** loc,
const char* const init);
void freeProperty(GesturesProp* prop);