blob: c9c81a07f556363b3e6ca7ab94b7d112b763b76a [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 Ahn169eeec2017-07-10 13:56:10 +090017#define LOG_TAG "android.hardware.configstore@1.0-service"
Jiyong Parkc5d7c8a2017-01-14 19:40:33 +090018
Sundong Ahn169eeec2017-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>
Jeff Vander Stoep03253b42017-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
Jiyong Parkc5d7c8a2017-01-14 19:40:33 +090025using android::hardware::configureRpcThreadpool;
Jiyong Parkc5d7c8a2017-01-14 19:40:33 +090026using android::hardware::joinRpcThreadpool;
Sundong Ahn169eeec2017-07-10 13:56:10 +090027using android::hardware::configstore::V1_0::ISurfaceFlingerConfigs;
28using android::hardware::configstore::V1_0::implementation::SurfaceFlingerConfigs;
Jeff Vander Stoep03253b42017-07-06 22:29:12 -070029using android::hardware::SetupMinijail;
Jaesoo Lee2d66f612017-03-20 13:57:10 +090030using android::sp;
Steven Morelandf88a9fe2017-03-19 14:38:20 -070031using android::status_t;
32using android::OK;
33
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
Sundong Ahn169eeec2017-07-10 13:56:10 +090037 SetupMinijail("/vendor/etc/seccomp_policy/configstore@1.0.policy");
Jeff Vander Stoep03253b42017-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}