Home | History | Annotate | Download | only in telephony
      1 /*
      2  * Copyright (C) 2013 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 package com.android.internal.telephony;
     18 
     19 import com.android.internal.telephony.ICallServiceAdapter;
     20 
     21 /**
     22  * Service interface for services which would like to provide calls to be
     23  * managed by the system in-call UI.
     24  *
     25  * This interface provides methods that the android framework can use to deliver commands
     26  * for calls provided by this call service including making new calls and disconnecting
     27  * existing ones. A binding to ICallService implementations exists for two conditions:
     28  * 1) There exists one or more live calls for that call service,
     29  * 2) Prior to an outbound call to test if this call service is compatible with the outgoing call.
     30  */
     31 oneway interface ICallService {
     32 
     33     /**
     34      * Determines if the CallService can make calls to the handle.
     35      * TODO(santoscordon): Move this method into its own service interface long term.
     36      * TODO(santoscordon): Add response callback parameter.
     37      */
     38     void isCompatibleWith(String handle);
     39 
     40     /**
     41      * Attempts to call the relevant party using the specified handle, be it a phone number,
     42      * SIP address, or some other kind of user ID.  Note that the set of handle types is
     43      * dynamically extensible since call providers should be able to implement arbitrary
     44      * handle-calling systems.  See {@link #isCompatibleWith}.
     45      * TODO(santoscordon): Should this have a response attached to it to ensure that the call
     46      * service actually plans to make the call?
     47      */
     48     void call(String handle);
     49 
     50     /**
     51      * Disconnects the call identified by callId.
     52      */
     53     void disconnect(String callId);
     54 
     55     /**
     56      * Sets an implementation of ICallServiceAdapter which the call service can use to add new calls
     57      * and communicate state changes of existing calls. This is the first method that is called
     58      * after a the framework binds to the call service.
     59      */
     60     void setCallServiceAdapter(ICallServiceAdapter callServiceAdapter);
     61 }
     62