blob: 7fb5b6cb522b079e045e83a0960307376152d92d [file] [log] [blame]
Alice Kuo965138a2021-10-19 17:07:45 +08001/*
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
17package android.hardware.bluetooth.audio@2.2;
18
Alice Kuo95ba6a22021-11-04 19:28:10 +080019import IBluetoothAudioProvider;
Alice Kuo965138a2021-10-19 17:07:45 +080020import @2.1::IBluetoothAudioProvidersFactory;
Alice Kuo95ba6a22021-11-04 19:28:10 +080021import @2.0::Status;
22import @2.1::SessionType;
Alice Kuo965138a2021-10-19 17:07:45 +080023
24/**
25 * This factory allows a HAL implementation to be split into multiple
26 * independent providers.
27 *
28 * When the Bluetooth stack is ready to create an audio session, it must first
29 * obtain the IBluetoothAudioProvider for that session type by calling
30 * openProvider().
31 *
32 * Note: For HIDL APIs with a "generates" statement, the callback parameter used
33 * for return value must be invoked synchronously before the API call returns.
34 */
35interface IBluetoothAudioProvidersFactory extends @2.1::IBluetoothAudioProvidersFactory {
Alice Kuo95ba6a22021-11-04 19:28:10 +080036 /**
37 * Opens an audio provider for a session type. To close the provider, it is
38 * necessary to release references to the returned provider object.
39 *
40 * @param sessionType The session type (e.g.
41 * LE_AUDIO_SOFTWARE_ENCODING_DATAPATH).
42 *
43 * @return status One of the following
44 * SUCCESS if the Audio HAL successfully opens the provider with the
45 * given session type
46 * FAILURE if the Audio HAL cannot open the provider
47 * @return provider The provider of the specified session type
48 */
49 openProvider_2_2(SessionType sessionType)
50 generates (Status status, IBluetoothAudioProvider provider);
Alice Kuo965138a2021-10-19 17:07:45 +080051};