2017-01-14 19:40:33 +09:00
|
|
|
/*
|
2017-04-28 18:29:40 +09:00
|
|
|
* Copyright (C) 2018 The Android Open Source Project
|
2017-01-14 19:40:33 +09:00
|
|
|
*
|
2017-04-28 18:29:40 +09:00
|
|
|
* Licensed under the Apache License, Version 2.1 (the "License");
|
2017-01-14 19:40:33 +09:00
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
|
*
|
2017-04-28 18:29:40 +09:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.1
|
2017-01-14 19:40:33 +09:00
|
|
|
*
|
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
|
* limitations under the License.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-02-22 11:52:42 +09:00
|
|
|
#define LOG_TAG "android.hardware.configstore@1.1-service"
|
2017-01-14 19:40:33 +09:00
|
|
|
|
2019-02-22 11:52:42 +09:00
|
|
|
#include <android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h>
|
2017-03-20 13:57:10 +09:00
|
|
|
#include <hidl/HidlTransportSupport.h>
|
2017-07-06 22:29:12 -07:00
|
|
|
#include <hwminijail/HardwareMinijail.h>
|
2017-03-20 13:57:10 +09:00
|
|
|
|
|
|
|
|
#include "SurfaceFlingerConfigs.h"
|
2017-01-14 19:40:33 +09:00
|
|
|
|
2018-07-20 16:03:46 -07:00
|
|
|
using android::OK;
|
|
|
|
|
using android::sp;
|
|
|
|
|
using android::status_t;
|
2017-01-14 19:40:33 +09:00
|
|
|
using android::hardware::configureRpcThreadpool;
|
|
|
|
|
using android::hardware::joinRpcThreadpool;
|
2017-07-06 22:29:12 -07:00
|
|
|
using android::hardware::SetupMinijail;
|
2019-02-22 11:52:42 +09:00
|
|
|
using android::hardware::configstore::V1_1::ISurfaceFlingerConfigs;
|
|
|
|
|
using android::hardware::configstore::V1_1::implementation::SurfaceFlingerConfigs;
|
2017-03-19 14:38:20 -07:00
|
|
|
|
2017-01-14 19:40:33 +09:00
|
|
|
int main() {
|
|
|
|
|
configureRpcThreadpool(10, true);
|
2017-03-19 14:38:20 -07:00
|
|
|
|
2019-02-22 11:52:42 +09:00
|
|
|
SetupMinijail("/vendor/etc/seccomp_policy/configstore@1.1.policy");
|
2017-07-06 22:29:12 -07:00
|
|
|
|
2017-03-20 13:57:10 +09:00
|
|
|
sp<ISurfaceFlingerConfigs> surfaceFlingerConfigs = new SurfaceFlingerConfigs;
|
|
|
|
|
status_t status = surfaceFlingerConfigs->registerAsService();
|
2017-03-19 14:38:20 -07:00
|
|
|
LOG_ALWAYS_FATAL_IF(status != OK, "Could not register ISurfaceFlingerConfigs");
|
|
|
|
|
|
2017-01-14 19:40:33 +09:00
|
|
|
// other interface registration comes here
|
|
|
|
|
joinRpcThreadpool();
|
|
|
|
|
return 0;
|
|
|
|
|
}
|