xref: /aosp_15_r20/frameworks/proto_logging/stats/enums/telecomm/enums.proto (revision 64c55175f22a2714b5ba1250098ad9bbc12ec7cd)
1/*
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
17syntax = "proto2";
18package android.telecom;
19
20option java_outer_classname = "TelecomProtoEnums";
21option java_multiple_files = true;
22
23/**
24 * Call states, primarily used in CallState.java,
25 * Call.java, and CallsManager.java in packages/services.
26 */
27enum CallStateEnum {
28    /**
29     * Indicates that a call is new and not connected. This is used as the default state internally
30     * within Telecom and should not be used between Telecom and call services. Call services are
31     * not expected to ever interact with NEW calls, but {@link android.telecom.InCallService}s will
32     * see calls in this state.
33     */
34    NEW = 0;
35
36    /**
37     * The initial state of an outgoing {@code Call}.
38     * Common transitions are to {@link #DIALING} state for a successful call or
39     * {@link #DISCONNECTED} if it failed.
40     */
41    CONNECTING = 1;
42
43    /**
44     * The state of an outgoing {@code Call} when waiting on user to select a
45     * {@link android.telecom.PhoneAccount} through which to place the call.
46     */
47    SELECT_PHONE_ACCOUNT = 2;
48
49    /**
50     * Indicates that a call is outgoing and in the dialing state. A call transitions to this state
51     * once an outgoing call has begun (e.g., user presses the dial button in Dialer). Calls in this
52     * state usually transition to {@link #ACTIVE} if the call was answered or {@link #DISCONNECTED}
53     * if the call was disconnected somehow (e.g., failure or cancellation of the call by the user).
54     */
55    DIALING = 3;
56
57    /**
58     * Indicates that a call is incoming and the user still has the option of answering, rejecting,
59     * or doing nothing with the call. This state is usually associated with some type of audible
60     * ringtone. Normal transitions are to {@link #ACTIVE} if answered or {@link #DISCONNECTED}
61     * otherwise.
62     */
63    RINGING = 4;
64
65    /**
66     * Indicates that a call is currently connected to another party and a communication channel is
67     * open between them. The normal transition to this state is by the user answering a
68     * {@link #DIALING} call or a {@link #RINGING} call being answered by the other party.
69     */
70    ACTIVE = 5;
71
72    /**
73     * Indicates that the call is currently on hold. In this state, the call is not terminated
74     * but no communication is allowed until the call is no longer on hold. The typical transition
75     * to this state is by the user putting an {@link #ACTIVE} call on hold by explicitly performing
76     * an action, such as clicking the hold button.
77     */
78    ON_HOLD = 6;
79
80    /**
81     * Indicates that a call is currently disconnected. All states can transition to this state
82     * by the call service giving notice that the connection has been severed. When the user
83     * explicitly ends a call, it will not transition to this state until the call service confirms
84     * the disconnection or communication was lost to the call service currently responsible for
85     * this call (e.g., call service crashes).
86     */
87    DISCONNECTED = 7;
88
89    /**
90     * Indicates that the call was attempted (mostly in the context of outgoing, at least at the
91     * time of writing) but cancelled before it was successfully connected.
92     */
93    ABORTED = 8;
94
95    /**
96     * Indicates that the call is in the process of being disconnected and will transition next
97     * to a {@link #DISCONNECTED} state.
98     * <p>
99     * This state is not expected to be communicated from the Telephony layer, but will be reported
100     * to the InCall UI for calls where disconnection has been initiated by the user but the
101     * ConnectionService has confirmed the call as disconnected.
102     */
103    DISCONNECTING = 9;
104
105    /**
106     * Indicates that the call is in the process of being pulled to the local device.
107     * <p>
108     * This state should only be set on a call with
109     * {@link android.telecom.Connection#PROPERTY_IS_EXTERNAL_CALL} and
110     * {@link android.telecom.Connection#CAPABILITY_CAN_PULL_CALL}.
111     */
112    PULLING = 10;
113
114    /**
115     * Indicates that an incoming call has been answered by the in-call UI, but Telephony hasn't yet
116     * set the call to active.
117     */
118    ANSWERED = 11;
119
120    /**
121     * Indicates that the call is undergoing audio processing by a different app in the background.
122     * @see android.telecom.Call#STATE_AUDIO_PROCESSING
123     */
124    AUDIO_PROCESSING = 12;
125
126    /**
127     * Indicates that the call is in a fake ringing state.
128     * @see android.telecom.Call#STATE_SIMULATED_RINGING
129     */
130    SIMULATED_RINGING = 13;
131}
132
133// Disconnect causes for a call. Primarily used by android/telecom/DisconnectCause.java
134enum DisconnectCauseEnum {
135    /**
136     * Disconnected because of an unknown or unspecified reason.
137     */
138    UNKNOWN = 0;
139
140    /**
141     * Disconnected because there was an error, such as a problem with the network.
142     */
143    ERROR = 1;
144
145    /**
146     * Disconnected because of a local user-initiated action, such as hanging up.
147     */
148    LOCAL = 2;
149
150    /**
151     * Disconnected because of a remote user-initiated action, such as the other party hanging up
152     * up.
153     */
154    REMOTE = 3;
155
156    /**
157     * Disconnected because it has been canceled.
158     */
159    CANCELED = 4;
160
161    /**
162     * Disconnected because there was no response to an incoming call.
163     */
164    MISSED = 5;
165
166    /**
167     * Disconnected because the user rejected an incoming call.
168     */
169    REJECTED = 6;
170
171    /**
172     * Disconnected because the other party was busy.
173     */
174    BUSY = 7;
175
176    /**
177     * Disconnected because of a restriction on placing the call, such as dialing in airplane
178     * mode.
179     */
180    RESTRICTED = 8;
181
182    /**
183     * Disconnected for reason not described by other disconnect codes.
184     */
185    OTHER = 9;
186
187    /**
188     * Disconnected because the connection manager did not support the call. The call will be tried
189     * again without a connection manager. See {@link PhoneAccount#CAPABILITY_CONNECTION_MANAGER}.
190     */
191    CONNECTION_MANAGER_NOT_SUPPORTED = 10;
192
193    /**
194     * Disconnected because the user did not locally answer the incoming call, but it was answered
195     * on another device where the call was ringing.
196     */
197    ANSWERED_ELSEWHERE = 11;
198
199    /**
200     * Disconnected because the call was pulled from the current device to another device.
201     */
202    CALL_PULLED = 12;
203}
204
205/**
206 * Indicating the failure reason why a new call cannot be made.
207 */
208enum CallFailureCauseEnum {
209    /**
210     * The call is normally started.
211     */
212    FAILURE_CAUSE_NONE = 0;
213
214    /**
215     * Necessary parameters are invalid or null.
216     */
217    FAILURE_CAUSE_INVALID_USE = 1;
218
219    /**
220     * There is an emergency call ongoing.
221     */
222    FAILURE_CAUSE_IN_EMERGENCY_CALL = 2;
223
224    /**
225     * There is an live call that cannot be held.
226     */
227    FAILURE_CAUSE_CANNOT_HOLD_CALL = 3;
228
229    /**
230     * There are maximum outgoing calls already.
231     */
232    FAILURE_CAUSE_MAX_OUTGOING_CALLS = 4;
233
234    /**
235     * There are maximum ringing calls already.
236     */
237    FAILURE_CAUSE_MAX_RINGING_CALLS = 5;
238
239    /**
240     * There are maximum calls in hold already.
241     */
242    FAILURE_CAUSE_MAX_HOLD_CALLS = 6;
243
244    /**
245     * There are maximum self-managed calls already.
246     */
247    FAILURE_CAUSE_MAX_SELF_MANAGED_CALLS = 7;
248}
249
250/**
251 * Indicating the call direction
252 */
253enum CallDirectionEnum {
254    DIR_UNKNOWN = 0;
255    DIR_INCOMING = 1;
256    DIR_OUTGOING = 2;
257}
258
259/**
260 * Indicating the account type
261 */
262enum AccountTypeEnum {
263     ACCOUNT_UNKNOWN = 0;
264     ACCOUNT_MANAGED = 1;
265     ACCOUNT_SELFMANAGED = 2;
266     ACCOUNT_SIM = 3;
267     ACCOUNT_VOIP_API = 4;
268}
269
270/**
271 * Indicating the call audio events
272 */
273enum CallAudioEnum {
274    CALL_AUDIO_UNSPECIFIED = 0;
275    CALL_AUDIO_PHONE_SPEAKER = 1;
276    CALL_AUDIO_WATCH_SPEAKER = 2;
277    CALL_AUDIO_BLUETOOTH = 3;
278    CALL_AUDIO_AUTO = 4;
279    CALL_AUDIO_EARPIECE = 5;
280    CALL_AUDIO_WIRED_HEADSET = 6;
281    CALL_AUDIO_HEARING_AID = 7;
282    CALL_AUDIO_BLUETOOTH_LE = 8;
283}
284
285/**
286 * Indicating the API name
287 */
288enum ApiNameEnum {
289    API_UNSPECIFIED = 0;
290    API_ACCEPT_HANDOVER = 1;
291    API_ACCEPT_RINGING_CALL = 2;
292    API_ACCEPT_RINGING_CALL_WITH_VIDEO_STATE = 3;
293    API_ADD_CALL = 4;
294    API_ADD_NEW_INCOMING_CALL = 5;
295    API_ADD_NEW_INCOMING_CONFERENCE = 6;
296    API_ADD_NEW_UNKNOWN_CALL = 7;
297    API_CANCEL_MISSED_CALLS_NOTIFICATION = 8;
298    API_CLEAR_ACCOUNTS = 9;
299    API_CREATE_LAUNCH_EMERGENCY_DIALER_INTENT = 10;
300    API_CREATE_MANAGE_BLOCKED_NUMBERS_INTENT = 11;
301    API_DUMP = 12;
302    API_DUMP_CALL_ANALYTICS = 13;
303    API_ENABLE_PHONE_ACCOUNT = 14;
304    API_END_CALL = 15;
305    API_GET_ADN_URI_FOR_PHONE_ACCOUNT = 16;
306    API_GET_ALL_PHONE_ACCOUNT_HANDLES = 17;
307    API_GET_ALL_PHONE_ACCOUNTS = 18;
308    API_GET_ALL_PHONE_ACCOUNTS_COUNT = 19;
309    API_GET_CALL_CAPABLE_PHONE_ACCOUNTS = 20;
310    API_GET_CALL_STATE = 21;
311    API_GET_CALL_STATE_USING_PACKAGE = 22;
312    API_GET_CURRENT_TTY_MODE = 23;
313    API_GET_DEFAULT_DIALER_PACKAGE = 24;
314    API_GET_DEFAULT_DIALER_PACKAGE_FOR_USER = 25;
315    API_GET_DEFAULT_OUTGOING_PHONE_ACCOUNT = 26;
316    API_GET_DEFAULT_PHONE_APP = 27;
317    API_GET_LINE1_NUMBER = 28;
318    API_GET_OWN_SELF_MANAGED_PHONE_ACCOUNTS = 29;
319    API_GET_PHONE_ACCOUNT = 30;
320    API_GET_PHONE_ACCOUNTS_FOR_PACKAGE = 31;
321    API_GET_PHONE_ACCOUNTS_SUPPORTING_SCHEME = 32;
322    API_GET_REGISTERED_PHONE_ACCOUNTS = 33;
323    API_GET_SELF_MANAGED_PHONE_ACCOUNTS = 34;
324    API_GET_SIM_CALL_MANAGER = 35;
325    API_GET_SIM_CALL_MANAGER_FOR_USER = 36;
326    API_GET_SYSTEM_DIALER_PACKAGE = 37;
327    API_GET_USER_SELECTED_OUTGOING_PHONE_ACCOUNT = 38;
328    API_GET_VOICE_MAIL_NUMBER = 39;
329    API_HANDLE_PIN_MMI = 40;
330    API_HANDLE_PIN_MMI_FOR_PHONE_ACCOUNT = 41;
331    API_HAS_MANAGE_ONGOING_CALLS_PERMISSION = 42;
332    API_IS_IN_CALL = 43;
333    API_IS_IN_EMERGENCY_CALL = 44;
334    API_IS_IN_MANAGED_CALL = 45;
335    API_IS_IN_SELF_MANAGED_CALL = 46;
336    API_IS_INCOMING_CALL_PERMITTED = 47;
337    API_IS_OUTGOING_CALL_PERMITTED = 48;
338    API_IS_RINGING = 49;
339    API_IS_TTY_SUPPORTED = 50;
340    API_IS_VOICE_MAIL_NUMBER = 51;
341    API_PLACE_CALL = 52;
342    API_REGISTER_PHONE_ACCOUNT = 53;
343    API_SET_DEFAULT_DIALER = 54;
344    API_SET_USER_SELECTED_OUTGOING_PHONE_ACCOUNT = 55;
345    API_SHOW_IN_CALL_SCREEN = 56;
346    API_SILENCE_RINGER = 57;
347    API_START_CONFERENCE = 58;
348    API_UNREGISTER_PHONE_ACCOUNT = 59;
349}
350
351/**
352 * Indicating the result of the API call
353 */
354enum ApiResultEnum {
355    RESULT_UNKNOWN = 0;
356    RESULT_SUCCESS = 1;
357    RESULT_PERMISSION = 2;
358    RESULT_EXCEPTION = 3;
359}
360
361/**
362 * Indicating the sub module name
363 */
364enum SubmoduleEnum {
365    SUB_UNKNOWN = 0;
366    SUB_CALL_AUDIO = 1;
367    SUB_CALL_LOGS = 2;
368    SUB_CALL_MANAGER = 3;
369    SUB_CONNECTION_SERVICE = 4;
370    SUB_EMERGENCY_CALL = 5;
371    SUB_IN_CALL_SERVICE = 6;
372    SUB_MISC = 7;
373    SUB_PHONE_ACCOUNT = 8;
374    SUB_SYSTEM_SERVICE = 9;
375    SUB_TELEPHONY = 10;
376    SUB_UI = 11;
377    SUB_VOIP_CALL = 12;
378}
379
380/**
381 * Indicating the error name
382 */
383enum ErrorEnum {
384    ERROR_UNKNOWN = 0;
385    ERROR_EXTERNAL_EXCEPTION = 1;
386    ERROR_INTERNAL_EXCEPTION = 2;
387    ERROR_AUDIO_ROUTE_RETRY_REJECTED = 3;
388    ERROR_BT_GET_SERVICE_FAILURE = 4;
389    ERROR_BT_REGISTER_CALLBACK_FAILURE = 5;
390    ERROR_AUDIO_ROUTE_UNAVAILABLE = 6;
391    ERROR_EMERGENCY_NUMBER_DETERMINED_FAILURE = 7;
392    ERROR_NOTIFY_CALL_STREAM_START_FAILURE = 8;
393    ERROR_NOTIFY_CALL_STREAM_STATE_CHANGED_FAILURE = 9;
394    ERROR_NOTIFY_CALL_STREAM_STOP_FAILURE = 10;
395    ERROR_RTT_STREAM_CLOSE_FAILURE = 11;
396    ERROR_RTT_STREAM_CREATE_FAILURE = 12;
397    ERROR_SET_MUTED_FAILURE = 13;
398    ERROR_VIDEO_PROVIDER_SET_FAILURE = 14;
399    ERROR_WIRED_HEADSET_NOT_AVAILABLE = 15;
400    ERROR_LOG_CALL_FAILURE = 16;
401    ERROR_RETRIEVING_ACCOUNT_EMERGENCY = 17;
402    ERROR_RETRIEVING_ACCOUNT = 18;
403    ERROR_EMERGENCY_CALL_ABORTED_NO_ACCOUNT = 19;
404    ERROR_DEFAULT_MO_ACCOUNT_MISMATCH = 20;
405    ERROR_ESTABLISHING_CONNECTION = 21;
406    ERROR_REMOVING_CALL = 22;
407    ERROR_STUCK_CONNECTING_EMERGENCY = 23;
408    ERROR_STUCK_CONNECTING = 24;
409}
410