diff options
author | Santos Cordon <santoscordon@google.com> | 2014-01-29 14:10:10 -0800 |
---|---|---|
committer | Evan Charlton <evanc@google.com> | 2014-02-20 15:12:55 -0800 |
commit | 3d3735e3d307c309f778d4976fc7316c785c1789 (patch) | |
tree | 1361f315c3c0b7dbc70e4ae2a0b98d606f97fb79 /telecomm | |
parent | 805afaaf23afef78b9053dad432378142eba8c12 (diff) | |
download | frameworks_base-3d3735e3d307c309f778d4976fc7316c785c1789.zip frameworks_base-3d3735e3d307c309f778d4976fc7316c785c1789.tar.gz frameworks_base-3d3735e3d307c309f778d4976fc7316c785c1789.tar.bz2 |
Adding call state constants to Telecomm.
Change-Id: I40675477a96c9a74a17782870c5824702466e6cc
Diffstat (limited to 'telecomm')
-rw-r--r-- | telecomm/java/android/telecomm/CallState.java | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/telecomm/java/android/telecomm/CallState.java b/telecomm/java/android/telecomm/CallState.java new file mode 100644 index 0000000..5216c85 --- /dev/null +++ b/telecomm/java/android/telecomm/CallState.java @@ -0,0 +1,64 @@ +/* + * Copyright 2014, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.telecomm; + +/** + * Defines call-state constants of the different states in which a call can exist. Although states + * have the notion of normal transitions, due to the volatile nature of telephony systems, code + * that uses these states should be resilient to unexpected state changes outside of what is + * considered traditional. + */ +public final class CallState { + /** + * Indicates that a call is new and not connected. This is used as the default state internally + * within Telecomm and should not be used between Telecomm and call services. + * @hide + */ + static final int NEW = 1; + + /** + * Indicates that a call is outgoing and in the dialing state. A call transitions to this state + * once an outgoing call has begun (e.g., user presses the dial button in Dialer). Calls in this + * state usually transition to {@link #ACTIVE} if the call was answered or {@link #DISCONNECTED} + * if the call was disconnected somehow (e.g., failure or cancellation of the call by the user). + */ + static final int DIALING = 2; + + /** + * Indicates that a call is incoming and the user still has the option of answering, rejecting, + * or doing nothing with the call. This state is usually associated with some type of audible + * ringtone. Normal transitions are to {@link #ACTIVE} if answered or {@link #DISCONNECTED} + * otherwise. + */ + static final int RINGING = 3; + + /** + * Indicates that a call is currently connected to another party and a communication channel is + * open between them. The normal transition to this state is by the user answering a + * {@link #DIALING} call or a {@link #RINGING} call being answered by the other party. + */ + static final int ACTIVE = 4; + + /** + * Indicates that a call is currently disconnected. All states can transition to this state + * by the call service giving notice that the connection has been severed. When the user + * explicitly ends a call, it will not transition to this state until the call service confirms + * the disconnection or communication was lost to the call service currently responsible for + * this call (e.g., call service crashes). + */ + static final int DISCONNECTED = 5; +} |