From 56b2c4bb35107a2903f97a72bcd695ab397c39de Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Fri, 15 Nov 2019 00:15:33 -0800 Subject: Status: toString8, include stringified status_t "-2147483640" is not a clear error message. "UNEXPECTED_NULL" is. Bug: 144534032 Test: TH Change-Id: I235bb1abb88481ffba4c140c27223077880e4dd0 --- libs/binder/Status.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/binder/Status.cpp b/libs/binder/Status.cpp index 0ad99cee3f..674f0657a9 100644 --- a/libs/binder/Status.cpp +++ b/libs/binder/Status.cpp @@ -232,9 +232,10 @@ String8 Status::toString8() const { ret.append("No error"); } else { ret.appendFormat("Status(%d, %s): '", mException, exceptionToString(mException).c_str()); - if (mException == EX_SERVICE_SPECIFIC || - mException == EX_TRANSACTION_FAILED) { + if (mException == EX_SERVICE_SPECIFIC) { ret.appendFormat("%d: ", mErrorCode); + } else if (mException == EX_TRANSACTION_FAILED) { + ret.appendFormat("%s: ", statusToString(mErrorCode).c_str()); } ret.append(String8(mMessage)); ret.append("'"); -- cgit v1.2.3-59-g8ed1b