blob: c552c6ddd2b255230eb66d00a71e10b9c87911de [file] [log] [blame]
Kevin Rocarda4e6d8b2018-01-20 21:52: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
17package android.hardware.audio@4.0;
18
19import android.hardware.audio.common@4.0;
20import IDevice;
21
22interface IDevicesFactory {
Kevin Rocard8b010d22018-01-23 15:25:19 -080023 /** Allows a HAL implementation to be split in multiple independent
24 * devices (called module in the pre-treble API).
25 * Note that this division is arbitrary and implementation are free
26 * to only have a Primary.
27 * The framework will query the devices according to audio_policy_configuration.xml
28 *
29 * Each Device value is interchangeable with any other and the framework
30 * does not differentiate between values with the following exceptions:
31 * - the Primary device must always be present
32 * - the R_SUBMIX that is used to forward audio of REMOTE_SUBMIX DEVICES
33 */
Kevin Rocarda4e6d8b2018-01-20 21:52:01 -080034 enum Device : int32_t {
35 PRIMARY,
36 A2DP,
37 USB,
38 R_SUBMIX,
Kevin Rocard8b010d22018-01-23 15:25:19 -080039 STUB,
40 CODEC_OFFLOAD,
41 SECONDARY,
Dean Wheatleyfd64afb2018-01-23 18:04:19 -080042 AUXILIARY,
43 /** Multi Stream Decoder */
44 MSD
Kevin Rocarda4e6d8b2018-01-20 21:52:01 -080045 };
46
47 /**
48 * Opens an audio device. To close the device, it is necessary to release
49 * references to the returned device object.
50 *
51 * @param device device type.
52 * @return retval operation completion status. Returns INVALID_ARGUMENTS
53 * if there is no corresponding hardware module found,
54 * NOT_INITIALIZED if an error occured while opening the hardware
55 * module.
56 * @return result the interface for the created device.
57 */
58 openDevice(Device device) generates (Result retval, IDevice result);
59};