blob: 2140d7c6f414bda33e66219080b84a724b0e23aa [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 /**
Mikhail Naganov8878f572018-02-12 15:55:49 -080040 * Sets the name of the current BT SCO headset. Calling this method
41 * is equivalent to setting legacy "bt_headset_name" parameter.
42 * The BT SCO headset name must only be used for debugging purposes.
43 * Optional method
44 *
45 * @param name the name of the current BT SCO headset (can be empty).
46 * @return retval operation completion status.
47 */
48 setBtScoHeadsetDebugName(string name) generates (Result retval);
49
50 /**
Kevin Rocarda4e6d8b2018-01-20 21:52:01 -080051 * Gets whether BT SCO Noise Reduction and Echo Cancellation are enabled.
52 * Calling this method is equivalent to getting AUDIO_PARAMETER_KEY_BT_NREC
53 * on the legacy HAL.
54 *
55 * @return retval operation completion status.
56 * @return enabled whether BT SCO NR + EC are enabled.
57 */
58 getBtScoNrecEnabled() generates (Result retval, bool enabled);
59
60 /**
61 * Sets whether BT SCO Noise Reduction and Echo Cancellation are enabled.
62 * Calling this method is equivalent to setting AUDIO_PARAMETER_KEY_BT_NREC
63 * on the legacy HAL.
Kevin Rocard74980b52018-01-20 22:12:57 -080064 * Optional method
Kevin Rocarda4e6d8b2018-01-20 21:52:01 -080065 *
66 * @param enabled whether BT SCO NR + EC are enabled.
67 * @return retval operation completion status.
68 */
69 setBtScoNrecEnabled(bool enabled) generates (Result retval);
70
71 /**
72 * Gets whether BT SCO Wideband mode is enabled. Calling this method is
73 * equivalent to getting AUDIO_PARAMETER_KEY_BT_SCO_WB on the legacy HAL.
74 *
75 * @return retval operation completion status.
76 * @return enabled whether BT Wideband is enabled.
77 */
78 getBtScoWidebandEnabled() generates (Result retval, bool enabled);
79
80 /**
81 * Sets whether BT SCO Wideband mode is enabled. Calling this method is
82 * equivalent to setting AUDIO_PARAMETER_KEY_BT_SCO_WB on the legacy HAL.
Kevin Rocard74980b52018-01-20 22:12:57 -080083 * Optional method
Kevin Rocarda4e6d8b2018-01-20 21:52:01 -080084 *
85 * @param enabled whether BT Wideband is enabled.
86 * @return retval operation completion status.
87 */
88 setBtScoWidebandEnabled(bool enabled) generates (Result retval);
89
90 enum TtyMode : int32_t {
91 OFF,
92 VCO,
93 HCO,
94 FULL
95 };
96
97 /**
98 * Gets current TTY mode selection. Calling this method is equivalent to
99 * getting AUDIO_PARAMETER_KEY_TTY_MODE on the legacy HAL.
100 *
101 * @return retval operation completion status.
102 * @return mode TTY mode.
103 */
104 getTtyMode() generates (Result retval, TtyMode mode);
105
106 /**
107 * Sets current TTY mode. Calling this method is equivalent to setting
108 * AUDIO_PARAMETER_KEY_TTY_MODE on the legacy HAL.
109 *
110 * @param mode TTY mode.
111 * @return retval operation completion status.
112 */
113 setTtyMode(TtyMode mode) generates (Result retval);
114
115 /**
116 * Gets whether Hearing Aid Compatibility - Telecoil (HAC-T) mode is
117 * enabled. Calling this method is equivalent to getting
118 * AUDIO_PARAMETER_KEY_HAC on the legacy HAL.
119 *
120 * @return retval operation completion status.
121 * @return enabled whether HAC mode is enabled.
122 */
123 getHacEnabled() generates (Result retval, bool enabled);
124
125 /**
126 * Sets whether Hearing Aid Compatibility - Telecoil (HAC-T) mode is
127 * enabled. Calling this method is equivalent to setting
128 * AUDIO_PARAMETER_KEY_HAC on the legacy HAL.
Kevin Rocard74980b52018-01-20 22:12:57 -0800129 * Optional method
Kevin Rocarda4e6d8b2018-01-20 21:52:01 -0800130 *
131 * @param enabled whether HAC mode is enabled.
132 * @return retval operation completion status.
133 */
134 setHacEnabled(bool enabled) generates (Result retval);
Mikhail Naganov124fac02018-02-12 16:01:07 -0800135
136 enum Rotation : int32_t {
137 DEG_0,
138 DEG_90,
139 DEG_180,
140 DEG_270
141 };
142
143 /**
144 * Updates HAL on the current rotation of the device relative to natural
145 * orientation. Calling this method is equivalent to setting legacy
146 * parameter "rotation".
147 *
148 * @param rotation rotation in degrees relative to natural device
149 * orientation.
150 * @return retval operation completion status.
151 */
152 updateRotation(Rotation rotation) generates (Result retval);
Kevin Rocarda4e6d8b2018-01-20 21:52:01 -0800153};