Willi Ye | daf0b73 | 2019-10-22 22:48:05 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 The Android Open Source Project |
| 3 | * Copyright (C) 2019, The LineageOS Project |
| 4 | * |
| 5 | * Licensed under the Apache License, Version 2.1 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.1 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
| 17 | #define LOG_TAG "android.hardware.radio@1.3-radio-service.samsung" |
| 18 | |
| 19 | #include <android/hardware/radio/1.3/IRadio.h> |
| 20 | #include <hidl/HidlTransportSupport.h> |
| 21 | |
| 22 | #include "Radio.h" |
| 23 | |
| 24 | using android::OK; |
| 25 | using android::sp; |
| 26 | using android::status_t; |
| 27 | using android::hardware::configureRpcThreadpool; |
| 28 | using android::hardware::joinRpcThreadpool; |
| 29 | using android::hardware::radio::V1_3::IRadio; |
| 30 | using android::hardware::radio::V1_3::implementation::Radio; |
| 31 | |
| 32 | int main() { |
| 33 | configureRpcThreadpool(1, true); |
| 34 | |
| 35 | sp<IRadio> radio = new Radio(RIL1_SERVICE_NAME); |
| 36 | status_t status = radio->registerAsService(RIL1_SERVICE_NAME); |
| 37 | ALOGW_IF(status != OK, "Could not register IRadio v1.3 %s", RIL1_SERVICE_NAME); |
| 38 | radio = new Radio(RIL2_SERVICE_NAME); |
| 39 | status = radio->registerAsService(RIL2_SERVICE_NAME); |
| 40 | ALOGW_IF(status != OK, "Could not register IRadio v1.3 %s", RIL2_SERVICE_NAME); |
| 41 | ALOGD("Default service is ready."); |
| 42 | |
| 43 | joinRpcThreadpool(); |
| 44 | return 1; |
| 45 | } |