summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunny Kapdi2018-02-07 17:08:01 -0600
committerPavlin Radoslavov2018-03-12 15:41:04 -0500
commit9526c2ff73ab62f62ace44d2418453e57b3feb61 (patch)
treeda7e27c120021cd17226496358130acc3edc00bd /bluetooth/a2dp/1.0/default/BluetoothAudioOffload.cpp
parent4cd374a6c4b19125da85253c65990daa6ef5683b (diff)
downloadplatform-hardware-interfaces-9526c2ff73ab62f62ace44d2418453e57b3feb61.tar.gz
platform-hardware-interfaces-9526c2ff73ab62f62ace44d2418453e57b3feb61.tar.xz
platform-hardware-interfaces-9526c2ff73ab62f62ace44d2418453e57b3feb61.zip
Bluetooth: A2DP offload HIDL
Interface for Bluetooth A2DP offload feature. Bug: 72242910 Test: Manual; TestTracker/148125 Change-Id: I3649800dfe3e1a2d66b76859be87e01ee58d2de0 (cherry picked from commit 4e95d81ef048bfdc33cee7cf8bdbe66603b30f96)
Diffstat (limited to 'bluetooth/a2dp/1.0/default/BluetoothAudioOffload.cpp')
-rw-r--r--bluetooth/a2dp/1.0/default/BluetoothAudioOffload.cpp74
1 files changed, 74 insertions, 0 deletions
diff --git a/bluetooth/a2dp/1.0/default/BluetoothAudioOffload.cpp b/bluetooth/a2dp/1.0/default/BluetoothAudioOffload.cpp
new file mode 100644
index 00000000..2a66abe6
--- /dev/null
+++ b/bluetooth/a2dp/1.0/default/BluetoothAudioOffload.cpp
@@ -0,0 +1,74 @@
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
19namespace android {
20namespace hardware {
21namespace bluetooth {
22namespace a2dp {
23namespace V1_0 {
24namespace implementation {
25
26IBluetoothAudioOffload* HIDL_FETCH_IBluetoothAudioOffload(const char* /* name */) {
27 return new BluetoothAudioOffload();
28}
29
30// Methods from ::android::hardware::bluetooth::a2dp::V1_0::IBluetoothAudioOffload follow.
31Return<::android::hardware::bluetooth::a2dp::V1_0::Status> BluetoothAudioOffload::startSession(
32 const sp<::android::hardware::bluetooth::a2dp::V1_0::IBluetoothAudioHost>& hostIf __unused,
33 const ::android::hardware::bluetooth::a2dp::V1_0::CodecConfiguration& codecConfig __unused) {
34 /**
35 * Initialize the audio platform if codecConfiguration is supported.
36 * Save the the IBluetoothAudioHost interface, so that it can be used
37 * later to send stream control commands to the HAL client, based on
38 * interaction with Audio framework.
39 */
40 return ::android::hardware::bluetooth::a2dp::V1_0::Status::FAILURE;
41}
42
43Return<void> BluetoothAudioOffload::streamStarted(
44 ::android::hardware::bluetooth::a2dp::V1_0::Status status __unused) {
45 /**
46 * Streaming on control path has started,
47 * HAL server should start the streaming on data path.
48 */
49 return Void();
50}
51
52Return<void> BluetoothAudioOffload::streamSuspended(
53 ::android::hardware::bluetooth::a2dp::V1_0::Status status __unused) {
54 /**
55 * Streaming on control path has suspend,
56 * HAL server should suspend the streaming on data path.
57 */
58 return Void();
59}
60
61Return<void> BluetoothAudioOffload::endSession() {
62 /**
63 * Cleanup the audio platform as remote A2DP Sink device is no
64 * longer active
65 */
66 return Void();
67}
68
69} // namespace implementation
70} // namespace V1_0
71} // namespace a2dp
72} // namespace bluetooth
73} // namespace hardware
74} // namespace android