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