IConnectionService.aidl revision 3fadaa923272675d841eda3d46b3e1d9dc08c819
1bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad/* 2bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * Copyright (C) 2013 The Android Open Source Project 3bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * 4bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * Licensed under the Apache License, Version 2.0 (the "License"); 5bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * you may not use this file except in compliance with the License. 6bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * You may obtain a copy of the License at 7bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * 8bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * http://www.apache.org/licenses/LICENSE-2.0 9bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * 10bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * Unless required by applicable law or agreed to in writing, software 11bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * distributed under the License is distributed on an "AS IS" BASIS, 12bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * See the License for the specific language governing permissions and 14bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * limitations under the License. 15bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad */ 16bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad 17bb69b0c2d821a9806fb00037284c399cbc78277dBen Giladpackage android.telecomm; 18bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad 19658c0cf6c3140b5cafc4e8880e08a7dead39d24aSantos Cordonimport android.telecomm.CallInfo; 20bb69b0c2d821a9806fb00037284c399cbc78277dBen Giladimport android.telecomm.ICallServiceAdapter; 21bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad 22bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad/** 23bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * Service interface for services which would like to provide calls to be 24bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * managed by the system in-call UI. 25bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * 26bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * This interface provides methods that the android framework can use to deliver commands 27bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * for calls provided by this call service including making new calls and disconnecting 28bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * existing ones. A binding to ICallService implementations exists for two conditions: 29bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * 1) There exists one or more live calls for that call service, 30bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * 2) Prior to an outbound call to test if this call service is compatible with the outgoing call. 31bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * 32bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * TODO(santoscordon): Need final public-facing comments in this file. 33bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad */ 34bb69b0c2d821a9806fb00037284c399cbc78277dBen Giladoneway interface ICallService { 35bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad 36bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad /** 37e57944dd55f72aa1b9fc04c6b6bc48992076fdf6Ben Gilad * Sets an implementation of ICallServiceAdapter which the call service can use to add new calls 38e57944dd55f72aa1b9fc04c6b6bc48992076fdf6Ben Gilad * and communicate state changes of existing calls. This is the first method that is called 39e57944dd55f72aa1b9fc04c6b6bc48992076fdf6Ben Gilad * after a the framework binds to the call service. 403784133b95f1206c0c6bbbddb5921ef396b5b941Santos Cordon * 413784133b95f1206c0c6bbbddb5921ef396b5b941Santos Cordon * @param callServiceAdapter Interface to CallsManager for adding and updating calls. 42e57944dd55f72aa1b9fc04c6b6bc48992076fdf6Ben Gilad */ 433784133b95f1206c0c6bbbddb5921ef396b5b941Santos Cordon void setCallServiceAdapter(in ICallServiceAdapter callServiceAdapter); 44e57944dd55f72aa1b9fc04c6b6bc48992076fdf6Ben Gilad 45e57944dd55f72aa1b9fc04c6b6bc48992076fdf6Ben Gilad /** 46658c0cf6c3140b5cafc4e8880e08a7dead39d24aSantos Cordon * Determines if the ICallService can place the specified call. Response is sent via 478986ef460188805a1af21ee5d8cd49a57d725d5eSantos Cordon * {@link ICallServiceAdapter#setCompatibleWith}. When responding, the correct call ID must be 48658c0cf6c3140b5cafc4e8880e08a7dead39d24aSantos Cordon * specified. It is expected that the call service respond within 500 milliseconds. Any response 49658c0cf6c3140b5cafc4e8880e08a7dead39d24aSantos Cordon * that takes longer than 500 milliseconds will be treated as being incompatible. 508986ef460188805a1af21ee5d8cd49a57d725d5eSantos Cordon * TODO(santoscordon): 500 ms was arbitrarily chosen and must be confirmed before this 513fadaa923272675d841eda3d46b3e1d9dc08c819Ben Gilad * API is made public. Only used in the context of outgoing calls and call switching (handoff). 523784133b95f1206c0c6bbbddb5921ef396b5b941Santos Cordon * 53658c0cf6c3140b5cafc4e8880e08a7dead39d24aSantos Cordon * @param callInfo The details of the relevant call. 54bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad */ 55658c0cf6c3140b5cafc4e8880e08a7dead39d24aSantos Cordon void isCompatibleWith(in CallInfo callInfo); 56bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad 57bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad /** 58658c0cf6c3140b5cafc4e8880e08a7dead39d24aSantos Cordon * Attempts to call the relevant party using the specified call's handle, be it a phone number, 59bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * SIP address, or some other kind of user ID. Note that the set of handle types is 60bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad * dynamically extensible since call providers should be able to implement arbitrary 618986ef460188805a1af21ee5d8cd49a57d725d5eSantos Cordon * handle-calling systems. See {@link #isCompatibleWith}. It is expected that the 62832ddb3fe66a73cdf383ea2700ae48f88ad9ded0Evan Charlton * call service respond via {@link ICallServiceAdapter#handleSuccessfulOutgoingCall} if it can 633fadaa923272675d841eda3d46b3e1d9dc08c819Ben Gilad * successfully make the call. Only used in the context of outgoing calls. 64b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon * TODO(santoscordon): Figure out how a call service can short-circuit a failure to the adapter. 653784133b95f1206c0c6bbbddb5921ef396b5b941Santos Cordon * 66658c0cf6c3140b5cafc4e8880e08a7dead39d24aSantos Cordon * @param callInfo The details of the relevant call. 67bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad */ 68658c0cf6c3140b5cafc4e8880e08a7dead39d24aSantos Cordon void call(in CallInfo callInfo); 69bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad 70bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad /** 713fadaa923272675d841eda3d46b3e1d9dc08c819Ben Gilad * Aborts the outgoing call attempt. Invoked in the unlikely event that Telecomm decides to 723fadaa923272675d841eda3d46b3e1d9dc08c819Ben Gilad * abort an attempt to place a call. Only ever be invoked after {@link #call} invocations. 733fadaa923272675d841eda3d46b3e1d9dc08c819Ben Gilad * After this is invoked, Telecomm does not expect any more updates about the call and will 743fadaa923272675d841eda3d46b3e1d9dc08c819Ben Gilad * actively ignore any such update. This is different from {@link #disconnect} where Telecomm 753fadaa923272675d841eda3d46b3e1d9dc08c819Ben Gilad * expects confirmation via {@link #markCallAsDisconnected}. 763784133b95f1206c0c6bbbddb5921ef396b5b941Santos Cordon * 773fadaa923272675d841eda3d46b3e1d9dc08c819Ben Gilad * @param callId The identifier of the call to abort. 78bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad */ 793fadaa923272675d841eda3d46b3e1d9dc08c819Ben Gilad void abort(String callId); 80bd63f90a789bfb608dbd036d60c4d08f9fd1f2d9Santos Cordon 81bd63f90a789bfb608dbd036d60c4d08f9fd1f2d9Santos Cordon /** 82b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon * Receives a new call ID to use with an incoming call. Invoked by Telecomm after it is notified 83b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon * that this call service has a pending incoming call, see 84b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon * {@link TelecommConstants#ACTION_INCOMING_CALL}. The call service must first give Telecomm 85b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon * additional information of the call through {@link ICallServiceAdapter#handleIncomingCall}. 86b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon * Following that, the call service can update the call at will using the specified call ID. 87bd63f90a789bfb608dbd036d60c4d08f9fd1f2d9Santos Cordon * 88bd63f90a789bfb608dbd036d60c4d08f9fd1f2d9Santos Cordon * @param callId The ID of the call. 89bd63f90a789bfb608dbd036d60c4d08f9fd1f2d9Santos Cordon */ 90b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon void setIncomingCallId(String callId); 91b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon 92b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon /** 93b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon * Answers a ringing call identified by callId. Telecomm invokes this method as a result of the 94b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon * user hitting the "answer" button in the incoming call screen. 95b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon * 96b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon * @param callId The ID of the call. 97b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon */ 98b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon void answer(String callId); 99b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon 100b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon /** 101b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon * Rejects a ringing call identified by callId. Telecomm invokes this method as a result of the 102b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon * user hitting the "reject" button in the incoming call screen. 103b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon * 104b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon * @param callId The ID of the call. 105b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon */ 106b340c331bca330e9cb60ce6e398b3c014e1a14c7Santos Cordon void reject(String callId); 1073fadaa923272675d841eda3d46b3e1d9dc08c819Ben Gilad 1083fadaa923272675d841eda3d46b3e1d9dc08c819Ben Gilad /** 1093fadaa923272675d841eda3d46b3e1d9dc08c819Ben Gilad * Disconnects the call identified by callId. Used for outgoing and incoming calls. 1103fadaa923272675d841eda3d46b3e1d9dc08c819Ben Gilad * 1113fadaa923272675d841eda3d46b3e1d9dc08c819Ben Gilad * @param callId The identifier of the call to disconnect. 1123fadaa923272675d841eda3d46b3e1d9dc08c819Ben Gilad */ 1133fadaa923272675d841eda3d46b3e1d9dc08c819Ben Gilad void disconnect(String callId); 114bb69b0c2d821a9806fb00037284c399cbc78277dBen Gilad} 115