blob: f70cbdbc63242f7145ff28bedec234fe1f577b5c [file] [log] [blame]
Kalle Raitaa099a242017-01-11 11:17:29 -08001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#define LOG_NDEBUG 0
18#undef LOG_TAG
19#define LOG_TAG "FakeHwcService"
20#include <log/log.h>
21
22#include "FakeComposerService.h"
23
24using namespace android::hardware;
25
26namespace sftest {
27
28FakeComposerService::FakeComposerService(android::sp<ComposerClient>& client) : mClient(client) {}
29
30FakeComposerService::~FakeComposerService() {
31 ALOGI("Maybe killing client %p", mClient.get());
32 // Rely on sp to kill the client.
33}
34
35Return<void> FakeComposerService::getCapabilities(getCapabilities_cb hidl_cb) {
36 ALOGI("FakeComposerService::getCapabilities");
37 hidl_cb(hidl_vec<Capability>());
38 return Void();
39}
40
41Return<void> FakeComposerService::dumpDebugInfo(dumpDebugInfo_cb hidl_cb) {
42 ALOGI("FakeComposerService::dumpDebugInfo");
43 hidl_cb(hidl_string());
44 return Void();
45}
46
47Return<void> FakeComposerService::createClient(createClient_cb hidl_cb) {
48 ALOGI("FakeComposerService::createClient %p", mClient.get());
Chia-I Wu29e146b2018-01-30 12:17:56 -080049 if (!mClient->init()) {
50 LOG_ALWAYS_FATAL("failed to initialize ComposerClient");
51 }
Kalle Raitaa099a242017-01-11 11:17:29 -080052 hidl_cb(Error::NONE, mClient);
53 return Void();
54}
55
56} // namespace sftest