1 /*
2 * Copyright (C) 2018 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 "BluetoothAudioOffload.h"
18
19 namespace android {
20 namespace hardware {
21 namespace bluetooth {
22 namespace a2dp {
23 namespace V1_0 {
24 namespace implementation {
25
HIDL_FETCH_IBluetoothAudioOffload(const char *)26 IBluetoothAudioOffload* HIDL_FETCH_IBluetoothAudioOffload(
27 const char* /* name */) {
28 return new BluetoothAudioOffload();
29 }
30
31 // Methods from
32 // ::android::hardware::bluetooth::a2dp::V1_0::IBluetoothAudioOffload follow.
33 Return<::android::hardware::bluetooth::a2dp::V1_0::Status>
startSession(const sp<::android::hardware::bluetooth::a2dp::V1_0::IBluetoothAudioHost> & hostIf __unused,const::android::hardware::bluetooth::a2dp::V1_0::CodecConfiguration & codecConfig __unused)34 BluetoothAudioOffload::startSession(
35 const sp<::android::hardware::bluetooth::a2dp::V1_0::IBluetoothAudioHost>&
36 hostIf __unused,
37 const ::android::hardware::bluetooth::a2dp::V1_0::CodecConfiguration&
38 codecConfig __unused) {
39 /**
40 * Initialize the audio platform if codecConfiguration is supported.
41 * Save the the IBluetoothAudioHost interface, so that it can be used
42 * later to send stream control commands to the HAL client, based on
43 * interaction with Audio framework.
44 */
45 return ::android::hardware::bluetooth::a2dp::V1_0::Status::FAILURE;
46 }
47
streamStarted(::android::hardware::bluetooth::a2dp::V1_0::Status status __unused)48 Return<void> BluetoothAudioOffload::streamStarted(
49 ::android::hardware::bluetooth::a2dp::V1_0::Status status __unused) {
50 /**
51 * Streaming on control path has started,
52 * HAL server should start the streaming on data path.
53 */
54 return Void();
55 }
56
streamSuspended(::android::hardware::bluetooth::a2dp::V1_0::Status status __unused)57 Return<void> BluetoothAudioOffload::streamSuspended(
58 ::android::hardware::bluetooth::a2dp::V1_0::Status status __unused) {
59 /**
60 * Streaming on control path has suspend,
61 * HAL server should suspend the streaming on data path.
62 */
63 return Void();
64 }
65
endSession()66 Return<void> BluetoothAudioOffload::endSession() {
67 /**
68 * Cleanup the audio platform as remote A2DP Sink device is no
69 * longer active
70 */
71 return Void();
72 }
73
74 } // namespace implementation
75 } // namespace V1_0
76 } // namespace a2dp
77 } // namespace bluetooth
78 } // namespace hardware
79 } // namespace android
80