Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2004-2012 Savoir-Faire Linux Inc. |
| 3 | * |
Alexandre Savard | a140465 | 2012-09-20 13:34:08 -0400 | [diff] [blame] | 4 | * Author: Alexandre Savard <alexandre.savard@gmail.com> |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 3 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 19 | * |
| 20 | * Additional permission under GNU GPL version 3 section 7: |
| 21 | * |
| 22 | * If you modify this program, or any covered work, by linking or |
| 23 | * combining it with the OpenSSL project's OpenSSL library (or a |
| 24 | * modified version of that library), containing parts covered by the |
| 25 | * terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc. |
| 26 | * grants you additional permission to convey the resulting work. |
| 27 | * Corresponding Source for a non-source form of such a combination |
| 28 | * shall include the source code for the parts of OpenSSL used as well |
| 29 | * as that of the covered work. |
| 30 | */ |
| 31 | package com.savoirfairelinux.sflphone.client; |
| 32 | |
Alexandre Savard | 3bdce7b | 2012-10-24 18:27:45 -0400 | [diff] [blame] | 33 | import android.content.Context; |
| 34 | import android.content.Intent; |
| 35 | import android.os.Bundle; |
Alexandre Savard | 85936b9 | 2012-10-24 11:23:53 -0400 | [diff] [blame] | 36 | import android.os.Parcelable; |
Alexandre Savard | 557a574 | 2012-10-24 13:54:53 -0400 | [diff] [blame] | 37 | import android.os.Parcel; |
Alexandre Savard | 74c1cad | 2012-10-24 16:39:00 -0400 | [diff] [blame] | 38 | import android.os.RemoteException; |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 39 | import android.util.Log; |
Alexandre Savard | d197653 | 2012-10-26 15:32:45 -0400 | [diff] [blame^] | 40 | import android.view.View; |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 41 | import java.util.ArrayList; |
| 42 | |
Alexandre Savard | 74c1cad | 2012-10-24 16:39:00 -0400 | [diff] [blame] | 43 | import com.savoirfairelinux.sflphone.service.ISipService; |
Alexandre Savard | 4f42ade | 2012-10-24 18:03:31 -0400 | [diff] [blame] | 44 | import com.savoirfairelinux.sflphone.client.CallActivity; |
Alexandre Savard | d197653 | 2012-10-26 15:32:45 -0400 | [diff] [blame^] | 45 | import com.savoirfairelinux.sflphone.client.CallElementList.CallElementView; |
Alexandre Savard | 74c1cad | 2012-10-24 16:39:00 -0400 | [diff] [blame] | 46 | |
Alexandre Savard | 557a574 | 2012-10-24 13:54:53 -0400 | [diff] [blame] | 47 | public class SipCall |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 48 | { |
| 49 | final static String TAG = "SipCall"; |
Alexandre Savard | 7a46f54 | 2012-09-20 11:23:33 -0400 | [diff] [blame] | 50 | public CallInfo mCallInfo; |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 51 | // Update UI on actions (answer, hangup) |
| 52 | static private CallElementList mCallElementList = null; |
| 53 | static private SFLPhoneHome mHome = null; |
Alexandre Savard | d197653 | 2012-10-26 15:32:45 -0400 | [diff] [blame^] | 54 | private View mRowView = null; |
Alexandre Savard | 7a46f54 | 2012-09-20 11:23:33 -0400 | [diff] [blame] | 55 | |
Alexandre Savard | 27a5113 | 2012-10-25 18:35:14 -0400 | [diff] [blame] | 56 | public static final int CALL_STATE_NONE = 0; |
Alexandre Savard | df54426 | 2012-10-25 14:24:08 -0400 | [diff] [blame] | 57 | public static final int CALL_STATE_INCOMING = 1; |
| 58 | public static final int CALL_STATE_RINGING = 2; |
| 59 | public static final int CALL_STATE_CURRENT = 3; |
| 60 | public static final int CALL_STATE_HUNGUP = 4; |
| 61 | public static final int CALL_STATE_BUSY = 5; |
| 62 | public static final int CALL_STATE_FAILURE = 6; |
| 63 | public static final int CALL_STATE_HOLD = 7; |
| 64 | public static final int CALL_STATE_UNHOLD = 8; |
Alexandre Savard | 2b01c82 | 2012-09-20 15:00:37 -0400 | [diff] [blame] | 65 | |
Alexandre Savard | df54426 | 2012-10-25 14:24:08 -0400 | [diff] [blame] | 66 | public static final int MEDIA_STATE_NONE = 0; // No media currently |
| 67 | public static final int MEDIA_STATE_ACTIVE = 1; // Media is active |
| 68 | public static final int MEDIA_STATE_LOCAL_HOLD = 2; // Media is put on hold bu user |
| 69 | public static final int MEDIA_STATE_REMOTE_HOLD = 3; // Media is put on hold by peer |
| 70 | public static final int MEDIA_STATE_ERROR = 5; // Media is in error state |
Alexandre Savard | 2b01c82 | 2012-09-20 15:00:37 -0400 | [diff] [blame] | 71 | |
Alexandre Savard | 557a574 | 2012-10-24 13:54:53 -0400 | [diff] [blame] | 72 | public static class CallInfo implements Parcelable |
Alexandre Savard | 7a46f54 | 2012-09-20 11:23:33 -0400 | [diff] [blame] | 73 | { |
Alexandre Savard | 2b01c82 | 2012-09-20 15:00:37 -0400 | [diff] [blame] | 74 | public String mCallID = ""; |
Alexandre Savard | 73bc56f | 2012-10-25 13:35:54 -0400 | [diff] [blame] | 75 | public String mAccountID = ""; |
Alexandre Savard | 7a46f54 | 2012-09-20 11:23:33 -0400 | [diff] [blame] | 76 | public String mDisplayName = ""; |
| 77 | public String mPhone = ""; |
| 78 | public String mEmail = ""; |
Alexandre Savard | 2b01c82 | 2012-09-20 15:00:37 -0400 | [diff] [blame] | 79 | public String mRemoteContact = ""; |
Alexandre Savard | 27a5113 | 2012-10-25 18:35:14 -0400 | [diff] [blame] | 80 | public int mCallState = CALL_STATE_NONE; |
Alexandre Savard | 557a574 | 2012-10-24 13:54:53 -0400 | [diff] [blame] | 81 | public int mMediaState = MEDIA_STATE_NONE; |
| 82 | |
| 83 | @Override |
| 84 | public int describeContents() { |
| 85 | return 0; |
| 86 | } |
| 87 | |
| 88 | @Override |
| 89 | public void writeToParcel(Parcel out, int flags) { |
| 90 | ArrayList<String> list = new ArrayList<String>(); |
Alexandre Savard | 74c1cad | 2012-10-24 16:39:00 -0400 | [diff] [blame] | 91 | |
| 92 | // Don't mess with this order!!! |
Alexandre Savard | 557a574 | 2012-10-24 13:54:53 -0400 | [diff] [blame] | 93 | list.add(mCallID); |
Alexandre Savard | 73bc56f | 2012-10-25 13:35:54 -0400 | [diff] [blame] | 94 | list.add(mAccountID); |
Alexandre Savard | 557a574 | 2012-10-24 13:54:53 -0400 | [diff] [blame] | 95 | list.add(mDisplayName); |
| 96 | list.add(mPhone); |
| 97 | list.add(mEmail); |
| 98 | list.add(mRemoteContact); |
| 99 | |
| 100 | out.writeStringList(list); |
| 101 | out.writeInt(mCallState); |
| 102 | out.writeInt(mMediaState); |
| 103 | } |
| 104 | |
| 105 | public static final Parcelable.Creator<CallInfo> CREATOR |
| 106 | = new Parcelable.Creator<CallInfo>() { |
| 107 | public CallInfo createFromParcel(Parcel in) { |
| 108 | return new CallInfo(in); |
| 109 | } |
| 110 | |
| 111 | public CallInfo[] newArray(int size) { |
| 112 | return new CallInfo[size]; |
| 113 | } |
| 114 | }; |
| 115 | |
| 116 | public CallInfo() {} |
| 117 | |
| 118 | private CallInfo(Parcel in) { |
| 119 | ArrayList<String> list = in.createStringArrayList(); |
Alexandre Savard | 74c1cad | 2012-10-24 16:39:00 -0400 | [diff] [blame] | 120 | |
| 121 | // Don't mess with this order!!! |
Alexandre Savard | 557a574 | 2012-10-24 13:54:53 -0400 | [diff] [blame] | 122 | mCallID = list.get(0); |
Alexandre Savard | 73bc56f | 2012-10-25 13:35:54 -0400 | [diff] [blame] | 123 | mAccountID = list.get(1); |
| 124 | mDisplayName = list.get(2); |
| 125 | mPhone = list.get(3); |
| 126 | mEmail = list.get(4); |
| 127 | mRemoteContact = list.get(5); |
Alexandre Savard | 557a574 | 2012-10-24 13:54:53 -0400 | [diff] [blame] | 128 | |
| 129 | mCallState = in.readInt(); |
| 130 | mMediaState = in.readInt(); |
| 131 | } |
Alexandre Savard | 7a46f54 | 2012-09-20 11:23:33 -0400 | [diff] [blame] | 132 | } |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 133 | |
| 134 | public SipCall() |
| 135 | { |
Alexandre Savard | 7a46f54 | 2012-09-20 11:23:33 -0400 | [diff] [blame] | 136 | mCallInfo = new CallInfo(); |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 137 | } |
| 138 | |
Alexandre Savard | 7a46f54 | 2012-09-20 11:23:33 -0400 | [diff] [blame] | 139 | public SipCall(CallInfo info) |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 140 | { |
Alexandre Savard | 7a46f54 | 2012-09-20 11:23:33 -0400 | [diff] [blame] | 141 | mCallInfo = info; |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 142 | } |
| 143 | |
Alexandre Savard | a140465 | 2012-09-20 13:34:08 -0400 | [diff] [blame] | 144 | public static void setCallElementList(CallElementList list) |
| 145 | { |
| 146 | mCallElementList = list; |
| 147 | } |
| 148 | |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 149 | public static void setSFLPhoneHomeContext(SFLPhoneHome home) |
| 150 | { |
| 151 | mHome = home; |
| 152 | } |
| 153 | |
Alexandre Savard | d197653 | 2012-10-26 15:32:45 -0400 | [diff] [blame^] | 154 | public void setAssociatedRowView(View view) |
| 155 | { |
| 156 | mRowView = view; |
| 157 | } |
| 158 | |
Alexandre Savard | c58c0fd | 2012-10-25 10:44:08 -0400 | [diff] [blame] | 159 | public void setCallID(String callID) { |
| 160 | mCallInfo.mCallID = callID; |
| 161 | } |
| 162 | |
| 163 | public String getCallId() { |
| 164 | return mCallInfo.mCallID; |
| 165 | } |
| 166 | |
Alexandre Savard | 73bc56f | 2012-10-25 13:35:54 -0400 | [diff] [blame] | 167 | public void setAccountID(String accountID) { |
| 168 | mCallInfo.mAccountID = accountID; |
| 169 | } |
| 170 | |
| 171 | public String getAccountID() { |
| 172 | return mCallInfo.mAccountID; |
| 173 | } |
| 174 | |
Alexandre Savard | c58c0fd | 2012-10-25 10:44:08 -0400 | [diff] [blame] | 175 | public void setDisplayName(String displayName) { |
| 176 | mCallInfo.mDisplayName = displayName; |
| 177 | } |
| 178 | |
| 179 | public String getDisplayName() { |
| 180 | return mCallInfo.mDisplayName; |
| 181 | } |
| 182 | |
| 183 | public void setPhone(String phone) { |
| 184 | mCallInfo.mPhone = phone; |
| 185 | } |
| 186 | |
| 187 | public String getPhone() { |
| 188 | return mCallInfo.mPhone; |
| 189 | } |
| 190 | |
| 191 | public void setEmail(String email) { |
| 192 | mCallInfo.mEmail = email; |
| 193 | } |
| 194 | |
| 195 | public String getEmail() { |
| 196 | return mCallInfo.mEmail; |
| 197 | } |
| 198 | |
| 199 | public void setRemoteContact(String remoteContact) { |
| 200 | mCallInfo.mRemoteContact = remoteContact; |
| 201 | } |
| 202 | |
| 203 | public String getRemoteContact() { |
| 204 | return mCallInfo.mRemoteContact; |
| 205 | } |
| 206 | |
| 207 | public void setCallState(int callState) { |
| 208 | mCallInfo.mCallState = callState; |
Alexandre Savard | d197653 | 2012-10-26 15:32:45 -0400 | [diff] [blame^] | 209 | |
| 210 | if(mRowView == null) |
| 211 | return; |
| 212 | |
| 213 | String state; |
| 214 | |
| 215 | switch(mCallInfo.mCallState) { |
| 216 | case CALL_STATE_INCOMING: |
| 217 | state = "INCOMING"; |
| 218 | break; |
| 219 | case CALL_STATE_RINGING: |
| 220 | state = "RINGING"; |
| 221 | break; |
| 222 | case CALL_STATE_CURRENT: |
| 223 | state = "CURRENT"; |
| 224 | break; |
| 225 | case CALL_STATE_HUNGUP: |
| 226 | state = "HUNGUP"; |
| 227 | break; |
| 228 | case CALL_STATE_BUSY: |
| 229 | state = "BUSY"; |
| 230 | break; |
| 231 | case CALL_STATE_FAILURE: |
| 232 | state = "FAILURE"; |
| 233 | break; |
| 234 | case CALL_STATE_HOLD: |
| 235 | state = "HOLD"; |
| 236 | break; |
| 237 | case CALL_STATE_UNHOLD: |
| 238 | state = "UNHOLD"; |
| 239 | break; |
| 240 | default: |
| 241 | state = "NULL"; |
| 242 | } |
| 243 | |
| 244 | CallElementView entryView = (CallElementView) mRowView.getTag(); |
| 245 | final String CURRENT_STATE_LABEL = " CURRENT STATE: "; |
| 246 | entryView.state.setText(CURRENT_STATE_LABEL + getCallStateString()); |
Alexandre Savard | c58c0fd | 2012-10-25 10:44:08 -0400 | [diff] [blame] | 247 | } |
| 248 | |
Alexandre Savard | df54426 | 2012-10-25 14:24:08 -0400 | [diff] [blame] | 249 | public int getCallStateInt() { |
Alexandre Savard | c58c0fd | 2012-10-25 10:44:08 -0400 | [diff] [blame] | 250 | return mCallInfo.mCallState; |
| 251 | } |
| 252 | |
Alexandre Savard | df54426 | 2012-10-25 14:24:08 -0400 | [diff] [blame] | 253 | public String getCallStateString() { |
| 254 | String state; |
| 255 | |
| 256 | switch(mCallInfo.mCallState) { |
| 257 | case CALL_STATE_INCOMING: |
| 258 | state = "INCOMING"; |
| 259 | break; |
| 260 | case CALL_STATE_RINGING: |
| 261 | state = "RINGING"; |
| 262 | break; |
| 263 | case CALL_STATE_CURRENT: |
| 264 | state = "CURRENT"; |
| 265 | break; |
| 266 | case CALL_STATE_HUNGUP: |
| 267 | state = "HUNGUP"; |
| 268 | break; |
| 269 | case CALL_STATE_BUSY: |
| 270 | state = "BUSY"; |
| 271 | break; |
| 272 | case CALL_STATE_FAILURE: |
| 273 | state = "FAILURE"; |
| 274 | break; |
| 275 | case CALL_STATE_HOLD: |
| 276 | state = "HOLD"; |
| 277 | break; |
| 278 | case CALL_STATE_UNHOLD: |
| 279 | state = "UNHOLD"; |
| 280 | break; |
| 281 | default: |
| 282 | state = "NULL"; |
| 283 | } |
| 284 | |
| 285 | return state; |
| 286 | } |
| 287 | |
| 288 | |
Alexandre Savard | c58c0fd | 2012-10-25 10:44:08 -0400 | [diff] [blame] | 289 | public void setMediaState(int mediaState) { |
| 290 | mCallInfo.mMediaState = mediaState; |
| 291 | } |
| 292 | |
| 293 | public int getMediaState() { |
| 294 | return mCallInfo.mMediaState; |
| 295 | } |
| 296 | |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 297 | public void placeCallUpdateUi() |
| 298 | { |
| 299 | if(mCallElementList != null) |
| 300 | mCallElementList.addCall(this); |
| 301 | |
| 302 | if(mHome != null) |
| 303 | mHome.onSelectedCallAction(this); |
| 304 | } |
| 305 | |
Alexandre Savard | 27a5113 | 2012-10-25 18:35:14 -0400 | [diff] [blame] | 306 | public void notifyServicePlaceCall(ISipService service) |
| 307 | { |
| 308 | try { |
| 309 | service.placeCall(mCallInfo.mAccountID, mCallInfo.mCallID, mCallInfo.mPhone); |
| 310 | } catch (RemoteException e) { |
| 311 | Log.e(TAG, "Cannot call service method", e); |
| 312 | } |
| 313 | } |
| 314 | |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 315 | public void receiveCallUpdateUi() |
Alexandre Savard | 23240c1 | 2012-09-19 18:23:44 -0400 | [diff] [blame] | 316 | { |
Alexandre Savard | 74c1cad | 2012-10-24 16:39:00 -0400 | [diff] [blame] | 317 | if(mCallElementList != null) |
| 318 | mCallElementList.addCall(this); |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 319 | |
| 320 | if(mHome != null) |
| 321 | mHome.onSelectedCallAction(this); |
Alexandre Savard | 73bc56f | 2012-10-25 13:35:54 -0400 | [diff] [blame] | 322 | } |
| 323 | |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 324 | public void answerUpdateUi() |
Alexandre Savard | 73bc56f | 2012-10-25 13:35:54 -0400 | [diff] [blame] | 325 | { |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 326 | if(mHome != null) |
| 327 | mHome.onSelectedCallAction(this); |
Alexandre Savard | f17e317 | 2012-10-25 16:09:09 -0400 | [diff] [blame] | 328 | |
| 329 | } |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 330 | |
Alexandre Savard | f17e317 | 2012-10-25 16:09:09 -0400 | [diff] [blame] | 331 | public void notifyServiceAnswer(ISipService service) |
| 332 | { |
Alexandre Savard | 27a5113 | 2012-10-25 18:35:14 -0400 | [diff] [blame] | 333 | int callState = getCallStateInt(); |
| 334 | if((callState != CALL_STATE_RINGING) && |
| 335 | (callState != CALL_STATE_NONE)) { |
Alexandre Savard | f17e317 | 2012-10-25 16:09:09 -0400 | [diff] [blame] | 336 | return; |
Alexandre Savard | 27a5113 | 2012-10-25 18:35:14 -0400 | [diff] [blame] | 337 | } |
Alexandre Savard | f17e317 | 2012-10-25 16:09:09 -0400 | [diff] [blame] | 338 | |
| 339 | try { |
| 340 | service.accept(mCallInfo.mCallID); |
| 341 | } catch (RemoteException e) { |
| 342 | Log.e(TAG, "Cannot call service method", e); |
| 343 | } |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 344 | } |
| 345 | |
Alexandre Savard | 4f42ade | 2012-10-24 18:03:31 -0400 | [diff] [blame] | 346 | /** |
| 347 | * Perform hangup action without sending request to the service |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 348 | * Used when SipService haved been notified that this call hung up |
Alexandre Savard | 4f42ade | 2012-10-24 18:03:31 -0400 | [diff] [blame] | 349 | */ |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 350 | public void hangupUpdateUi() { |
Alexandre Savard | 74c1cad | 2012-10-24 16:39:00 -0400 | [diff] [blame] | 351 | Log.i(TAG, "Hangup call " + mCallInfo.mCallID); |
| 352 | |
| 353 | if(mCallElementList != null) |
| 354 | mCallElementList.removeCall(this); |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 355 | |
| 356 | if(mHome != null) |
| 357 | mHome.onUnselectedCallAction(); |
Alexandre Savard | 4f42ade | 2012-10-24 18:03:31 -0400 | [diff] [blame] | 358 | } |
| 359 | |
| 360 | /** |
| 361 | * Perform hangup action and send request to the service |
| 362 | */ |
| 363 | public void notifyServiceHangup(ISipService service) |
| 364 | { |
Alexandre Savard | 74c1cad | 2012-10-24 16:39:00 -0400 | [diff] [blame] | 365 | try { |
| 366 | service.hangUp(mCallInfo.mCallID); |
| 367 | } catch (RemoteException e) { |
| 368 | Log.e(TAG, "Cannot call service method", e); |
| 369 | } |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 370 | } |
Alexandre Savard | aef9d80 | 2012-09-20 17:31:32 -0400 | [diff] [blame] | 371 | |
Alexandre Savard | 8386985 | 2012-10-26 09:14:12 -0400 | [diff] [blame] | 372 | public void notifyServiceRefuse(ISipService service) |
| 373 | { |
| 374 | try { |
| 375 | service.refuse(mCallInfo.mCallID); |
| 376 | } catch (RemoteException e) { |
| 377 | Log.e(TAG, "Cannot call service method", e); |
| 378 | } |
| 379 | } |
| 380 | |
Alexandre Savard | e9dc899 | 2012-10-26 12:12:27 -0400 | [diff] [blame] | 381 | public void notifyServiceHold(ISipService service) |
| 382 | { |
| 383 | try { |
| 384 | service.hold(mCallInfo.mCallID); |
| 385 | } catch (RemoteException e) { |
| 386 | Log.e(TAG, "Cannot call service method", e); |
| 387 | } |
| 388 | } |
| 389 | |
| 390 | public void notifyServiceUnhold(ISipService service) |
| 391 | { |
| 392 | try { |
| 393 | service.unhold(mCallInfo.mCallID); |
| 394 | } catch (RemoteException e) { |
| 395 | Log.e(TAG, "Cannot call service method", e); |
| 396 | } |
| 397 | } |
Alexandre Savard | 8386985 | 2012-10-26 09:14:12 -0400 | [diff] [blame] | 398 | |
Alexandre Savard | aef9d80 | 2012-09-20 17:31:32 -0400 | [diff] [blame] | 399 | public void addToConference() |
| 400 | { |
| 401 | Log.i(TAG, "Add call to conference"); |
| 402 | } |
| 403 | |
| 404 | public void sendTextMessage() |
| 405 | { |
| 406 | Log.i(TAG, "Send text message"); |
| 407 | } |
Alexandre Savard | 3bdce7b | 2012-10-24 18:27:45 -0400 | [diff] [blame] | 408 | |
Alexandre Savard | 73bc56f | 2012-10-25 13:35:54 -0400 | [diff] [blame] | 409 | public void printCallInfo() |
| 410 | { |
| 411 | Log.i(TAG, "CallInfo: CallID: " + mCallInfo.mCallID); |
| 412 | Log.i(TAG, " AccountID: " + mCallInfo.mAccountID); |
| 413 | Log.i(TAG, " Display Name: " + mCallInfo.mDisplayName); |
| 414 | Log.i(TAG, " Phone: " + mCallInfo.mPhone); |
| 415 | Log.i(TAG, " Email: " + mCallInfo.mEmail); |
| 416 | Log.i(TAG, " Contact: " + mCallInfo.mRemoteContact); |
| 417 | } |
| 418 | |
Alexandre Savard | 3bdce7b | 2012-10-24 18:27:45 -0400 | [diff] [blame] | 419 | public void launchCallActivity(Context context) |
| 420 | { |
| 421 | Log.i(TAG, "Launch Call Activity"); |
| 422 | Bundle bundle = new Bundle(); |
| 423 | bundle.putParcelable("CallInfo", mCallInfo); |
| 424 | Intent intent = new Intent().setClass(context, CallActivity.class); |
| 425 | intent.putExtras(bundle); |
| 426 | context.startActivity(intent); |
| 427 | } |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 428 | } |