blob: 9e1a22cf4434657c17d56556a9b4287e7f11bc73 [file] [log] [blame]
Antoine SOULIERf0d56e82025-02-26 17:35:45 +00001/*
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 SOULIERf0d56e82025-02-26 17:35:45 +000019#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 SOULIER35fef7c2025-02-26 23:01:21 +000026using ::aidl::android::hardware::bluetooth::hal::IBluetoothHci_addService;
Antoine SOULIERf0d56e82025-02-26 17:35:45 +000027using ::aidl::android::hardware::bluetooth::impl::BluetoothHci;
28using ::android::hardware::configureRpcThreadpool;
29using ::android::hardware::joinRpcThreadpool;
30
31int 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 SOULIER35fef7c2025-02-26 23:01:21 +000038 IBluetoothHci_addService(new BluetoothHci());
39 ABinderProcess_joinThreadPool();
Antoine SOULIERf0d56e82025-02-26 17:35:45 +000040 return 0;
41}