diff options
author | Siarhei Vishniakou <svv@google.com> | 2020-09-08 22:43:35 -0500 |
---|---|---|
committer | Siarhei Vishniakou <svv@google.com> | 2020-09-18 16:29:17 -0500 |
commit | 2da17761f9545b9427a1bc4ef8b2ecf3a337b950 (patch) | |
tree | f9931269c3240731f12c7d931ef78b6b979e8f18 | |
parent | a67b86d081f6b6c824f03b5a5c9aff12d84f9cd0 (diff) |
Update usage of PropertyMap::load
Now that PropertyMap returns an owned object, update the usage in
validatekeymaps.
Bug: 163171599
Test: presubmit
Change-Id: I75b9abe3fa1d418951a8c23a624771046a89b3f8
-rw-r--r-- | PREUPLOAD.cfg | 1 | ||||
-rw-r--r-- | tools/validatekeymaps/Main.cpp | 10 |
2 files changed, 6 insertions, 5 deletions
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg index fc5efc6e03ac..7a8d1a1caf25 100644 --- a/PREUPLOAD.cfg +++ b/PREUPLOAD.cfg @@ -11,6 +11,7 @@ clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp libs/input/ services/core/jni/ services/incremental/ + tools/ [Hook Scripts] checkstyle_hook = ${REPO_ROOT}/prebuilts/checkstyle/checkstyle.py --sha ${PREUPLOAD_COMMIT} diff --git a/tools/validatekeymaps/Main.cpp b/tools/validatekeymaps/Main.cpp index 7c150f9c8db9..0af6266d1642 100644 --- a/tools/validatekeymaps/Main.cpp +++ b/tools/validatekeymaps/Main.cpp @@ -115,13 +115,13 @@ static bool validateFile(const char* filename) { } case FILETYPE_INPUTDEVICECONFIGURATION: { - PropertyMap* map; - status_t status = PropertyMap::load(String8(filename), &map); - if (status) { - error("Error %d parsing input device configuration file.\n\n", status); + android::base::Result<std::unique_ptr<PropertyMap>> propertyMap = + PropertyMap::load(String8(filename)); + if (!propertyMap.ok()) { + error("Error %d parsing input device configuration file.\n\n", + propertyMap.error().code()); return false; } - delete map; break; } |