Revert^2 "Support touchpad gesture properties in IDC files"

a53cb97af2b4cbb247094d6be93583712dbee3c4

Change-Id: I5463f938665212362b8780e1c646a4b2bf8ad10a
diff --git a/libs/input/PropertyMap.cpp b/libs/input/PropertyMap.cpp
index ed9ac9f..9a4f10b 100644
--- a/libs/input/PropertyMap.cpp
+++ b/libs/input/PropertyMap.cpp
@@ -16,6 +16,8 @@
 
 #define LOG_TAG "PropertyMap"
 
+#include <cstdlib>
+
 #include <input/PropertyMap.h>
 #include <log/log.h>
 
@@ -44,6 +46,16 @@
     mProperties.emplace(key, value);
 }
 
+std::unordered_set<std::string> PropertyMap::getKeysWithPrefix(const std::string& prefix) const {
+    std::unordered_set<std::string> keys;
+    for (const auto& [key, _] : mProperties) {
+        if (key.starts_with(prefix)) {
+            keys.insert(key);
+        }
+    }
+    return keys;
+}
+
 bool PropertyMap::hasProperty(const std::string& key) const {
     return mProperties.find(key) != mProperties.end();
 }
@@ -102,6 +114,23 @@
     return true;
 }
 
+bool PropertyMap::tryGetProperty(const std::string& key, double& outValue) const {
+    std::string stringValue;
+    if (!tryGetProperty(key, stringValue) || stringValue.length() == 0) {
+        return false;
+    }
+
+    char* end;
+    double value = strtod(stringValue.c_str(), &end);
+    if (*end != '\0') {
+        ALOGW("Property key '%s' has invalid value '%s'.  Expected a double.", key.c_str(),
+              stringValue.c_str());
+        return false;
+    }
+    outValue = value;
+    return true;
+}
+
 void PropertyMap::addAll(const PropertyMap* map) {
     for (const auto& [key, value] : map->mProperties) {
         mProperties.emplace(key, value);