Home | History | Annotate | Download | only in telecom
      1 /*
      2  * Copyright (C) 2016 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 
     17 /**
     18  * The Android Telecom framework is responsible for managing calls on an Android device.  This can
     19  * include SIM-based calls using the {@code Telephony} framework, VOIP calls using SIP (e.g. the
     20  * {@code SipConnectionService}), or via a third-party VOIP
     21  * {@link android.telecom.ConnectionService}.  Telecom acts as a switchboard, routing calls and
     22  * audio focus between {@link android.telecom.Connection}s provided by
     23  * {@link android.telecom.ConnectionService} implementations, and
     24  * {@link android.telecom.InCallService} implementations which provide a user interface for calls.
     25  * <p>
     26  * Android supports the following calling use cases (with increasing level of complexity):
     27  * <ul>
     28  *     <li>Implement the self-managed {@link android.telecom.ConnectionService} API - this is ideal
     29  *     for developers of standalone calling apps which do not wish to show their calls within the
     30  *     default phone app, and do not wish to have other calls shown in their user interface.  Using
     31  *     a self-managed {@link android.telecom.ConnectionService} implementation within your
     32  *     standalone calling app helps you ensure that your app will interoperate not only with native
     33  *     telephony calling on the device, but also other standalone calling apps implementing this
     34  *     API.  It also manages audio routing and focus for you.</li>
     35  *     <li>Implement the managed {@link android.telecom.ConnectionService} API - facilitates
     36  *     development of a calling solution that relies on the existing device phone application (see
     37  *     {@link android.telecom.TelecomManager#getDefaultDialerPackage()}) to provide the user
     38  *     interface for calls.  An example might be a third party implementation of SIP calling, or a
     39  *     VOIP calling service.  A {@link android.telecom.ConnectionService} alone provides only the
     40  *     means of connecting calls, but has no associated user interface.</li>
     41  *     <li>Implement the {@link android.telecom.InCallService} API - facilitates development of a
     42  *     replacement for the device's default Phone/Dialer app.  The
     43  *     {@link android.telecom.InCallService} alone does not have any calling capability and consists
     44  *     of the user-interface side of calling only.  An {@link android.telecom.InCallService} must
     45  *     handle all Calls the Telecom framework is aware of.  It must not make assumptions about the
     46  *     nature of the calls (e.g. assuming calls are SIM-based telephony calls), and should not
     47  *     implement calling restrictions based on any one {@link android.telecom.ConnectionService}
     48  *     (e.g. it should not enforce Telephony restrictions for video calls).</li>
     49  *     <li>Implement both the {@link android.telecom.InCallService} and
     50  *     {@link android.telecom.ConnectionService} API - ideal if you wish to create your own
     51  *     {@link android.telecom.ConnectionService} based calling solution, complete with its own
     52  *     full user interface, while showing all other Android calls in the same user interface.  Using
     53  *     this approach, you must still ensure that your {@link android.telecom.InCallService} makes
     54  *     no assumption about the source of the calls it displays.  You must also ensure that your
     55  *     {@link android.telecom.ConnectionService} implementation can still function without the
     56  *     default phone app being set to your custom {@link android.telecom.InCallService}.</li>
     57  * </ul>
     58  */
     59 package android.telecom;