177e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal/* 277e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * Copyright (C) 2013 The Android Open Source Project 377e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * 477e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * Licensed under the Apache License, Version 2.0 (the "License"); 577e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * you may not use this file except in compliance with the License. 677e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * You may obtain a copy of the License at 777e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * 877e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * http://www.apache.org/licenses/LICENSE-2.0 977e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * 1077e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * Unless required by applicable law or agreed to in writing, software 1177e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * distributed under the License is distributed on an "AS IS" BASIS, 1277e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1377e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * See the License for the specific language governing permissions and 1477e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * limitations under the License. 1577e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal */ 1677e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal 1777e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepalpackage com.android.internal.telephony; 1877e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal 1977e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepalimport com.android.internal.telephony.ICallServiceAdapter; 2077e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal 2177e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal/** 2277e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * Service interface for services which would like to provide calls to be 2377e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * managed by the system in-call UI. 2477e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * 2577e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * This interface provides methods that the android framework can use to deliver commands 2677e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * for calls provided by this call service including making new calls and disconnecting 2777e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * existing ones. A binding to ICallService implementations exists for two conditions: 2877e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * 1) There exists one or more live calls for that call service, 2977e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * 2) Prior to an outbound call to test if this call service is compatible with the outgoing call. 3077e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal */ 3177e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepaloneway interface ICallService { 3277e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal 3377e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal /** 3477e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * Determines if the CallService can make calls to the handle. 3577e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * TODO(santoscordon): Move this method into its own service interface long term. 3677e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * TODO(santoscordon): Add response callback parameter. 3777e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal */ 3877e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal void isCompatibleWith(String handle); 3977e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal 4077e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal /** 4177e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * Attempts to call the relevant party using the specified handle, be it a phone number, 4277e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * SIP address, or some other kind of user ID. Note that the set of handle types is 4377e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * dynamically extensible since call providers should be able to implement arbitrary 4477e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * handle-calling systems. See {@link #isCompatibleWith}. 4577e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * TODO(santoscordon): Should this have a response attached to it to ensure that the call 4677e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * service actually plans to make the call? 4777e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal */ 4877e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal void call(String handle); 4977e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal 5077e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal /** 5177e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * Disconnects the call identified by callId. 5277e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal */ 5377e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal void disconnect(String callId); 5477e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal 5577e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal /** 5677e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * Sets an implementation of ICallServiceAdapter which the call service can use to add new calls 5777e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * and communicate state changes of existing calls. This is the first method that is called 5877e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal * after a the framework binds to the call service. 5977e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal */ 60968740b5f574fee11d71a35c321f4e9e13d13570Sailesh Nepal void setCallServiceAdapter(ICallServiceAdapter callServiceAdapter); 6177e0d606f63c8526931018a3ae86f8b9d722c0bdSailesh Nepal} 62