summaryrefslogtreecommitdiff
path: root/tools/validatekeymaps/Main.cpp
diff options
context:
space:
mode:
author Chris Ye <lzye@google.com> 2020-08-18 12:15:28 -0700
committer Chris Ye <lzye@google.com> 2020-08-30 15:41:24 -0700
commite8da2d3a48ac87760fbf89a7dc2c6fe3c28546c1 (patch)
tree76a070e886e829f57b20687415173b49f58871dd /tools/validatekeymaps/Main.cpp
parentdc275f8c2a7c2814cfab8372abd5d90993a427e2 (diff)
Move KeyCharacterMap from RefBase to shared_ptr.
Move KeyCharacterMap from RefBase and make it shared_ptr in it's owner class like EventHub and InputDeviceInfo. When loaded from file, KeyCharacterMap as shared_ptr is stored in both InputDeviceInfo and EventHub device. Bug: 160010896 Test: atest inputflinger, atest libinput_tests Change-Id: Ib3c489c3e87e04d68e4681994e430e43aa46164b
Diffstat (limited to 'tools/validatekeymaps/Main.cpp')
-rw-r--r--tools/validatekeymaps/Main.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/validatekeymaps/Main.cpp b/tools/validatekeymaps/Main.cpp
index 756347179874..0aca13e95a52 100644
--- a/tools/validatekeymaps/Main.cpp
+++ b/tools/validatekeymaps/Main.cpp
@@ -105,11 +105,10 @@ static bool validateFile(const char* filename) {
}
case FILETYPE_KEYCHARACTERMAP: {
- sp<KeyCharacterMap> map;
- status_t status = KeyCharacterMap::load(filename,
- KeyCharacterMap::FORMAT_ANY, &map);
- if (status) {
- error("Error %d parsing key character map file.\n\n", status);
+ base::Result<std::shared_ptr<KeyCharacterMap>> ret = KeyCharacterMap::load(filename,
+ KeyCharacterMap::FORMAT_ANY);
+ if (!ret) {
+ error("Error %s parsing key character map file.\n\n", ret.error().message().c_str());
return false;
}
break;