Merge "libbinder: Status s/stringstream/ostream/" am: 5e36c71555
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1498439
Change-Id: If028d7311b189e6d4437c54ab7f906a9b9794c90
diff --git a/libs/binder/Status.cpp b/libs/binder/Status.cpp
index 64ab7a9..b5a078c 100644
--- a/libs/binder/Status.cpp
+++ b/libs/binder/Status.cpp
@@ -245,10 +245,5 @@
return ret;
}
-std::stringstream& operator<< (std::stringstream& stream, const Status& s) {
- stream << s.toString8().string();
- return stream;
-}
-
} // namespace binder
} // namespace android
diff --git a/libs/binder/include/binder/Status.h b/libs/binder/include/binder/Status.h
index 7d889b6..c30ae01 100644
--- a/libs/binder/include/binder/Status.h
+++ b/libs/binder/include/binder/Status.h
@@ -18,7 +18,8 @@
#define ANDROID_BINDER_STATUS_H
#include <cstdint>
-#include <sstream>
+#include <sstream> // historical
+#include <ostream>
#include <binder/Parcel.h>
#include <utils/String8.h>
@@ -153,8 +154,9 @@
String8 mMessage;
}; // class Status
-// For gtest output logging
-std::stringstream& operator<< (std::stringstream& stream, const Status& s);
+static inline std::ostream& operator<< (std::ostream& o, const Status& s) {
+ return o << s.toString8();
+}
} // namespace binder
} // namespace android