summaryrefslogtreecommitdiff
path: root/libs/binder/PersistableBundle.cpp
diff options
context:
space:
mode:
author Abhishek Gadewar <abhishekgadewar@meta.com> 2024-05-09 17:02:18 -0700
committer Abhishek Gadewar <abhishekgadewar@meta.com> 2024-05-24 18:37:38 -0700
commit76f00826a546d7cf3543c0bf760a4cd0910bc78c (patch)
tree8e9ea40f2b78093107e10c4927fb95a6e2d3c266 /libs/binder/PersistableBundle.cpp
parentfe63f670069facb658cc3ed50c7974c2da1c505d (diff)
Don't log error on success
Summary: std::map::erase(Key&) returns 0 on failure (key did not exist), 1 on success (key existed and was deleted). Prior to this change, PersistableBundle would log an error anytime a key was successfully deleted. Test: added PersistableBundle test Change-Id: I9c2f6cabd30f784d5dbde5dee1f3d0eb2461bd06 Signed-off-by: Abhishek Gadewar <abhishekgadewar@meta.com>
Diffstat (limited to 'libs/binder/PersistableBundle.cpp')
-rw-r--r--libs/binder/PersistableBundle.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/libs/binder/PersistableBundle.cpp b/libs/binder/PersistableBundle.cpp
index 15047152a1..5b157cc7c3 100644
--- a/libs/binder/PersistableBundle.cpp
+++ b/libs/binder/PersistableBundle.cpp
@@ -82,13 +82,12 @@ namespace os {
} \
}
-#define RETURN_IF_ENTRY_ERASED(map, key) \
- { \
- size_t num_erased = (map).erase(key); \
- if (num_erased) { \
- ALOGE("Failed at %s:%d (%s)", __FILE__, __LINE__, __func__); \
- return num_erased; \
- } \
+#define RETURN_IF_ENTRY_ERASED(map, key) \
+ { \
+ size_t num_erased = (map).erase(key); \
+ if (num_erased) { \
+ return num_erased; \
+ } \
}
status_t PersistableBundle::writeToParcel(Parcel* parcel) const {