From dc275f8c2a7c2814cfab8372abd5d90993a427e2 Mon Sep 17 00:00:00 2001 From: Chris Ye Date: Tue, 18 Aug 2020 12:42:22 -0700 Subject: [PATCH] Move KeyLayoutMap from RefBase to shared_ptr. Move KeyLayoutMap from inheriting RefBase and use shared_ptr to store in owner class like KeyMap. Bug: 160010896 Test: atest inputflinger, atest libinput_tests Change-Id: I5caca94bfc4a7e038729479a53f09a89d97a1c23 --- tools/validatekeymaps/Main.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/validatekeymaps/Main.cpp b/tools/validatekeymaps/Main.cpp index 5ac9dfd2a5572..756347179874b 100644 --- a/tools/validatekeymaps/Main.cpp +++ b/tools/validatekeymaps/Main.cpp @@ -96,10 +96,9 @@ static bool validateFile(const char* filename) { return false; case FILETYPE_KEYLAYOUT: { - sp map; - status_t status = KeyLayoutMap::load(filename, &map); - if (status) { - error("Error %d parsing key layout file.\n\n", status); + base::Result> ret = KeyLayoutMap::load(filename); + if (!ret) { + error("Error %s parsing key layout file.\n\n", ret.error().message().c_str()); return false; } break;