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 26 IBluetoothAudioOffload* HIDL_FETCH_IBluetoothAudioOffload(const char* /* name */) { 27 return new BluetoothAudioOffload(); 28 } 29 30 // Methods from ::android::hardware::bluetooth::a2dp::V1_0::IBluetoothAudioOffload follow. 31 Return<::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 43 Return<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 52 Return<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 61 Return<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 75