blob: f3d904cdcbe02b4635d773adbb23c0505a38abcb [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 IPrimaryDevice extends IDevice {
Kevin Rocarda4e6d8b2018-01-20 21:52:01 -080023 /**
24 * Sets the audio volume of a voice call.
25 *
26 * @param volume 1.0f means unity, 0.0f is zero.
27 * @return retval operation completion status.
28 */
29 setVoiceVolume(float volume) generates (Result retval);
30
31 /**
32 * This method is used to notify the HAL about audio mode changes.
33 *
34 * @param mode new mode.
35 * @return retval operation completion status.
36 */
37 setMode(AudioMode mode) generates (Result retval);
38
39 /**
40 * Gets whether BT SCO Noise Reduction and Echo Cancellation are enabled.
41 * Calling this method is equivalent to getting AUDIO_PARAMETER_KEY_BT_NREC
42 * on the legacy HAL.
43 *
44 * @return retval operation completion status.
45 * @return enabled whether BT SCO NR + EC are enabled.
46 */
47 getBtScoNrecEnabled() generates (Result retval, bool enabled);
48
49 /**
50 * Sets whether BT SCO Noise Reduction and Echo Cancellation are enabled.
51 * Calling this method is equivalent to setting AUDIO_PARAMETER_KEY_BT_NREC
52 * on the legacy HAL.
Kevin Rocard74980b52018-01-20 22:12:57 -080053 * Optional method
Kevin Rocarda4e6d8b2018-01-20 21:52:01 -080054 *
55 * @param enabled whether BT SCO NR + EC are enabled.
56 * @return retval operation completion status.
57 */
58 setBtScoNrecEnabled(bool enabled) generates (Result retval);
59
60 /**
61 * Gets whether BT SCO Wideband mode is enabled. Calling this method is
62 * equivalent to getting AUDIO_PARAMETER_KEY_BT_SCO_WB on the legacy HAL.
63 *
64 * @return retval operation completion status.
65 * @return enabled whether BT Wideband is enabled.
66 */
67 getBtScoWidebandEnabled() generates (Result retval, bool enabled);
68
69 /**
70 * Sets whether BT SCO Wideband mode is enabled. Calling this method is
71 * equivalent to setting AUDIO_PARAMETER_KEY_BT_SCO_WB on the legacy HAL.
Kevin Rocard74980b52018-01-20 22:12:57 -080072 * Optional method
Kevin Rocarda4e6d8b2018-01-20 21:52:01 -080073 *
74 * @param enabled whether BT Wideband is enabled.
75 * @return retval operation completion status.
76 */
77 setBtScoWidebandEnabled(bool enabled) generates (Result retval);
78
79 enum TtyMode : int32_t {
80 OFF,
81 VCO,
82 HCO,
83 FULL
84 };
85
86 /**
87 * Gets current TTY mode selection. Calling this method is equivalent to
88 * getting AUDIO_PARAMETER_KEY_TTY_MODE on the legacy HAL.
89 *
90 * @return retval operation completion status.
91 * @return mode TTY mode.
92 */
93 getTtyMode() generates (Result retval, TtyMode mode);
94
95 /**
96 * Sets current TTY mode. Calling this method is equivalent to setting
97 * AUDIO_PARAMETER_KEY_TTY_MODE on the legacy HAL.
98 *
99 * @param mode TTY mode.
100 * @return retval operation completion status.
101 */
102 setTtyMode(TtyMode mode) generates (Result retval);
103
104 /**
105 * Gets whether Hearing Aid Compatibility - Telecoil (HAC-T) mode is
106 * enabled. Calling this method is equivalent to getting
107 * AUDIO_PARAMETER_KEY_HAC on the legacy HAL.
108 *
109 * @return retval operation completion status.
110 * @return enabled whether HAC mode is enabled.
111 */
112 getHacEnabled() generates (Result retval, bool enabled);
113
114 /**
115 * Sets whether Hearing Aid Compatibility - Telecoil (HAC-T) mode is
116 * enabled. Calling this method is equivalent to setting
117 * AUDIO_PARAMETER_KEY_HAC on the legacy HAL.
Kevin Rocard74980b52018-01-20 22:12:57 -0800118 * Optional method
Kevin Rocarda4e6d8b2018-01-20 21:52:01 -0800119 *
120 * @param enabled whether HAC mode is enabled.
121 * @return retval operation completion status.
122 */
123 setHacEnabled(bool enabled) generates (Result retval);
124};