diff options
author | Pavel Maltsev | 2017-03-20 16:58:59 -0500 |
---|---|---|
committer | Jaesoo Lee | 2017-04-05 21:10:03 -0500 |
commit | 1c5704d08c303f47362af9d912b97da3323e09d9 (patch) | |
tree | 89b4e9eecac0dbecf12ebc4e3776495890ddd799 | |
parent | 792ec065e07b3afa3602a6361e90646cdd2521a2 (diff) | |
download | platform-hardware-interfaces-1c5704d08c303f47362af9d912b97da3323e09d9.tar.gz platform-hardware-interfaces-1c5704d08c303f47362af9d912b97da3323e09d9.tar.xz platform-hardware-interfaces-1c5704d08c303f47362af9d912b97da3323e09d9.zip |
Handle hidl transaction errors in ConfigStore
Test: surface flinger not failing, android now bootsup
Bug: b/36445794
Change-Id: I64cc404bec71f5e4eea2e0034f07b86fb60a3e32
Merged-In: I22fa7aab9fa92bc04333aaa0eef45891ebeba8e7
(cherry picked from commit 076b792ade608a7fdf4e600a42550ad17296a39e)
-rw-r--r-- | configstore/utils/include/configstore/Utils.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/configstore/utils/include/configstore/Utils.h b/configstore/utils/include/configstore/Utils.h index 98ccae90..42bf0024 100644 --- a/configstore/utils/include/configstore/Utils.h +++ b/configstore/utils/include/configstore/Utils.h | |||
@@ -20,6 +20,10 @@ | |||
20 | #include <hidl/Status.h> | 20 | #include <hidl/Status.h> |
21 | #include <stdatomic.h> | 21 | #include <stdatomic.h> |
22 | 22 | ||
23 | #pragma push_macro("LOG_TAG") | ||
24 | #undef LOG_TAG | ||
25 | #define LOG_TAG "ConfigStoreUtil" | ||
26 | |||
23 | namespace android { | 27 | namespace android { |
24 | namespace hardware { | 28 | namespace hardware { |
25 | namespace configstore { | 29 | namespace configstore { |
@@ -39,9 +43,11 @@ decltype(V::value) get(const decltype(V::value) &defValue) { | |||
39 | // fallback to the default value | 43 | // fallback to the default value |
40 | ret.specified = false; | 44 | ret.specified = false; |
41 | } else { | 45 | } else { |
42 | (*configs.*func)([&ret](V v) { | 46 | auto status = (*configs.*func)([&ret](V v) { ret = v; }); |
43 | ret = v; | 47 | if (!status.isOk()) { |
44 | }); | 48 | ALOGE("HIDL call failed. %s", status.description().c_str()); |
49 | ret.specified = false; | ||
50 | } | ||
45 | } | 51 | } |
46 | 52 | ||
47 | return ret; | 53 | return ret; |
@@ -91,4 +97,6 @@ std::string getString(const std::string &defValue) { | |||
91 | } // namespace hardware | 97 | } // namespace hardware |
92 | } // namespace android | 98 | } // namespace android |
93 | 99 | ||
100 | #pragma pop_macro("LOG_TAG") | ||
101 | |||
94 | #endif // ANDROID_HARDWARE_CONFIGSTORE_UTILS_H | 102 | #endif // ANDROID_HARDWARE_CONFIGSTORE_UTILS_H |