Jiyong Park | c5d7c8a | 2017-01-14 19:40:33 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 The Android Open Source Project |
| 3 | * |
Jaesoo Lee | 812e85e | 2017-04-28 18:29:40 +0900 | [diff] [blame] | 4 | * Licensed under the Apache License, Version 2.1 (the "License"); |
Jiyong Park | c5d7c8a | 2017-01-14 19:40:33 +0900 | [diff] [blame] | 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
Jaesoo Lee | 812e85e | 2017-04-28 18:29:40 +0900 | [diff] [blame] | 8 | * http://www.apache.org/licenses/LICENSE-2.1 |
Jiyong Park | c5d7c8a | 2017-01-14 19:40:33 +0900 | [diff] [blame] | 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 | |
Jaesoo Lee | 812e85e | 2017-04-28 18:29:40 +0900 | [diff] [blame] | 17 | #define LOG_TAG "android.hardware.configstore@1.1-service" |
Jiyong Park | c5d7c8a | 2017-01-14 19:40:33 +0900 | [diff] [blame] | 18 | |
Jaesoo Lee | 812e85e | 2017-04-28 18:29:40 +0900 | [diff] [blame] | 19 | #include <android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h> |
Jaesoo Lee | 2d66f61 | 2017-03-20 13:57:10 +0900 | [diff] [blame] | 20 | #include <hidl/HidlTransportSupport.h> |
Jiyong Park | c5d7c8a | 2017-01-14 19:40:33 +0900 | [diff] [blame] | 21 | |
Jaesoo Lee | 2d66f61 | 2017-03-20 13:57:10 +0900 | [diff] [blame] | 22 | #include "SurfaceFlingerConfigs.h" |
| 23 | |
Jiyong Park | c5d7c8a | 2017-01-14 19:40:33 +0900 | [diff] [blame] | 24 | using android::hardware::configureRpcThreadpool; |
Jiyong Park | c5d7c8a | 2017-01-14 19:40:33 +0900 | [diff] [blame] | 25 | using android::hardware::joinRpcThreadpool; |
Jaesoo Lee | 812e85e | 2017-04-28 18:29:40 +0900 | [diff] [blame] | 26 | using android::hardware::configstore::V1_1::ISurfaceFlingerConfigs; |
| 27 | using android::hardware::configstore::V1_1::implementation::SurfaceFlingerConfigs; |
Jaesoo Lee | 2d66f61 | 2017-03-20 13:57:10 +0900 | [diff] [blame] | 28 | using android::sp; |
Steven Moreland | f88a9fe | 2017-03-19 14:38:20 -0700 | [diff] [blame] | 29 | using android::status_t; |
| 30 | using android::OK; |
| 31 | |
Jiyong Park | c5d7c8a | 2017-01-14 19:40:33 +0900 | [diff] [blame] | 32 | int main() { |
| 33 | // TODO(b/34857894): tune the max thread count. |
| 34 | configureRpcThreadpool(10, true); |
Steven Moreland | f88a9fe | 2017-03-19 14:38:20 -0700 | [diff] [blame] | 35 | |
Jaesoo Lee | 2d66f61 | 2017-03-20 13:57:10 +0900 | [diff] [blame] | 36 | sp<ISurfaceFlingerConfigs> surfaceFlingerConfigs = new SurfaceFlingerConfigs; |
| 37 | status_t status = surfaceFlingerConfigs->registerAsService(); |
Steven Moreland | f88a9fe | 2017-03-19 14:38:20 -0700 | [diff] [blame] | 38 | LOG_ALWAYS_FATAL_IF(status != OK, "Could not register ISurfaceFlingerConfigs"); |
| 39 | |
Jiyong Park | c5d7c8a | 2017-01-14 19:40:33 +0900 | [diff] [blame] | 40 | // other interface registration comes here |
| 41 | joinRpcThreadpool(); |
| 42 | return 0; |
| 43 | } |