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 | de82007 | 2012-10-26 15:39:21 -0400 | [diff] [blame^] | 209 | |
| 210 | // Check if this call is associated to a view in CallElementList |
Alexandre Savard | d197653 | 2012-10-26 15:32:45 -0400 | [diff] [blame] | 211 | if(mRowView == null) |
| 212 | return; |
| 213 | |
Alexandre Savard | de82007 | 2012-10-26 15:39:21 -0400 | [diff] [blame^] | 214 | // Update the state to the view |
Alexandre Savard | d197653 | 2012-10-26 15:32:45 -0400 | [diff] [blame] | 215 | CallElementView entryView = (CallElementView) mRowView.getTag(); |
| 216 | final String CURRENT_STATE_LABEL = " CURRENT STATE: "; |
| 217 | entryView.state.setText(CURRENT_STATE_LABEL + getCallStateString()); |
Alexandre Savard | c58c0fd | 2012-10-25 10:44:08 -0400 | [diff] [blame] | 218 | } |
| 219 | |
Alexandre Savard | df54426 | 2012-10-25 14:24:08 -0400 | [diff] [blame] | 220 | public int getCallStateInt() { |
Alexandre Savard | c58c0fd | 2012-10-25 10:44:08 -0400 | [diff] [blame] | 221 | return mCallInfo.mCallState; |
| 222 | } |
| 223 | |
Alexandre Savard | df54426 | 2012-10-25 14:24:08 -0400 | [diff] [blame] | 224 | public String getCallStateString() { |
| 225 | String state; |
| 226 | |
| 227 | switch(mCallInfo.mCallState) { |
| 228 | case CALL_STATE_INCOMING: |
| 229 | state = "INCOMING"; |
| 230 | break; |
| 231 | case CALL_STATE_RINGING: |
| 232 | state = "RINGING"; |
| 233 | break; |
| 234 | case CALL_STATE_CURRENT: |
| 235 | state = "CURRENT"; |
| 236 | break; |
| 237 | case CALL_STATE_HUNGUP: |
| 238 | state = "HUNGUP"; |
| 239 | break; |
| 240 | case CALL_STATE_BUSY: |
| 241 | state = "BUSY"; |
| 242 | break; |
| 243 | case CALL_STATE_FAILURE: |
| 244 | state = "FAILURE"; |
| 245 | break; |
| 246 | case CALL_STATE_HOLD: |
| 247 | state = "HOLD"; |
| 248 | break; |
| 249 | case CALL_STATE_UNHOLD: |
| 250 | state = "UNHOLD"; |
| 251 | break; |
| 252 | default: |
| 253 | state = "NULL"; |
| 254 | } |
| 255 | |
| 256 | return state; |
| 257 | } |
| 258 | |
| 259 | |
Alexandre Savard | c58c0fd | 2012-10-25 10:44:08 -0400 | [diff] [blame] | 260 | public void setMediaState(int mediaState) { |
| 261 | mCallInfo.mMediaState = mediaState; |
| 262 | } |
| 263 | |
| 264 | public int getMediaState() { |
| 265 | return mCallInfo.mMediaState; |
| 266 | } |
| 267 | |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 268 | public void placeCallUpdateUi() |
| 269 | { |
| 270 | if(mCallElementList != null) |
| 271 | mCallElementList.addCall(this); |
| 272 | |
| 273 | if(mHome != null) |
| 274 | mHome.onSelectedCallAction(this); |
| 275 | } |
| 276 | |
Alexandre Savard | 27a5113 | 2012-10-25 18:35:14 -0400 | [diff] [blame] | 277 | public void notifyServicePlaceCall(ISipService service) |
| 278 | { |
| 279 | try { |
| 280 | service.placeCall(mCallInfo.mAccountID, mCallInfo.mCallID, mCallInfo.mPhone); |
| 281 | } catch (RemoteException e) { |
| 282 | Log.e(TAG, "Cannot call service method", e); |
| 283 | } |
| 284 | } |
| 285 | |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 286 | public void receiveCallUpdateUi() |
Alexandre Savard | 23240c1 | 2012-09-19 18:23:44 -0400 | [diff] [blame] | 287 | { |
Alexandre Savard | 74c1cad | 2012-10-24 16:39:00 -0400 | [diff] [blame] | 288 | if(mCallElementList != null) |
| 289 | mCallElementList.addCall(this); |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 290 | |
| 291 | if(mHome != null) |
| 292 | mHome.onSelectedCallAction(this); |
Alexandre Savard | 73bc56f | 2012-10-25 13:35:54 -0400 | [diff] [blame] | 293 | } |
| 294 | |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 295 | public void answerUpdateUi() |
Alexandre Savard | 73bc56f | 2012-10-25 13:35:54 -0400 | [diff] [blame] | 296 | { |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 297 | if(mHome != null) |
| 298 | mHome.onSelectedCallAction(this); |
Alexandre Savard | f17e317 | 2012-10-25 16:09:09 -0400 | [diff] [blame] | 299 | |
| 300 | } |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 301 | |
Alexandre Savard | f17e317 | 2012-10-25 16:09:09 -0400 | [diff] [blame] | 302 | public void notifyServiceAnswer(ISipService service) |
| 303 | { |
Alexandre Savard | 27a5113 | 2012-10-25 18:35:14 -0400 | [diff] [blame] | 304 | int callState = getCallStateInt(); |
| 305 | if((callState != CALL_STATE_RINGING) && |
| 306 | (callState != CALL_STATE_NONE)) { |
Alexandre Savard | f17e317 | 2012-10-25 16:09:09 -0400 | [diff] [blame] | 307 | return; |
Alexandre Savard | 27a5113 | 2012-10-25 18:35:14 -0400 | [diff] [blame] | 308 | } |
Alexandre Savard | f17e317 | 2012-10-25 16:09:09 -0400 | [diff] [blame] | 309 | |
| 310 | try { |
| 311 | service.accept(mCallInfo.mCallID); |
| 312 | } catch (RemoteException e) { |
| 313 | Log.e(TAG, "Cannot call service method", e); |
| 314 | } |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 315 | } |
| 316 | |
Alexandre Savard | 4f42ade | 2012-10-24 18:03:31 -0400 | [diff] [blame] | 317 | /** |
| 318 | * Perform hangup action without sending request to the service |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 319 | * Used when SipService haved been notified that this call hung up |
Alexandre Savard | 4f42ade | 2012-10-24 18:03:31 -0400 | [diff] [blame] | 320 | */ |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 321 | public void hangupUpdateUi() { |
Alexandre Savard | 74c1cad | 2012-10-24 16:39:00 -0400 | [diff] [blame] | 322 | Log.i(TAG, "Hangup call " + mCallInfo.mCallID); |
| 323 | |
| 324 | if(mCallElementList != null) |
| 325 | mCallElementList.removeCall(this); |
Alexandre Savard | a949eec | 2012-10-25 17:30:49 -0400 | [diff] [blame] | 326 | |
| 327 | if(mHome != null) |
| 328 | mHome.onUnselectedCallAction(); |
Alexandre Savard | 4f42ade | 2012-10-24 18:03:31 -0400 | [diff] [blame] | 329 | } |
| 330 | |
| 331 | /** |
| 332 | * Perform hangup action and send request to the service |
| 333 | */ |
| 334 | public void notifyServiceHangup(ISipService service) |
| 335 | { |
Alexandre Savard | 74c1cad | 2012-10-24 16:39:00 -0400 | [diff] [blame] | 336 | try { |
| 337 | service.hangUp(mCallInfo.mCallID); |
| 338 | } catch (RemoteException e) { |
| 339 | Log.e(TAG, "Cannot call service method", e); |
| 340 | } |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 341 | } |
Alexandre Savard | aef9d80 | 2012-09-20 17:31:32 -0400 | [diff] [blame] | 342 | |
Alexandre Savard | 8386985 | 2012-10-26 09:14:12 -0400 | [diff] [blame] | 343 | public void notifyServiceRefuse(ISipService service) |
| 344 | { |
| 345 | try { |
| 346 | service.refuse(mCallInfo.mCallID); |
| 347 | } catch (RemoteException e) { |
| 348 | Log.e(TAG, "Cannot call service method", e); |
| 349 | } |
| 350 | } |
| 351 | |
Alexandre Savard | e9dc899 | 2012-10-26 12:12:27 -0400 | [diff] [blame] | 352 | public void notifyServiceHold(ISipService service) |
| 353 | { |
| 354 | try { |
| 355 | service.hold(mCallInfo.mCallID); |
| 356 | } catch (RemoteException e) { |
| 357 | Log.e(TAG, "Cannot call service method", e); |
| 358 | } |
| 359 | } |
| 360 | |
| 361 | public void notifyServiceUnhold(ISipService service) |
| 362 | { |
| 363 | try { |
| 364 | service.unhold(mCallInfo.mCallID); |
| 365 | } catch (RemoteException e) { |
| 366 | Log.e(TAG, "Cannot call service method", e); |
| 367 | } |
| 368 | } |
Alexandre Savard | 8386985 | 2012-10-26 09:14:12 -0400 | [diff] [blame] | 369 | |
Alexandre Savard | aef9d80 | 2012-09-20 17:31:32 -0400 | [diff] [blame] | 370 | public void addToConference() |
| 371 | { |
| 372 | Log.i(TAG, "Add call to conference"); |
| 373 | } |
| 374 | |
| 375 | public void sendTextMessage() |
| 376 | { |
| 377 | Log.i(TAG, "Send text message"); |
| 378 | } |
Alexandre Savard | 3bdce7b | 2012-10-24 18:27:45 -0400 | [diff] [blame] | 379 | |
Alexandre Savard | 73bc56f | 2012-10-25 13:35:54 -0400 | [diff] [blame] | 380 | public void printCallInfo() |
| 381 | { |
| 382 | Log.i(TAG, "CallInfo: CallID: " + mCallInfo.mCallID); |
| 383 | Log.i(TAG, " AccountID: " + mCallInfo.mAccountID); |
| 384 | Log.i(TAG, " Display Name: " + mCallInfo.mDisplayName); |
| 385 | Log.i(TAG, " Phone: " + mCallInfo.mPhone); |
| 386 | Log.i(TAG, " Email: " + mCallInfo.mEmail); |
| 387 | Log.i(TAG, " Contact: " + mCallInfo.mRemoteContact); |
| 388 | } |
| 389 | |
Alexandre Savard | 3bdce7b | 2012-10-24 18:27:45 -0400 | [diff] [blame] | 390 | public void launchCallActivity(Context context) |
| 391 | { |
| 392 | Log.i(TAG, "Launch Call Activity"); |
| 393 | Bundle bundle = new Bundle(); |
| 394 | bundle.putParcelable("CallInfo", mCallInfo); |
| 395 | Intent intent = new Intent().setClass(context, CallActivity.class); |
| 396 | intent.putExtras(bundle); |
| 397 | context.startActivity(intent); |
| 398 | } |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 399 | } |