blob: 9abb88d519a2e0478e902f7172cb4bf530548c0a [file] [log] [blame]
Sunny Kapdi9526c2f2018-02-07 15:08:01 -08001/*
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
19namespace android {
20namespace hardware {
21namespace bluetooth {
22namespace a2dp {
23namespace V1_0 {
24namespace implementation {
25
Jack Hecaeab052018-10-23 18:13:51 -070026IBluetoothAudioOffload* HIDL_FETCH_IBluetoothAudioOffload(
27 const char* /* name */) {
28 return new BluetoothAudioOffload();
Sunny Kapdi9526c2f2018-02-07 15:08:01 -080029}
30
Jack Hecaeab052018-10-23 18:13:51 -070031// Methods from
32// ::android::hardware::bluetooth::a2dp::V1_0::IBluetoothAudioOffload follow.
33Return<::android::hardware::bluetooth::a2dp::V1_0::Status>
34BluetoothAudioOffload::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;
Sunny Kapdi9526c2f2018-02-07 15:08:01 -080046}
47
48Return<void> BluetoothAudioOffload::streamStarted(
49 ::android::hardware::bluetooth::a2dp::V1_0::Status status __unused) {
Jack Hecaeab052018-10-23 18:13:51 -070050 /**
51 * Streaming on control path has started,
52 * HAL server should start the streaming on data path.
53 */
54 return Void();
Sunny Kapdi9526c2f2018-02-07 15:08:01 -080055}
56
57Return<void> BluetoothAudioOffload::streamSuspended(
58 ::android::hardware::bluetooth::a2dp::V1_0::Status status __unused) {
Jack Hecaeab052018-10-23 18:13:51 -070059 /**
60 * Streaming on control path has suspend,
61 * HAL server should suspend the streaming on data path.
62 */
63 return Void();
Sunny Kapdi9526c2f2018-02-07 15:08:01 -080064}
65
66Return<void> BluetoothAudioOffload::endSession() {
Jack Hecaeab052018-10-23 18:13:51 -070067 /**
68 * Cleanup the audio platform as remote A2DP Sink device is no
69 * longer active
70 */
71 return Void();
Sunny Kapdi9526c2f2018-02-07 15:08:01 -080072}
73
74} // namespace implementation
75} // namespace V1_0
76} // namespace a2dp
77} // namespace bluetooth
78} // namespace hardware
79} // namespace android