OSDN Git Service

dumpsys: remove usage of String16::std_string
authorSteven Moreland <smoreland@google.com>
Fri, 10 Mar 2017 06:59:32 +0000 (22:59 -0800)
committerSteven Moreland <smoreland@google.com>
Fri, 10 Mar 2017 07:00:02 +0000 (23:00 -0800)
Test: pass

Change-Id: Ib74a126b91d25376a7235f73bbc12ada62ae7e69

cmds/dumpsys/tests/dumpsys_test.cpp

index a61cb00..66beb6d 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <android-base/file.h>
 #include <utils/String16.h>
+#include <utils/String8.h>
 #include <utils/Vector.h>
 
 using namespace android;
@@ -95,7 +96,7 @@ MATCHER_P(AndroidElementsAre, expected, "") {
     int i = 0;
     std::ostringstream actual_stream, expected_stream;
     for (String16 actual : arg) {
-        std::string actual_str = String16::std_string(actual);
+        std::string actual_str = String8(actual).c_str();
         std::string expected_str = expected[i];
         actual_stream << "'" << actual_str << "' ";
         expected_stream << "'" << expected_str << "' ";