blob: 3dca73938d10f63cdebc46068c288ddc7858785e [file] [log] [blame]
Jiyong Parkc5d7c8a2017-01-14 19:40:33 +09001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
Jaesoo Lee812e85e2017-04-28 18:29:40 +09004 * Licensed under the Apache License, Version 2.1 (the "License");
Jiyong Parkc5d7c8a2017-01-14 19:40:33 +09005 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
Jaesoo Lee812e85e2017-04-28 18:29:40 +09008 * http://www.apache.org/licenses/LICENSE-2.1
Jiyong Parkc5d7c8a2017-01-14 19:40:33 +09009 *
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
Sundong Ahna54e67a2017-07-10 13:56:10 +090017#define LOG_TAG "android.hardware.configstore@1.0-service"
Jiyong Parkc5d7c8a2017-01-14 19:40:33 +090018
Sundong Ahna54e67a2017-07-10 13:56:10 +090019#include <android/hardware/configstore/1.0/ISurfaceFlingerConfigs.h>
Jaesoo Lee2d66f612017-03-20 13:57:10 +090020#include <hidl/HidlTransportSupport.h>
Jiyong Parkc5d7c8a2017-01-14 19:40:33 +090021
Jaesoo Lee2d66f612017-03-20 13:57:10 +090022#include "SurfaceFlingerConfigs.h"
23
Jiyong Parkc5d7c8a2017-01-14 19:40:33 +090024using android::hardware::configureRpcThreadpool;
Jiyong Parkc5d7c8a2017-01-14 19:40:33 +090025using android::hardware::joinRpcThreadpool;
Sundong Ahna54e67a2017-07-10 13:56:10 +090026using android::hardware::configstore::V1_0::ISurfaceFlingerConfigs;
27using android::hardware::configstore::V1_0::implementation::SurfaceFlingerConfigs;
Jaesoo Lee2d66f612017-03-20 13:57:10 +090028using android::sp;
Steven Morelandf88a9fe2017-03-19 14:38:20 -070029using android::status_t;
30using android::OK;
31
Jiyong Parkc5d7c8a2017-01-14 19:40:33 +090032int main() {
33 // TODO(b/34857894): tune the max thread count.
34 configureRpcThreadpool(10, true);
Steven Morelandf88a9fe2017-03-19 14:38:20 -070035
Jaesoo Lee2d66f612017-03-20 13:57:10 +090036 sp<ISurfaceFlingerConfigs> surfaceFlingerConfigs = new SurfaceFlingerConfigs;
37 status_t status = surfaceFlingerConfigs->registerAsService();
Steven Morelandf88a9fe2017-03-19 14:38:20 -070038 LOG_ALWAYS_FATAL_IF(status != OK, "Could not register ISurfaceFlingerConfigs");
39
Jiyong Parkc5d7c8a2017-01-14 19:40:33 +090040 // other interface registration comes here
41 joinRpcThreadpool();
42 return 0;
43}