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