ImsCallSessionImplBase.java revision 21013dcf1b1c0c740efba863b6b4962fe3da9095
1/* 2 * Copyright (C) 2017 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 android.telephony.ims.stub; 18 19import android.os.Message; 20import android.os.RemoteException; 21 22import com.android.ims.ImsCallProfile; 23import com.android.ims.ImsStreamMediaProfile; 24import com.android.ims.internal.ImsCallSession; 25import com.android.ims.internal.IImsCallSession; 26import com.android.ims.internal.IImsCallSessionListener; 27import com.android.ims.internal.IImsVideoCallProvider; 28 29/** 30 * Base implementation of IImsCallSession, which implements stub versions of the methods in the 31 * IImsCallSession AIDL. Override the methods that your implementation of ImsCallSession supports. 32 * 33 * DO NOT remove or change the existing APIs, only add new ones to this Base implementation or you 34 * will break other implementations of ImsCallSession maintained by other ImsServices. 35 * 36 * @hide 37 */ 38 39public class ImsCallSessionImplBase extends IImsCallSession.Stub { 40 41 /** 42 * Closes the object. This object is not usable after being closed. 43 */ 44 @Override 45 public void close() throws RemoteException { 46 47 } 48 49 /** 50 * Gets the call ID of the session. 51 * 52 * @return the call ID 53 */ 54 @Override 55 public String getCallId() throws RemoteException { 56 return null; 57 } 58 59 /** 60 * Gets the call profile that this session is associated with 61 * 62 * @return the {@link ImsCallProfile} that this session is associated with 63 */ 64 @Override 65 public ImsCallProfile getCallProfile() throws RemoteException { 66 return null; 67 } 68 69 /** 70 * Gets the local call profile that this session is associated with 71 * 72 * @return the local {@link ImsCallProfile} that this session is associated with 73 */ 74 @Override 75 public ImsCallProfile getLocalCallProfile() throws RemoteException { 76 return null; 77 } 78 79 /** 80 * Gets the remote call profile that this session is associated with 81 * 82 * @return the remote {@link ImsCallProfile} that this session is associated with 83 */ 84 @Override 85 public ImsCallProfile getRemoteCallProfile() throws RemoteException { 86 return null; 87 } 88 89 /** 90 * Gets the value associated with the specified property of this session. 91 * 92 * @return the string value associated with the specified property 93 */ 94 @Override 95 public String getProperty(String name) throws RemoteException { 96 return null; 97 } 98 99 /** 100 * Gets the session state. 101 * The value returned must be one of the states in {@link ImsCallSession.State}. 102 * 103 * @return the session state 104 */ 105 @Override 106 public int getState() throws RemoteException { 107 return ImsCallSession.State.INVALID; 108 } 109 110 /** 111 * Checks if the session is in call. 112 * 113 * @return true if the session is in call, false otherwise 114 */ 115 @Override 116 public boolean isInCall() throws RemoteException { 117 return false; 118 } 119 120 /** 121 * Sets the listener to listen to the session events. An {@link ImsCallSession} 122 * can only hold one listener at a time. Subsequent calls to this method 123 * override the previous listener. 124 * 125 * @param listener to listen to the session events of this object 126 */ 127 @Override 128 public void setListener(IImsCallSessionListener listener) throws RemoteException { 129 } 130 131 /** 132 * Mutes or unmutes the mic for the active call. 133 * 134 * @param muted true if the call is muted, false otherwise 135 */ 136 @Override 137 public void setMute(boolean muted) throws RemoteException { 138 } 139 140 /** 141 * Initiates an IMS call with the specified target and call profile. 142 * The session listener set in {@link #setListener} is called back upon defined session events. 143 * The method is only valid to call when the session state is in 144 * {@link ImsCallSession.State#IDLE}. 145 * 146 * @param callee dialed string to make the call to 147 * @param profile call profile to make the call with the specified service type, 148 * call type and media information 149 * @see {@link ImsCallSession.Listener#callSessionStarted}, 150 * {@link ImsCallSession.Listener#callSessionStartFailed} 151 */ 152 @Override 153 public void start(String callee, ImsCallProfile profile) throws RemoteException { 154 } 155 156 /** 157 * Initiates an IMS call with the specified participants and call profile. 158 * The session listener set in {@link #setListener} is called back upon defined session events. 159 * The method is only valid to call when the session state is in 160 * {@link ImsCallSession.State#IDLE}. 161 * 162 * @param participants participant list to initiate an IMS conference call 163 * @param profile call profile to make the call with the specified service type, 164 * call type and media information 165 * @see {@link ImsCallSession.Listener#callSessionStarted}, 166 * {@link ImsCallSession.Listener#callSessionStartFailed} 167 */ 168 @Override 169 public void startConference(String[] participants, ImsCallProfile profile) 170 throws RemoteException { 171 } 172 173 /** 174 * Accepts an incoming call or session update. 175 * 176 * @param callType call type specified in {@link ImsCallProfile} to be answered 177 * @param profile stream media profile {@link ImsStreamMediaProfile} to be answered 178 * @see {@link ImsCallSession.Listener#callSessionStarted} 179 */ 180 @Override 181 public void accept(int callType, ImsStreamMediaProfile profile) throws RemoteException { 182 } 183 184 /** 185 * Rejects an incoming call or session update. 186 * 187 * @param reason reason code to reject an incoming call, defined in 188 * com.android.ims.ImsReasonInfo 189 * {@link ImsCallSession.Listener#callSessionStartFailed} 190 */ 191 @Override 192 public void reject(int reason) throws RemoteException { 193 } 194 195 /** 196 * Terminates a call. 197 * 198 * @param reason reason code to terminate a call, defined in 199 * com.android.ims.ImsReasonInfo 200 * 201 * @see {@link ImsCallSession.Listener#callSessionTerminated} 202 */ 203 @Override 204 public void terminate(int reason) throws RemoteException { 205 } 206 207 /** 208 * Puts a call on hold. When it succeeds, {@link ImsCallSession.Listener#callSessionHeld} is 209 * called. 210 * 211 * @param profile stream media profile {@link ImsStreamMediaProfile} to hold the call 212 * @see {@link ImsCallSession.Listener#callSessionHeld}, 213 * {@link ImsCallSession.Listener#callSessionHoldFailed} 214 */ 215 @Override 216 public void hold(ImsStreamMediaProfile profile) throws RemoteException { 217 } 218 219 /** 220 * Continues a call that's on hold. When it succeeds, 221 * {@link ImsCallSession.Listener#callSessionResumed} is called. 222 * 223 * @param profile stream media profile with {@link ImsStreamMediaProfile} to resume the call 224 * @see {@link ImsCallSession.Listener#callSessionResumed}, 225 * {@link ImsCallSession.Listener#callSessionResumeFailed} 226 */ 227 @Override 228 public void resume(ImsStreamMediaProfile profile) throws RemoteException { 229 } 230 231 /** 232 * Merges the active & hold call. When the merge starts, 233 * {@link ImsCallSession.Listener#callSessionMergeStarted} is called. 234 * {@link ImsCallSession.Listener#callSessionMergeComplete} is called if the merge is 235 * successful, and {@link ImsCallSession.Listener#callSessionMergeFailed} is called if the merge 236 * fails. 237 * 238 * @see {@link ImsCallSession.Listener#callSessionMergeStarted}, 239 * {@link ImsCallSession.Listener#callSessionMergeComplete}, 240 * {@link ImsCallSession.Listener#callSessionMergeFailed} 241 */ 242 @Override 243 public void merge() throws RemoteException { 244 } 245 246 /** 247 * Updates the current call's properties (ex. call mode change: video upgrade / downgrade). 248 * 249 * @param callType call type specified in {@link ImsCallProfile} to be updated 250 * @param profile stream media profile {@link ImsStreamMediaProfile} to be updated 251 * @see {@link ImsCallSession.Listener#callSessionUpdated}, 252 * {@link ImsCallSession.Listener#callSessionUpdateFailed} 253 */ 254 @Override 255 public void update(int callType, ImsStreamMediaProfile profile) throws RemoteException { 256 } 257 258 /** 259 * Extends this call to the conference call with the specified recipients. 260 * 261 * @param participants participant list to be invited to the conference call after extending the 262 * call 263 * @see {@link ImsCallSession.Listener#callSessionConferenceExtended}, 264 * {@link ImsCallSession.Listener#callSessionConferenceExtendFailed} 265 */ 266 @Override 267 public void extendToConference(String[] participants) throws RemoteException { 268 } 269 270 /** 271 * Requests the conference server to invite an additional participants to the conference. 272 * 273 * @param participants participant list to be invited to the conference call 274 * @see {@link ImsCallSession.Listener#callSessionInviteParticipantsRequestDelivered}, 275 * {@link ImsCallSession.Listener#callSessionInviteParticipantsRequestFailed} 276 */ 277 @Override 278 public void inviteParticipants(String[] participants) throws RemoteException { 279 } 280 281 /** 282 * Requests the conference server to remove the specified participants from the conference. 283 * 284 * @param participants participant list to be removed from the conference call 285 * @see {@link ImsCallSession.Listener#callSessionRemoveParticipantsRequestDelivered}, 286 * {@link ImsCallSession.Listener#callSessionRemoveParticipantsRequestFailed} 287 */ 288 @Override 289 public void removeParticipants(String[] participants) throws RemoteException { 290 } 291 292 /** 293 * Sends a DTMF code. According to <a href="http://tools.ietf.org/html/rfc2833">RFC 2833</a>, 294 * event 0 ~ 9 maps to decimal value 0 ~ 9, '*' to 10, '#' to 11, event 'A' ~ 'D' to 12 ~ 15, 295 * and event flash to 16. Currently, event flash is not supported. 296 * 297 * @param c the DTMF to send. '0' ~ '9', 'A' ~ 'D', '*', '#' are valid inputs. 298 */ 299 @Override 300 public void sendDtmf(char c, Message result) throws RemoteException { 301 } 302 303 /** 304 * Start a DTMF code. According to <a href="http://tools.ietf.org/html/rfc2833">RFC 2833</a>, 305 * event 0 ~ 9 maps to decimal value 0 ~ 9, '*' to 10, '#' to 11, event 'A' ~ 'D' to 12 ~ 15, 306 * and event flash to 16. Currently, event flash is not supported. 307 * 308 * @param c the DTMF to send. '0' ~ '9', 'A' ~ 'D', '*', '#' are valid inputs. 309 */ 310 @Override 311 public void startDtmf(char c) throws RemoteException { 312 } 313 314 /** 315 * Stop a DTMF code. 316 */ 317 @Override 318 public void stopDtmf() throws RemoteException { 319 } 320 321 /** 322 * Sends an USSD message. 323 * 324 * @param ussdMessage USSD message to send 325 */ 326 @Override 327 public void sendUssd(String ussdMessage) throws RemoteException { 328 } 329 330 /** 331 * Returns a binder for the video call provider implementation contained within the IMS service 332 * process. This binder is used by the VideoCallProvider subclass in Telephony which 333 * intermediates between the propriety implementation and Telecomm/InCall. 334 */ 335 @Override 336 public IImsVideoCallProvider getVideoCallProvider() throws RemoteException { 337 return null; 338 } 339 340 /** 341 * Determines if the current session is multiparty. 342 * @return {@code True} if the session is multiparty. 343 */ 344 @Override 345 public boolean isMultiparty() throws RemoteException { 346 return false; 347 } 348} 349