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// Disconnect causes for a call. Primarily used by android/telecom/DisconnectCause.java
116enum DisconnectCauseEnum {
117    /**
118     * Disconnected because of an unknown or unspecified reason.
119     */
120    UNKNOWN = 0;
121
122    /**
123     * Disconnected because there was an error, such as a problem with the network.
124     */
125    ERROR = 1;
126
127    /**
128     * Disconnected because of a local user-initiated action, such as hanging up.
129     */
130    LOCAL = 2;
131
132    /**
133     * Disconnected because of a remote user-initiated action, such as the other party hanging up
134     * up.
135     */
136    REMOTE = 3;
137
138    /**
139     * Disconnected because it has been canceled.
140     */
141    CANCELED = 4;
142
143    /**
144     * Disconnected because there was no response to an incoming call.
145     */
146    MISSED = 5;
147
148    /**
149     * Disconnected because the user rejected an incoming call.
150     */
151    REJECTED = 6;
152
153    /**
154     * Disconnected because the other party was busy.
155     */
156    BUSY = 7;
157
158    /**
159     * Disconnected because of a restriction on placing the call, such as dialing in airplane
160     * mode.
161     */
162    RESTRICTED = 8;
163
164    /**
165     * Disconnected for reason not described by other disconnect codes.
166     */
167    OTHER = 9;
168
169    /**
170     * Disconnected because the connection manager did not support the call. The call will be tried
171     * again without a connection manager. See {@link PhoneAccount#CAPABILITY_CONNECTION_MANAGER}.
172     */
173    CONNECTION_MANAGER_NOT_SUPPORTED = 10;
174
175    /**
176     * Disconnected because the user did not locally answer the incoming call, but it was answered
177     * on another device where the call was ringing.
178     */
179    ANSWERED_ELSEWHERE = 11;
180
181    /**
182     * Disconnected because the call was pulled from the current device to another device.
183     */
184    CALL_PULLED = 12;
185}
186