blob: 65a42f5955d61cb5d14557d7c9e3910be1bac4bf [file] [log] [blame]
Jiyong Parkc5d7c8a2017-01-14 19:40:33 +09001/*
Jaesoo Lee712ee822017-04-28 18:29:40 +09002 * Copyright (C) 2018 The Android Open Source Project
Jiyong Parkc5d7c8a2017-01-14 19:40:33 +09003 *
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
Peiyong Lin2b3f8262018-07-20 16:03:46 -070017#define LOG_TAG "android.hardware.configstore@1.2-service"
Jiyong Parkc5d7c8a2017-01-14 19:40:33 +090018
Peiyong Lin2b3f8262018-07-20 16:03:46 -070019#include <android/hardware/configstore/1.2/ISurfaceFlingerConfigs.h>
Jaesoo Lee2d66f612017-03-20 13:57:10 +090020#include <hidl/HidlTransportSupport.h>
Jeff Vander Stoeped950432017-07-06 22:29:12 -070021#include <hwminijail/HardwareMinijail.h>
Jiyong Parkc5d7c8a2017-01-14 19:40:33 +090022
Jaesoo Lee2d66f612017-03-20 13:57:10 +090023#include "SurfaceFlingerConfigs.h"
24
Peiyong Lin2b3f8262018-07-20 16:03:46 -070025using android::OK;
Jaesoo Lee2d66f612017-03-20 13:57:10 +090026using android::sp;
Steven Morelandf88a9fe2017-03-19 14:38:20 -070027using android::status_t;
Peiyong Lin2b3f8262018-07-20 16:03:46 -070028using android::hardware::configureRpcThreadpool;
29using android::hardware::joinRpcThreadpool;
30using android::hardware::SetupMinijail;
31using android::hardware::configstore::V1_2::ISurfaceFlingerConfigs;
32using android::hardware::configstore::V1_2::implementation::SurfaceFlingerConfigs;
Steven Morelandf88a9fe2017-03-19 14:38:20 -070033
Jiyong Parkc5d7c8a2017-01-14 19:40:33 +090034int main() {
Jiyong Parkc5d7c8a2017-01-14 19:40:33 +090035 configureRpcThreadpool(10, true);
Steven Morelandf88a9fe2017-03-19 14:38:20 -070036
Peiyong Lin2b3f8262018-07-20 16:03:46 -070037 SetupMinijail("/vendor/etc/seccomp_policy/configstore.policy");
Jeff Vander Stoeped950432017-07-06 22:29:12 -070038
Jaesoo Lee2d66f612017-03-20 13:57:10 +090039 sp<ISurfaceFlingerConfigs> surfaceFlingerConfigs = new SurfaceFlingerConfigs;
40 status_t status = surfaceFlingerConfigs->registerAsService();
Steven Morelandf88a9fe2017-03-19 14:38:20 -070041 LOG_ALWAYS_FATAL_IF(status != OK, "Could not register ISurfaceFlingerConfigs");
42
Jiyong Parkc5d7c8a2017-01-14 19:40:33 +090043 // other interface registration comes here
44 joinRpcThreadpool();
45 return 0;
46}