libbinder: add BINDER_GET_EXTENDED_ERROR support
This adds basic support to pull extended error information provided by
the driver via BINDER_GET_EXTENDED_ERROR ioctl. For now, we'll only log
the information upon a failed transaction. However, this data can later
be used to handle error scenarios such as retry strategies.
Bug: 28321379
Test: atest binderLibTest
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: I8aed63cb0d1aa15aa96db4ab8999e300fef1f505
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp
index 4a01d81..c4cf3e6 100644
--- a/libs/binder/ProcessState.cpp
+++ b/libs/binder/ProcessState.cpp
@@ -415,6 +415,8 @@
static const char* const names[] = {
[static_cast<int>(DriverFeature::ONEWAY_SPAM_DETECTION)] =
DRIVER_FEATURES_PATH "oneway_spam_detection",
+ [static_cast<int>(DriverFeature::EXTENDED_ERROR)] =
+ DRIVER_FEATURES_PATH "extended_error",
};
int fd = open(names[static_cast<int>(feature)], O_RDONLY | O_CLOEXEC);
char on;