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