fakehwc, libvr_hwc-hal: ComposerClient is moved
ComposerClient is moved to another library with some changes. This
allows us to kill the has-a relation between VrComposerClient and
ComposerClientImpl in VR.
Test: builds
Change-Id: I0c32386f7d62f33e2e4d1271be42953f6880fd75
diff --git a/services/surfaceflinger/tests/fakehwc/Android.bp b/services/surfaceflinger/tests/fakehwc/Android.bp
index 63da4e2..00bc621 100644
--- a/services/surfaceflinger/tests/fakehwc/Android.bp
+++ b/services/surfaceflinger/tests/fakehwc/Android.bp
@@ -29,7 +29,6 @@
"libutils",
],
static_libs: [
- "libhwcomposer-client",
"libtrace_proto",
"libgmock"
],
diff --git a/services/surfaceflinger/tests/fakehwc/FakeComposerClient.h b/services/surfaceflinger/tests/fakehwc/FakeComposerClient.h
index 7c111dc..95c274a 100644
--- a/services/surfaceflinger/tests/fakehwc/FakeComposerClient.h
+++ b/services/surfaceflinger/tests/fakehwc/FakeComposerClient.h
@@ -18,7 +18,7 @@
#define HWC2_USE_CPP11
#define HWC2_INCLUDE_STRINGIFICATION
-#include "ComposerClient.h"
+#include <composer-hal/2.1/ComposerClient.h>
#undef HWC2_USE_CPP11
#undef HWC2_INCLUDE_STRINGIFICATION
#include "RenderState.h"
@@ -32,7 +32,6 @@
using namespace android::hardware::graphics::composer::V2_1;
using namespace android::hardware::graphics::composer::V2_1::hal;
-using namespace android::hardware::graphics::composer::V2_1::implementation;
using namespace android::hardware;
using namespace std::chrono_literals;
diff --git a/services/surfaceflinger/tests/fakehwc/FakeComposerService.cpp b/services/surfaceflinger/tests/fakehwc/FakeComposerService.cpp
index c411604..f70cbdb 100644
--- a/services/surfaceflinger/tests/fakehwc/FakeComposerService.cpp
+++ b/services/surfaceflinger/tests/fakehwc/FakeComposerService.cpp
@@ -46,7 +46,9 @@
Return<void> FakeComposerService::createClient(createClient_cb hidl_cb) {
ALOGI("FakeComposerService::createClient %p", mClient.get());
- mClient->initialize();
+ if (!mClient->init()) {
+ LOG_ALWAYS_FATAL("failed to initialize ComposerClient");
+ }
hidl_cb(Error::NONE, mClient);
return Void();
}
diff --git a/services/surfaceflinger/tests/fakehwc/FakeComposerService.h b/services/surfaceflinger/tests/fakehwc/FakeComposerService.h
index 5204084..c439b7e 100644
--- a/services/surfaceflinger/tests/fakehwc/FakeComposerService.h
+++ b/services/surfaceflinger/tests/fakehwc/FakeComposerService.h
@@ -16,10 +16,10 @@
#pragma once
-#include "ComposerClient.h"
+#include <composer-hal/2.1/ComposerClient.h>
using namespace android::hardware::graphics::composer::V2_1;
-using namespace android::hardware::graphics::composer::V2_1::implementation;
+using namespace android::hardware::graphics::composer::V2_1::hal;
using android::hardware::Return;
namespace sftest {
diff --git a/services/surfaceflinger/tests/fakehwc/SFFakeHwc_test.cpp b/services/surfaceflinger/tests/fakehwc/SFFakeHwc_test.cpp
index 1873832..74b2efc 100644
--- a/services/surfaceflinger/tests/fakehwc/SFFakeHwc_test.cpp
+++ b/services/surfaceflinger/tests/fakehwc/SFFakeHwc_test.cpp
@@ -168,7 +168,7 @@
// interface instead of the current Composer interface might also
// change the situation.
mMockComposer = new MockComposerClient;
- sp<ComposerClient> client = new ComposerClient(*mMockComposer);
+ sp<ComposerClient> client = new ComposerClient(mMockComposer);
mMockComposer->setClient(client.get());
mFakeService = new FakeComposerService(client);
(void)mFakeService->registerAsService("mock");
@@ -446,7 +446,7 @@
// TODO: See TODO comment at DisplayTest::SetUp for background on
// the lifetime of the FakeComposerClient.
sFakeComposer = new FakeComposerClient;
- sp<ComposerClient> client = new ComposerClient(*sFakeComposer);
+ sp<ComposerClient> client = new ComposerClient(sFakeComposer);
sFakeComposer->setClient(client.get());
sp<IComposer> fakeService = new FakeComposerService(client);
(void)fakeService->registerAsService("mock");