Antoine SOULIER | f0d56e8 | 2025-02-26 17:35:45 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2022 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 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 | |
| 17 | #define LOG_TAG "aidl.android.hardware.bluetooth.service.default" |
| 18 | |
Antoine SOULIER | f0d56e8 | 2025-02-26 17:35:45 +0000 | [diff] [blame] | 19 | #include <android/binder_manager.h> |
| 20 | #include <android/binder_process.h> |
| 21 | #include <hidl/HidlSupport.h> |
| 22 | #include <hidl/HidlTransportSupport.h> |
| 23 | |
| 24 | #include "BluetoothHci.h" |
| 25 | |
Antoine SOULIER | 35fef7c | 2025-02-26 23:01:21 +0000 | [diff] [blame] | 26 | using ::aidl::android::hardware::bluetooth::hal::IBluetoothHci_addService; |
Antoine SOULIER | f0d56e8 | 2025-02-26 17:35:45 +0000 | [diff] [blame] | 27 | using ::aidl::android::hardware::bluetooth::impl::BluetoothHci; |
| 28 | using ::android::hardware::configureRpcThreadpool; |
| 29 | using ::android::hardware::joinRpcThreadpool; |
| 30 | |
| 31 | int main(int /* argc */, char** /* argv */) { |
| 32 | ALOGI("Bluetooth HAL starting"); |
| 33 | if (!ABinderProcess_setThreadPoolMaxThreadCount(0)) { |
| 34 | ALOGI("failed to set thread pool max thread count"); |
| 35 | return 1; |
| 36 | } |
| 37 | |
Antoine SOULIER | 35fef7c | 2025-02-26 23:01:21 +0000 | [diff] [blame] | 38 | IBluetoothHci_addService(new BluetoothHci()); |
| 39 | ABinderProcess_joinThreadPool(); |
Antoine SOULIER | f0d56e8 | 2025-02-26 17:35:45 +0000 | [diff] [blame] | 40 | return 0; |
| 41 | } |