1 /*
2 * Copyright 2021 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 #include "hal_version_manager.h"
18
19 namespace bluetooth {
20 namespace audio {
21
22 const BluetoothAudioHalVersion BluetoothAudioHalVersion::VERSION_UNAVAILABLE =
23 BluetoothAudioHalVersion();
24 const BluetoothAudioHalVersion BluetoothAudioHalVersion::VERSION_2_0 =
25 BluetoothAudioHalVersion(BluetoothAudioHalTransport::HIDL, 2, 0);
26 const BluetoothAudioHalVersion BluetoothAudioHalVersion::VERSION_2_1 =
27 BluetoothAudioHalVersion(BluetoothAudioHalTransport::HIDL, 2, 1);
28 const BluetoothAudioHalVersion BluetoothAudioHalVersion::VERSION_AIDL_V1 =
29 BluetoothAudioHalVersion(BluetoothAudioHalTransport::AIDL, 1, 0);
30 const BluetoothAudioHalVersion BluetoothAudioHalVersion::VERSION_AIDL_V2 =
31 BluetoothAudioHalVersion(BluetoothAudioHalTransport::AIDL, 2, 0);
32 const BluetoothAudioHalVersion BluetoothAudioHalVersion::VERSION_AIDL_V3 =
33 BluetoothAudioHalVersion(BluetoothAudioHalTransport::AIDL, 3, 0);
34 const BluetoothAudioHalVersion BluetoothAudioHalVersion::VERSION_AIDL_V4 =
35 BluetoothAudioHalVersion(BluetoothAudioHalTransport::AIDL, 4, 0);
36
37 std::unique_ptr<HalVersionManager> HalVersionManager::instance_ptr = nullptr;
38
GetHalVersion()39 BluetoothAudioHalVersion HalVersionManager::GetHalVersion() {
40 return BluetoothAudioHalVersion::VERSION_UNAVAILABLE;
41 }
42
GetHalTransport()43 BluetoothAudioHalTransport HalVersionManager::GetHalTransport() {
44 return BluetoothAudioHalTransport::UNKNOWN;
45 }
46
47 android::sp<IBluetoothAudioProvidersFactory_2_1>
GetProvidersFactory_2_1()48 HalVersionManager::GetProvidersFactory_2_1() {
49 return nullptr;
50 }
51
52 android::sp<IBluetoothAudioProvidersFactory_2_0>
GetProvidersFactory_2_0()53 HalVersionManager::GetProvidersFactory_2_0() {
54 return nullptr;
55 }
56
HalVersionManager()57 HalVersionManager::HalVersionManager() {
58 hal_version_ = BluetoothAudioHalVersion::VERSION_UNAVAILABLE;
59 hal_transport_ = BluetoothAudioHalTransport::UNKNOWN;
60 }
61
62 } // namespace audio
63 } // namespace bluetooth
64