Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 1 | /* |
Alexandre Lision | c1024c0 | 2014-01-06 11:12:53 -0500 | [diff] [blame] | 2 | * Copyright (C) 2004-2014 Savoir-Faire Linux Inc. |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 3 | * |
Alexandre Lision | 6885547 | 2013-10-10 16:20:46 -0400 | [diff] [blame] | 4 | * Author: Alexandre Lision <alexandre.lision@savoirfairelinux> |
| 5 | * Alexandre Savard <alexandre.savard@gmail.com> |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 3 of the License, or |
| 10 | * (at your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 20 | * |
| 21 | * Additional permission under GNU GPL version 3 section 7: |
| 22 | * |
| 23 | * If you modify this program, or any covered work, by linking or |
| 24 | * combining it with the OpenSSL project's OpenSSL library (or a |
| 25 | * modified version of that library), containing parts covered by the |
| 26 | * terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc. |
| 27 | * grants you additional permission to convey the resulting work. |
| 28 | * Corresponding Source for a non-source form of such a combination |
| 29 | * shall include the source code for the parts of OpenSSL used as well |
| 30 | * as that of the covered work. |
| 31 | */ |
Alexandre Lision | 064e1e0 | 2013-10-01 16:18:42 -0400 | [diff] [blame] | 32 | package org.sflphone.model; |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 33 | |
Alexandre Lision | a7ab2e3 | 2014-02-14 15:33:33 -0500 | [diff] [blame] | 34 | import android.os.Bundle; |
Alexandre Savard | 557a574 | 2012-10-24 13:54:53 -0400 | [diff] [blame] | 35 | import android.os.Parcel; |
alision | a432515 | 2013-04-19 11:10:03 -0400 | [diff] [blame] | 36 | import android.os.Parcelable; |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 37 | import android.util.Log; |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 38 | |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 39 | public class SipCall implements Parcelable { |
alision | 371b77e | 2013-04-23 14:51:26 -0400 | [diff] [blame] | 40 | |
Alexandre Lision | a7ab2e3 | 2014-02-14 15:33:33 -0500 | [diff] [blame] | 41 | public static String ID = "id"; |
| 42 | public static String ACCOUNT = "account"; |
| 43 | public static String CONTACT = "contcat"; |
| 44 | public static String TYPE = "type"; |
| 45 | public static String STATE = "state"; |
| 46 | |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 47 | private static final String TAG = SipCall.class.getSimpleName(); |
Alexandre Savard | 2f1ae54 | 2012-10-26 17:05:00 -0400 | [diff] [blame] | 48 | |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 49 | private String mCallID = ""; |
Alexandre Lision | 3ee516e | 2013-10-07 17:32:15 -0400 | [diff] [blame] | 50 | private Account mAccount = null; |
Alexandre Lision | a7ab2e3 | 2014-02-14 15:33:33 -0500 | [diff] [blame] | 51 | private CallContact mContact = null; |
alision | df1dac9 | 2013-06-27 17:35:53 -0400 | [diff] [blame] | 52 | private boolean isRecording = false; |
Alexandre Lision | 945e461 | 2014-01-15 17:40:31 -0500 | [diff] [blame] | 53 | private long timestampStart_ = 0; |
| 54 | private long timestampEnd_ = 0; |
| 55 | |
Alexandre Lision | 67c70b4 | 2014-01-16 13:57:15 -0500 | [diff] [blame] | 56 | private int mCallType; |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 57 | private int mCallState = state.CALL_STATE_NONE; |
Alexandre Savard | 2b01c82 | 2012-09-20 15:00:37 -0400 | [diff] [blame] | 58 | |
Alexandre Lision | 8162f4c | 2014-02-14 16:45:49 -0500 | [diff] [blame] | 59 | public SipCall(SipCall call) { |
| 60 | mCallID = call.mCallID; |
| 61 | mAccount = call.mAccount; |
| 62 | mContact = call.mContact; |
| 63 | isRecording = call.isRecording; |
| 64 | timestampStart_ = call.timestampStart_; |
| 65 | timestampEnd_ = call.timestampEnd_; |
| 66 | mCallType = call.mCallType; |
| 67 | mCallState = call.mCallState; |
| 68 | } |
| 69 | |
Alexandre Lision | 945e461 | 2014-01-15 17:40:31 -0500 | [diff] [blame] | 70 | /** |
| 71 | * ********************* |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 72 | * Construtors |
Alexandre Lision | 945e461 | 2014-01-15 17:40:31 -0500 | [diff] [blame] | 73 | * ********************* |
| 74 | */ |
Alexandre Savard | 557a574 | 2012-10-24 13:54:53 -0400 | [diff] [blame] | 75 | |
Alexandre Lision | a7ab2e3 | 2014-02-14 15:33:33 -0500 | [diff] [blame] | 76 | protected SipCall(Parcel in) { |
Alexandre Savard | 557a574 | 2012-10-24 13:54:53 -0400 | [diff] [blame] | 77 | |
Alexandre Lision | d568603 | 2013-10-29 11:09:21 -0400 | [diff] [blame] | 78 | mCallID = in.readString(); |
Alexandre Lision | 3ee516e | 2013-10-07 17:32:15 -0400 | [diff] [blame] | 79 | mAccount = in.readParcelable(Account.class.getClassLoader()); |
Alexandre Lision | a7ab2e3 | 2014-02-14 15:33:33 -0500 | [diff] [blame] | 80 | mContact = in.readParcelable(CallContact.class.getClassLoader()); |
alision | df1dac9 | 2013-06-27 17:35:53 -0400 | [diff] [blame] | 81 | isRecording = in.readByte() == 1; |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 82 | mCallType = in.readInt(); |
| 83 | mCallState = in.readInt(); |
Alexandre Lision | 945e461 | 2014-01-15 17:40:31 -0500 | [diff] [blame] | 84 | timestampStart_ = in.readLong(); |
| 85 | timestampEnd_ = in.readLong(); |
| 86 | } |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 87 | |
Alexandre Lision | a7ab2e3 | 2014-02-14 15:33:33 -0500 | [diff] [blame] | 88 | public SipCall(Bundle args) { |
| 89 | mCallID = args.getString(ID); |
| 90 | mAccount = args.getParcelable(ACCOUNT); |
| 91 | mCallType = args.getInt(TYPE); |
| 92 | mCallState = args.getInt(STATE); |
| 93 | mContact = args.getParcelable(CONTACT); |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 94 | } |
| 95 | |
Alexandre Lision | 945e461 | 2014-01-15 17:40:31 -0500 | [diff] [blame] | 96 | public long getTimestampEnd_() { |
| 97 | return timestampEnd_; |
| 98 | } |
| 99 | |
| 100 | public String getRecordPath() { |
| 101 | return ""; |
| 102 | } |
| 103 | |
Alexandre Lision | 183bf45 | 2014-01-17 11:21:59 -0500 | [diff] [blame] | 104 | public int getCallType() { |
| 105 | return mCallType; |
| 106 | } |
| 107 | |
Alexandre Lision | a7ab2e3 | 2014-02-14 15:33:33 -0500 | [diff] [blame] | 108 | public Bundle getBundle() { |
| 109 | Bundle args = new Bundle(); |
| 110 | args.putString(SipCall.ID, mCallID); |
| 111 | args.putParcelable(SipCall.ACCOUNT, mAccount); |
| 112 | args.putInt(SipCall.STATE, mCallState); |
| 113 | args.putInt(SipCall.TYPE, mCallType); |
| 114 | args.putParcelable(SipCall.CONTACT, mContact); |
| 115 | return args; |
Alexandre Lision | 5f144b8 | 2014-02-11 09:59:36 -0500 | [diff] [blame] | 116 | } |
| 117 | |
Alexandre Lision | a7ab2e3 | 2014-02-14 15:33:33 -0500 | [diff] [blame] | 118 | |
Alexandre Lision | 67c70b4 | 2014-01-16 13:57:15 -0500 | [diff] [blame] | 119 | public interface direction { |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 120 | public static final int CALL_TYPE_INCOMING = 1; |
| 121 | public static final int CALL_TYPE_OUTGOING = 2; |
Alexandre Lision | 67c70b4 | 2014-01-16 13:57:15 -0500 | [diff] [blame] | 122 | } |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 123 | |
Alexandre Lision | 67c70b4 | 2014-01-16 13:57:15 -0500 | [diff] [blame] | 124 | public interface state { |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 125 | public static final int CALL_STATE_NONE = 0; |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 126 | public static final int CALL_STATE_RINGING = 2; |
| 127 | public static final int CALL_STATE_CURRENT = 3; |
| 128 | public static final int CALL_STATE_HUNGUP = 4; |
| 129 | public static final int CALL_STATE_BUSY = 5; |
| 130 | public static final int CALL_STATE_FAILURE = 6; |
| 131 | public static final int CALL_STATE_HOLD = 7; |
| 132 | public static final int CALL_STATE_UNHOLD = 8; |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 133 | } |
| 134 | |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 135 | @Override |
| 136 | public int describeContents() { |
| 137 | return 0; |
| 138 | } |
| 139 | |
| 140 | @Override |
| 141 | public void writeToParcel(Parcel out, int flags) { |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 142 | |
Alexandre Lision | d568603 | 2013-10-29 11:09:21 -0400 | [diff] [blame] | 143 | out.writeString(mCallID); |
Alexandre Lision | 3ee516e | 2013-10-07 17:32:15 -0400 | [diff] [blame] | 144 | out.writeParcelable(mAccount, 0); |
| 145 | |
Alexandre Lision | a7ab2e3 | 2014-02-14 15:33:33 -0500 | [diff] [blame] | 146 | out.writeParcelable(mContact, 0); |
alision | df1dac9 | 2013-06-27 17:35:53 -0400 | [diff] [blame] | 147 | out.writeByte((byte) (isRecording ? 1 : 0)); |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 148 | out.writeInt(mCallType); |
| 149 | out.writeInt(mCallState); |
Alexandre Lision | 945e461 | 2014-01-15 17:40:31 -0500 | [diff] [blame] | 150 | out.writeLong(timestampStart_); |
| 151 | out.writeLong(timestampEnd_); |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 152 | } |
| 153 | |
| 154 | public static final Parcelable.Creator<SipCall> CREATOR = new Parcelable.Creator<SipCall>() { |
| 155 | public SipCall createFromParcel(Parcel in) { |
| 156 | return new SipCall(in); |
| 157 | } |
| 158 | |
| 159 | public SipCall[] newArray(int size) { |
| 160 | return new SipCall[size]; |
| 161 | } |
| 162 | }; |
| 163 | |
Alexandre Savard | c58c0fd | 2012-10-25 10:44:08 -0400 | [diff] [blame] | 164 | public void setCallID(String callID) { |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 165 | mCallID = callID; |
Alexandre Savard | c58c0fd | 2012-10-25 10:44:08 -0400 | [diff] [blame] | 166 | } |
| 167 | |
| 168 | public String getCallId() { |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 169 | return mCallID; |
Alexandre Savard | c58c0fd | 2012-10-25 10:44:08 -0400 | [diff] [blame] | 170 | } |
| 171 | |
Alexandre Lision | 945e461 | 2014-01-15 17:40:31 -0500 | [diff] [blame] | 172 | public long getTimestampStart_() { |
| 173 | return timestampStart_; |
Alexandre Lision | 3c6b710 | 2013-09-16 16:56:46 -0400 | [diff] [blame] | 174 | } |
| 175 | |
Alexandre Lision | 945e461 | 2014-01-15 17:40:31 -0500 | [diff] [blame] | 176 | public void setTimestampStart_(long timestampStart_) { |
| 177 | this.timestampStart_ = timestampStart_; |
| 178 | } |
| 179 | |
| 180 | public void setTimestampEnd_(long timestampEnd_) { |
| 181 | this.timestampEnd_ = timestampEnd_; |
Alexandre Lision | 3c6b710 | 2013-09-16 16:56:46 -0400 | [diff] [blame] | 182 | } |
| 183 | |
Alexandre Lision | 3ee516e | 2013-10-07 17:32:15 -0400 | [diff] [blame] | 184 | public void setAccount(Account account) { |
| 185 | mAccount = account; |
Alexandre Savard | 73bc56f | 2012-10-25 13:35:54 -0400 | [diff] [blame] | 186 | } |
| 187 | |
Alexandre Lision | 3ee516e | 2013-10-07 17:32:15 -0400 | [diff] [blame] | 188 | public Account getAccount() { |
| 189 | return mAccount; |
Alexandre Savard | c58c0fd | 2012-10-25 10:44:08 -0400 | [diff] [blame] | 190 | } |
| 191 | |
alision | 8570418 | 2013-05-29 15:23:03 -0400 | [diff] [blame] | 192 | public String getCallTypeString() { |
| 193 | switch (mCallType) { |
Alexandre Lision | 67c70b4 | 2014-01-16 13:57:15 -0500 | [diff] [blame] | 194 | case direction.CALL_TYPE_INCOMING: |
Alexandre Lision | 945e461 | 2014-01-15 17:40:31 -0500 | [diff] [blame] | 195 | return "CALL_TYPE_INCOMING"; |
Alexandre Lision | 67c70b4 | 2014-01-16 13:57:15 -0500 | [diff] [blame] | 196 | case direction.CALL_TYPE_OUTGOING: |
Alexandre Lision | 945e461 | 2014-01-15 17:40:31 -0500 | [diff] [blame] | 197 | return "CALL_TYPE_OUTGOING"; |
| 198 | default: |
| 199 | return "CALL_TYPE_UNDETERMINED"; |
alision | 8570418 | 2013-05-29 15:23:03 -0400 | [diff] [blame] | 200 | } |
| 201 | } |
| 202 | |
Alexandre Savard | c58c0fd | 2012-10-25 10:44:08 -0400 | [diff] [blame] | 203 | public void setCallState(int callState) { |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 204 | mCallState = callState; |
Alexandre Savard | c58c0fd | 2012-10-25 10:44:08 -0400 | [diff] [blame] | 205 | } |
| 206 | |
Alexandre Lision | a7ab2e3 | 2014-02-14 15:33:33 -0500 | [diff] [blame] | 207 | public CallContact getmContact() { |
| 208 | return mContact; |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 209 | } |
| 210 | |
Alexandre Lision | a7ab2e3 | 2014-02-14 15:33:33 -0500 | [diff] [blame] | 211 | public void setmContact(CallContact contacts) { |
| 212 | mContact = contacts; |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 213 | } |
| 214 | |
Alexandre Savard | df54426 | 2012-10-25 14:24:08 -0400 | [diff] [blame] | 215 | public String getCallStateString() { |
Alexandre Savard | df54426 | 2012-10-25 14:24:08 -0400 | [diff] [blame] | 216 | |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 217 | String text_state; |
| 218 | |
| 219 | switch (mCallState) { |
Alexandre Lision | 945e461 | 2014-01-15 17:40:31 -0500 | [diff] [blame] | 220 | case state.CALL_STATE_RINGING: |
| 221 | text_state = "RINGING"; |
| 222 | break; |
| 223 | case state.CALL_STATE_CURRENT: |
| 224 | text_state = "CURRENT"; |
| 225 | break; |
| 226 | case state.CALL_STATE_HUNGUP: |
| 227 | text_state = "HUNGUP"; |
| 228 | break; |
| 229 | case state.CALL_STATE_BUSY: |
| 230 | text_state = "BUSY"; |
| 231 | break; |
| 232 | case state.CALL_STATE_FAILURE: |
| 233 | text_state = "FAILURE"; |
| 234 | break; |
| 235 | case state.CALL_STATE_HOLD: |
| 236 | text_state = "HOLD"; |
| 237 | break; |
| 238 | case state.CALL_STATE_UNHOLD: |
| 239 | text_state = "UNHOLD"; |
| 240 | break; |
| 241 | default: |
| 242 | text_state = "NULL"; |
Alexandre Savard | df54426 | 2012-10-25 14:24:08 -0400 | [diff] [blame] | 243 | } |
| 244 | |
alision | fde875f | 2013-05-28 17:01:54 -0400 | [diff] [blame] | 245 | return text_state; |
Alexandre Savard | df54426 | 2012-10-25 14:24:08 -0400 | [diff] [blame] | 246 | } |
| 247 | |
alision | df1dac9 | 2013-06-27 17:35:53 -0400 | [diff] [blame] | 248 | public boolean isRecording() { |
| 249 | return isRecording; |
| 250 | } |
| 251 | |
| 252 | public void setRecording(boolean isRecording) { |
| 253 | this.isRecording = isRecording; |
| 254 | } |
| 255 | |
alision | 8570418 | 2013-05-29 15:23:03 -0400 | [diff] [blame] | 256 | public void printCallInfo() { |
| 257 | Log.i(TAG, "CallInfo: CallID: " + mCallID); |
Alexandre Lision | 3ee516e | 2013-10-07 17:32:15 -0400 | [diff] [blame] | 258 | Log.i(TAG, " AccountID: " + mAccount.getAccountID()); |
alision | 8570418 | 2013-05-29 15:23:03 -0400 | [diff] [blame] | 259 | Log.i(TAG, " CallState: " + mCallState); |
| 260 | Log.i(TAG, " CallType: " + mCallType); |
| 261 | } |
Alexandre Savard | 73bc56f | 2012-10-25 13:35:54 -0400 | [diff] [blame] | 262 | |
alision | 5f89963 | 2013-04-22 17:26:56 -0400 | [diff] [blame] | 263 | /** |
| 264 | * Compare sip calls based on call ID |
| 265 | */ |
| 266 | @Override |
alision | 11e8e16 | 2013-05-28 10:33:14 -0400 | [diff] [blame] | 267 | public boolean equals(Object c) { |
alision | 465ceba | 2013-07-04 09:24:30 -0400 | [diff] [blame] | 268 | if (c instanceof SipCall && ((SipCall) c).mCallID.contentEquals((mCallID))) { |
alision | 5f89963 | 2013-04-22 17:26:56 -0400 | [diff] [blame] | 269 | return true; |
| 270 | } |
| 271 | return false; |
alision | 11e8e16 | 2013-05-28 10:33:14 -0400 | [diff] [blame] | 272 | |
alision | 5f89963 | 2013-04-22 17:26:56 -0400 | [diff] [blame] | 273 | } |
alision | 7f18fc8 | 2013-05-01 09:37:33 -0400 | [diff] [blame] | 274 | |
alision | 8570418 | 2013-05-29 15:23:03 -0400 | [diff] [blame] | 275 | public boolean isOutGoing() { |
Alexandre Lision | 67c70b4 | 2014-01-16 13:57:15 -0500 | [diff] [blame] | 276 | if (mCallType == direction.CALL_TYPE_OUTGOING) |
alision | 8570418 | 2013-05-29 15:23:03 -0400 | [diff] [blame] | 277 | return true; |
alision | 8570418 | 2013-05-29 15:23:03 -0400 | [diff] [blame] | 278 | return false; |
| 279 | } |
| 280 | |
| 281 | public boolean isRinging() { |
| 282 | if (mCallState == state.CALL_STATE_RINGING || mCallState == state.CALL_STATE_NONE) |
| 283 | return true; |
| 284 | |
| 285 | return false; |
| 286 | } |
| 287 | |
| 288 | public boolean isIncoming() { |
Alexandre Lision | 67c70b4 | 2014-01-16 13:57:15 -0500 | [diff] [blame] | 289 | if (mCallType == direction.CALL_TYPE_INCOMING) |
alision | 8570418 | 2013-05-29 15:23:03 -0400 | [diff] [blame] | 290 | return true; |
| 291 | |
| 292 | return false; |
| 293 | } |
| 294 | |
| 295 | public void setCallState(String newState) { |
Alexandre Lision | 707f908 | 2014-01-16 15:09:07 -0500 | [diff] [blame] | 296 | if (newState.equals("RINGING")) { |
alision | 8570418 | 2013-05-29 15:23:03 -0400 | [diff] [blame] | 297 | setCallState(SipCall.state.CALL_STATE_RINGING); |
| 298 | } else if (newState.equals("CURRENT")) { |
| 299 | setCallState(SipCall.state.CALL_STATE_CURRENT); |
| 300 | } else if (newState.equals("HUNGUP")) { |
| 301 | setCallState(SipCall.state.CALL_STATE_HUNGUP); |
| 302 | } else if (newState.equals("BUSY")) { |
| 303 | setCallState(SipCall.state.CALL_STATE_BUSY); |
| 304 | } else if (newState.equals("FAILURE")) { |
| 305 | setCallState(SipCall.state.CALL_STATE_FAILURE); |
| 306 | } else if (newState.equals("HOLD")) { |
| 307 | setCallState(SipCall.state.CALL_STATE_HOLD); |
| 308 | } else if (newState.equals("UNHOLD")) { |
| 309 | setCallState(SipCall.state.CALL_STATE_CURRENT); |
| 310 | } else { |
| 311 | setCallState(SipCall.state.CALL_STATE_NONE); |
| 312 | } |
alision | 907bde7 | 2013-06-20 14:40:37 -0400 | [diff] [blame] | 313 | |
alision | 8570418 | 2013-05-29 15:23:03 -0400 | [diff] [blame] | 314 | } |
| 315 | |
| 316 | public boolean isOngoing() { |
alision | 907bde7 | 2013-06-20 14:40:37 -0400 | [diff] [blame] | 317 | if (mCallState == state.CALL_STATE_RINGING || mCallState == state.CALL_STATE_NONE || mCallState == state.CALL_STATE_FAILURE |
| 318 | || mCallState == state.CALL_STATE_BUSY || mCallState == state.CALL_STATE_HUNGUP) |
alision | 8570418 | 2013-05-29 15:23:03 -0400 | [diff] [blame] | 319 | return false; |
| 320 | |
| 321 | return true; |
| 322 | } |
alision | 04a0018 | 2013-05-10 17:05:29 -0400 | [diff] [blame] | 323 | |
alision | df1dac9 | 2013-06-27 17:35:53 -0400 | [diff] [blame] | 324 | public boolean isOnHold() { |
| 325 | return mCallState == state.CALL_STATE_HOLD; |
| 326 | } |
| 327 | |
Alexandre Lision | 6ae652d | 2013-09-26 16:39:20 -0400 | [diff] [blame] | 328 | public boolean isCurrent() { |
| 329 | return mCallState == state.CALL_STATE_CURRENT; |
| 330 | } |
Alexandre Lision | 5f144b8 | 2014-02-11 09:59:36 -0500 | [diff] [blame] | 331 | |
Alexandre Lision | 5f144b8 | 2014-02-11 09:59:36 -0500 | [diff] [blame] | 332 | |
Alexandre Savard | 4a19d75 | 2012-09-19 13:19:24 -0400 | [diff] [blame] | 333 | } |