SurfaceFlinger: Get rid of String8 in dumpsys
Test: build and gui/ui/renderengine/surfaceflinger tests and compare
dumpsys SurfaceFlinger results
Change-Id: Iafdaf73a0acbbbb8fbafc930ad86285106a07e13
diff --git a/services/surfaceflinger/tests/unittests/SchedulerTest.cpp b/services/surfaceflinger/tests/unittests/SchedulerTest.cpp
index d0cf1b7..35f30d7 100644
--- a/services/surfaceflinger/tests/unittests/SchedulerTest.cpp
+++ b/services/surfaceflinger/tests/unittests/SchedulerTest.cpp
@@ -117,7 +117,7 @@
mScheduler->hotplugReceived(nullptr, EventThread::DisplayType::Primary, false));
ASSERT_NO_FATAL_FAILURE(mScheduler->onScreenAcquired(nullptr));
ASSERT_NO_FATAL_FAILURE(mScheduler->onScreenReleased(nullptr));
- String8 testString;
+ std::string testString;
ASSERT_NO_FATAL_FAILURE(mScheduler->dump(nullptr, testString));
EXPECT_TRUE(testString == "");
ASSERT_NO_FATAL_FAILURE(mScheduler->setPhaseOffset(nullptr, 10));
@@ -146,7 +146,7 @@
EXPECT_CALL(*mEventThread, onScreenReleased()).Times(0);
ASSERT_NO_FATAL_FAILURE(mScheduler->onScreenReleased(connectionHandle));
- String8 testString;
+ std::string testString;
EXPECT_CALL(*mEventThread, dump(_)).Times(0);
ASSERT_NO_FATAL_FAILURE(mScheduler->dump(connectionHandle, testString));
EXPECT_TRUE(testString == "");
@@ -176,7 +176,7 @@
EXPECT_CALL(*mEventThread, onScreenReleased()).Times(1);
ASSERT_NO_FATAL_FAILURE(mScheduler->onScreenReleased(mConnectionHandle));
- String8 testString("dump");
+ std::string testString("dump");
EXPECT_CALL(*mEventThread, dump(testString)).Times(1);
ASSERT_NO_FATAL_FAILURE(mScheduler->dump(mConnectionHandle, testString));
EXPECT_TRUE(testString != "");
diff --git a/services/surfaceflinger/tests/unittests/TimeStatsTest.cpp b/services/surfaceflinger/tests/unittests/TimeStatsTest.cpp
index 186ed79..bfd34cd 100644
--- a/services/surfaceflinger/tests/unittests/TimeStatsTest.cpp
+++ b/services/surfaceflinger/tests/unittests/TimeStatsTest.cpp
@@ -21,7 +21,6 @@
#include <log/log.h>
#include <utils/String16.h>
-#include <utils/String8.h>
#include <utils/Vector.h>
#include <random>
@@ -131,7 +130,7 @@
std::string TimeStatsTest::inputCommand(InputCommand cmd, bool useProto) {
size_t index = 0;
- String8 result;
+ std::string result;
Vector<String16> args;
switch (cmd) {
@@ -162,7 +161,7 @@
}
EXPECT_NO_FATAL_FAILURE(mTimeStats->parseArgs(useProto, args, index, result));
- return std::string(result.string(), result.size());
+ return result;
}
static std::string genLayerName(int32_t layerID) {
diff --git a/services/surfaceflinger/tests/unittests/mock/MockDispSync.h b/services/surfaceflinger/tests/unittests/mock/MockDispSync.h
index 34e71cb..9213ae5 100644
--- a/services/surfaceflinger/tests/unittests/mock/MockDispSync.h
+++ b/services/surfaceflinger/tests/unittests/mock/MockDispSync.h
@@ -18,7 +18,6 @@
#include <gmock/gmock.h>
-#include <utils/String8.h>
#include "Scheduler/DispSync.h"
namespace android {
@@ -44,7 +43,7 @@
MOCK_METHOD1(setIgnorePresentFences, void(bool));
MOCK_METHOD0(expectedPresentTime, nsecs_t());
- MOCK_CONST_METHOD1(dump, void(String8&));
+ MOCK_CONST_METHOD1(dump, void(std::string&));
};
} // namespace mock
diff --git a/services/surfaceflinger/tests/unittests/mock/MockEventThread.h b/services/surfaceflinger/tests/unittests/mock/MockEventThread.h
index ad2463d..0a1c827 100644
--- a/services/surfaceflinger/tests/unittests/mock/MockEventThread.h
+++ b/services/surfaceflinger/tests/unittests/mock/MockEventThread.h
@@ -32,7 +32,7 @@
MOCK_METHOD0(onScreenReleased, void());
MOCK_METHOD0(onScreenAcquired, void());
MOCK_METHOD2(onHotplugReceived, void(DisplayType, bool));
- MOCK_CONST_METHOD1(dump, void(String8&));
+ MOCK_CONST_METHOD1(dump, void(std::string&));
MOCK_METHOD1(setPhaseOffset, void(nsecs_t phaseOffset));
};
diff --git a/services/surfaceflinger/tests/unittests/mock/RenderEngine/MockRenderEngine.h b/services/surfaceflinger/tests/unittests/mock/RenderEngine/MockRenderEngine.h
index a416808..11e5631 100644
--- a/services/surfaceflinger/tests/unittests/mock/RenderEngine/MockRenderEngine.h
+++ b/services/surfaceflinger/tests/unittests/mock/RenderEngine/MockRenderEngine.h
@@ -38,7 +38,7 @@
MOCK_METHOD0(createFramebuffer, std::unique_ptr<Framebuffer>());
MOCK_METHOD0(createImage, std::unique_ptr<renderengine::Image>());
MOCK_CONST_METHOD0(primeCache, void());
- MOCK_METHOD1(dump, void(String8&));
+ MOCK_METHOD1(dump, void(std::string&));
MOCK_CONST_METHOD0(useNativeFenceSync, bool());
MOCK_CONST_METHOD0(useWaitSync, bool());
MOCK_CONST_METHOD0(isCurrent, bool());