summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-03-01 08:55:45 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-03-01 08:55:45 +0000
commit413a3ef40c5a41526dc189f3f20ed7da3e0679e5 (patch)
tree6a513ac5f950643b65d9b78cf65af96a75d3ac13
parent33bdb28748752f6cf8d369c6a536028603de97de (diff)
parent8244a8b367e137256cd429349972d5cbb57eaca6 (diff)
downloadnative-413a3ef40c5a41526dc189f3f20ed7da3e0679e5.tar.gz
Snap for 9669149 from 8244a8b367e137256cd429349972d5cbb57eaca6 to mainline-resolv-release
Change-Id: If78d1c4706b748b29516a506f0fd73b1b71f919a
-rw-r--r--libs/binder/ndk/include_cpp/android/binder_auto_utils.h9
-rw-r--r--libs/binder/ndk/tests/binderVendorDoubleLoadTest.cpp2
2 files changed, 8 insertions, 3 deletions
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 7ea9be797b..885048a3d3 100644
--- a/libs/binder/ndk/include_cpp/android/binder_auto_utils.h
+++ b/libs/binder/ndk/include_cpp/android/binder_auto_utils.h
@@ -30,11 +30,11 @@
#include <android/binder_internal_logging.h>
#include <android/binder_parcel.h>
#include <android/binder_status.h>
-
#include <assert.h>
-
#include <unistd.h>
+
#include <cstddef>
+#include <iostream>
#include <string>
namespace ndk {
@@ -315,6 +315,11 @@ class ScopedAStatus : public impl::ScopedAResource<AStatus*, AStatus_delete, nul
}
};
+static inline std::ostream& operator<<(std::ostream& os, const ScopedAStatus& status) {
+ return os << status.getDescription();
+ return os;
+}
+
/**
* Convenience wrapper. See AIBinder_DeathRecipient.
*/
diff --git a/libs/binder/ndk/tests/binderVendorDoubleLoadTest.cpp b/libs/binder/ndk/tests/binderVendorDoubleLoadTest.cpp
index f3cd21822d..43b2cb8577 100644
--- a/libs/binder/ndk/tests/binderVendorDoubleLoadTest.cpp
+++ b/libs/binder/ndk/tests/binderVendorDoubleLoadTest.cpp
@@ -106,7 +106,7 @@ TEST(DoubleBinder, CallIntoNdk) {
std::string outString;
ScopedAStatus status = server->RepeatString("foo", &outString);
EXPECT_EQ(STATUS_OK, AStatus_getExceptionCode(status.get()))
- << serviceName << " " << status.getDescription();
+ << serviceName << " " << status;
EXPECT_EQ("foo", outString) << serviceName;
}
}