IImsCallSession.aidl revision 752217bfc662402cdf13368e4b2a0338e8e0aed8
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 17package com.android.ims.internal; 18 19import com.android.ims.ImsCallProfile; 20import com.android.ims.ImsStreamMediaProfile; 21import com.android.ims.internal.IImsCallSessionListener; 22import com.android.ims.internal.IImsVideoCallProvider; 23 24/** 25 * An IMS session that is associated with a SIP dialog which is established from/to 26 * INVITE request or a mid-call transaction to control the session. 27 * {@hide} 28 */ 29interface IImsCallSession { 30 /** 31 * Closes the object. This object is not usable after being closed. 32 */ 33 void close(); 34 35 /** 36 * Gets the call ID of the session. 37 * 38 * @return the call ID 39 */ 40 String getCallId(); 41 42 /** 43 * Gets the call profile that this session is associated with 44 * 45 * @return the call profile that this session is associated with 46 */ 47 ImsCallProfile getCallProfile(); 48 49 /** 50 * Gets the local call profile that this session is associated with 51 * 52 * @return the local call profile that this session is associated with 53 */ 54 ImsCallProfile getLocalCallProfile(); 55 56 /** 57 * Gets the value associated with the specified property of this session. 58 * 59 * @return the string value associated with the specified property 60 */ 61 String getProperty(String name); 62 63 /** 64 * Gets the session state. The value returned must be one of the states in 65 * {@link ImsCallSession#State}. 66 * 67 * @return the session state 68 */ 69 int getState(); 70 71 /** 72 * Checks if the session is in a call. 73 * 74 * @return true if the session is in a call 75 */ 76 boolean isInCall(); 77 78 /** 79 * Sets the listener to listen to the session events. A {@link IImsCallSession} 80 * can only hold one listener at a time. Subsequent calls to this method 81 * override the previous listener. 82 * 83 * @param listener to listen to the session events of this object 84 */ 85 void setListener(in IImsCallSessionListener listener); 86 87 /** 88 * Mutes or unmutes the mic for the active call. 89 * 90 * @param muted true if the call is muted, false otherwise 91 */ 92 void setMute(boolean muted); 93 94 /** 95 * Initiates an IMS call with the specified target and call profile. 96 * The session listener is called back upon defined session events. 97 * The method is only valid to call when the session state is in 98 * {@link ImsCallSession#State#IDLE}. 99 * 100 * @param callee dialed string to make the call to 101 * @param profile call profile to make the call with the specified service type, 102 * call type and media information 103 * @see Listener#callSessionStarted, Listener#callSessionStartFailed 104 */ 105 void start(String callee, in ImsCallProfile profile); 106 107 /** 108 * Initiates an IMS call with the specified participants and call profile. 109 * The session listener is called back upon defined session events. 110 * The method is only valid to call when the session state is in 111 * {@link ImsCallSession#State#IDLE}. 112 * 113 * @param participants participant list to initiate an IMS conference call 114 * @param profile call profile to make the call with the specified service type, 115 * call type and media information 116 * @see Listener#callSessionStarted, Listener#callSessionStartFailed 117 */ 118 void startConference(in String[] participants, in ImsCallProfile profile); 119 120 /** 121 * Accepts an incoming call or session update. 122 * 123 * @param callType call type specified in {@link ImsCallProfile} to be answered 124 * @param profile stream media profile {@link ImsStreamMediaProfile} to be answered 125 * @see Listener#callSessionStarted 126 */ 127 void accept(int callType, in ImsStreamMediaProfile profile); 128 129 /** 130 * Rejects an incoming call or session update. 131 * 132 * @param reason reason code to reject an incoming call 133 * @see Listener#callSessionStartFailed 134 */ 135 void reject(int reason); 136 137 /** 138 * Terminates a call. 139 * 140 * @see Listener#callSessionTerminated 141 */ 142 void terminate(int reason); 143 144 /** 145 * Puts a call on hold. When it succeeds, {@link Listener#callSessionHeld} is called. 146 * 147 * @param profile stream media profile {@link ImsStreamMediaProfile} to hold the call 148 * @see Listener#callSessionHeld, Listener#callSessionHoldFailed 149 */ 150 void hold(in ImsStreamMediaProfile profile); 151 152 /** 153 * Continues a call that's on hold. When it succeeds, {@link Listener#callSessionResumed} 154 * is called. 155 * 156 * @param profile stream media profile {@link ImsStreamMediaProfile} to resume the call 157 * @see Listener#callSessionResumed, Listener#callSessionResumeFailed 158 */ 159 void resume(in ImsStreamMediaProfile profile); 160 161 /** 162 * Merges the active & hold call. When it succeeds, {@link Listener#callSessionMerged} 163 * is called. 164 * 165 * @see Listener#callSessionMerged, Listener#callSessionMergeFailed 166 */ 167 void merge(); 168 169 /** 170 * Updates the current call's properties (ex. call mode change: video upgrade / downgrade). 171 * 172 * @param callType call type specified in {@link ImsCallProfile} to be updated 173 * @param profile stream media profile {@link ImsStreamMediaProfile} to be updated 174 * @see Listener#callSessionUpdated, Listener#callSessionUpdateFailed 175 */ 176 void update(int callType, in ImsStreamMediaProfile profile); 177 178 /** 179 * Extends this call to the conference call with the specified recipients. 180 * 181 * @param participants participant list to be invited to the conference call after extending the call 182 * @see Listener#sessionConferenceExtened, Listener#sessionConferenceExtendFailed 183 */ 184 void extendToConference(in String[] participants); 185 186 /** 187 * Requests the conference server to invite an additional participants to the conference. 188 * 189 * @param participants participant list to be invited to the conference call 190 * @see Listener#sessionInviteParticipantsRequestDelivered, 191 * Listener#sessionInviteParticipantsRequestFailed 192 */ 193 void inviteParticipants(in String[] participants); 194 195 /** 196 * Requests the conference server to remove the specified participants from the conference. 197 * 198 * @param participants participant list to be removed from the conference call 199 * @see Listener#sessionRemoveParticipantsRequestDelivered, 200 * Listener#sessionRemoveParticipantsRequestFailed 201 */ 202 void removeParticipants(in String[] participants); 203 204 /** 205 * Sends a DTMF code. According to <a href="http://tools.ietf.org/html/rfc2833">RFC 2833</a>, 206 * event 0 ~ 9 maps to decimal value 0 ~ 9, '*' to 10, '#' to 11, event 'A' ~ 'D' to 12 ~ 15, 207 * and event flash to 16. Currently, event flash is not supported. 208 * 209 * @param code the DTMF to send. Value 0 to 15 (inclusive) are valid inputs. 210 * @param duration the interval in milli-seconds between the DTMFs 211 */ 212 void sendDtmf(int code, int duration); 213 214 /** 215 * Sends an USSD message. 216 * 217 * @param ussdMessage USSD message to send 218 */ 219 void sendUssd(String ussdMessage); 220 221 /** 222 * Returns a binder for the video call provider implementation contained within the IMS service 223 * process. This binder is used by the VideoCallProvider subclass in Telephony which 224 * intermediates between the propriety implementation and Telecomm/InCall. 225 */ 226 IImsVideoCallProvider getVideoCallProvider(); 227} 228