commit | a15095652a64457877b9c3f90709ece1caf006c3 | [log] [tgz] |
---|---|---|
author | Steven Moreland <smoreland@google.com> | Wed Jan 20 22:16:03 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Jan 20 22:16:03 2021 +0000 |
tree | 36c8d66cdd9f3ed555e277e5feb22f7e8e1fd798 | |
parent | aaa954a6ae4ac042f41155df92aac2138871264a [diff] | |
parent | da4a5ca5b7cd4865c315d41fad30f56db0a1a13e [diff] |
Merge "libbinder_ndk: ScopedAStatus description compat" am: da4a5ca5b7 Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1553307 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I39ca5aa5f98243d1cd584556fc14f5bb19f8b683
diff --git a/libs/binder/ndk/include_cpp/android/binder_auto_utils.h b/libs/binder/ndk/include_cpp/android/binder_auto_utils.h index 6b52c0a..0ad400b 100644 --- a/libs/binder/ndk/include_cpp/android/binder_auto_utils.h +++ b/libs/binder/ndk/include_cpp/android/binder_auto_utils.h
@@ -265,7 +265,18 @@ AStatus_deleteDescription(cStr); return ret; } - return "(not available)"; + binder_exception_t exception = getExceptionCode(); + std::string desc = std::to_string(exception); + if (exception == EX_SERVICE_SPECIFIC) { + desc += " (" + std::to_string(getServiceSpecificError()) + ")"; + } else if (exception == EX_TRANSACTION_FAILED) { + desc += " (" + std::to_string(getStatus()) + ")"; + } + if (const char* msg = getMessage(); msg != nullptr) { + desc += ": "; + desc += msg; + } + return desc; } /**