blob: 606fcb4239e5e2c763ca4615df70df4ac259aee8 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2006 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;
18
19import android.os.Bundle;
20import android.os.Parcel;
21import android.os.Parcelable;
Wink Saville599a90c2012-11-27 12:29:13 -080022import android.telephony.Rlog;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080023
24/**
25 * Contains phone state and service related information.
26 *
27 * The following phone information is included in returned ServiceState:
28 *
29 * <ul>
30 * <li>Service state: IN_SERVICE, OUT_OF_SERVICE, EMERGENCY_ONLY, POWER_OFF
31 * <li>Roaming indicator
32 * <li>Operator name, short name and numeric id
33 * <li>Network selection mode
34 * </ul>
35 */
36public class ServiceState implements Parcelable {
37
Wink Saville767a6622009-04-02 01:37:02 -070038 static final String LOG_TAG = "PHONE";
Wink Saville0dde2c22012-11-16 08:12:11 -080039 static final boolean DBG = true;
Wink Saville767a6622009-04-02 01:37:02 -070040
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080041 /**
42 * Normal operation condition, the phone is registered
43 * with an operator either in home network or in roaming.
44 */
45 public static final int STATE_IN_SERVICE = 0;
46
47 /**
48 * Phone is not registered with any operator, the phone
49 * can be currently searching a new operator to register to, or not
50 * searching to registration at all, or registration is denied, or radio
51 * signal is not available.
52 */
53 public static final int STATE_OUT_OF_SERVICE = 1;
54
55 /**
56 * The phone is registered and locked. Only emergency numbers are allowed. {@more}
57 */
58 public static final int STATE_EMERGENCY_ONLY = 2;
59
60 /**
Jake Hamby390de222010-05-10 18:46:45 -070061 * Radio of telephony is explicitly powered off.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080062 */
63 public static final int STATE_POWER_OFF = 3;
64
Wink Saville0dde2c22012-11-16 08:12:11 -080065 /**
66 * RIL level registration state values from ril.h
67 * ((const char **)response)[0] is registration state 0-6,
68 * 0 - Not registered, MT is not currently searching
69 * a new operator to register
70 * 1 - Registered, home network
71 * 2 - Not registered, but MT is currently searching
72 * a new operator to register
73 * 3 - Registration denied
74 * 4 - Unknown
75 * 5 - Registered, roaming
76 * 10 - Same as 0, but indicates that emergency calls
77 * are enabled.
78 * 12 - Same as 2, but indicates that emergency calls
79 * are enabled.
80 * 13 - Same as 3, but indicates that emergency calls
81 * are enabled.
82 * 14 - Same as 4, but indicates that emergency calls
83 * are enabled.
84 * @hide
85 */
86 public static final int RIL_REG_STATE_NOT_REG = 0;
87 /** @hide */
88 public static final int RIL_REG_STATE_HOME = 1;
89 /** @hide */
90 public static final int RIL_REG_STATE_SEARCHING = 2;
91 /** @hide */
92 public static final int RIL_REG_STATE_DENIED = 3;
93 /** @hide */
94 public static final int RIL_REG_STATE_UNKNOWN = 4;
95 /** @hide */
96 public static final int RIL_REG_STATE_ROAMING = 5;
97 /** @hide */
98 public static final int RIL_REG_STATE_NOT_REG_EMERGENCY_CALL_ENABLED = 10;
99 /** @hide */
100 public static final int RIL_REG_STATE_SEARCHING_EMERGENCY_CALL_ENABLED = 12;
101 /** @hide */
102 public static final int RIL_REG_STATE_DENIED_EMERGENCY_CALL_ENABLED = 13;
103 /** @hide */
104 public static final int RIL_REG_STATE_UNKNOWN_EMERGENCY_CALL_ENABLED = 14;
Wink Saville767a6622009-04-02 01:37:02 -0700105
106 /**
107 * Available radio technologies for GSM, UMTS and CDMA.
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800108 * Duplicates the constants from hardware/radio/include/ril.h
109 * This should only be used by agents working with the ril. Others
110 * should use the equivalent TelephonyManager.NETWORK_TYPE_*
Wink Saville767a6622009-04-02 01:37:02 -0700111 */
112 /** @hide */
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800113 public static final int RIL_RADIO_TECHNOLOGY_UNKNOWN = 0;
Wink Saville767a6622009-04-02 01:37:02 -0700114 /** @hide */
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800115 public static final int RIL_RADIO_TECHNOLOGY_GPRS = 1;
Wink Saville767a6622009-04-02 01:37:02 -0700116 /** @hide */
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800117 public static final int RIL_RADIO_TECHNOLOGY_EDGE = 2;
Wink Saville767a6622009-04-02 01:37:02 -0700118 /** @hide */
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800119 public static final int RIL_RADIO_TECHNOLOGY_UMTS = 3;
Wink Saville767a6622009-04-02 01:37:02 -0700120 /** @hide */
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800121 public static final int RIL_RADIO_TECHNOLOGY_IS95A = 4;
Wink Saville767a6622009-04-02 01:37:02 -0700122 /** @hide */
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800123 public static final int RIL_RADIO_TECHNOLOGY_IS95B = 5;
Wink Saville767a6622009-04-02 01:37:02 -0700124 /** @hide */
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800125 public static final int RIL_RADIO_TECHNOLOGY_1xRTT = 6;
Wink Saville767a6622009-04-02 01:37:02 -0700126 /** @hide */
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800127 public static final int RIL_RADIO_TECHNOLOGY_EVDO_0 = 7;
Wink Saville767a6622009-04-02 01:37:02 -0700128 /** @hide */
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800129 public static final int RIL_RADIO_TECHNOLOGY_EVDO_A = 8;
Li Zheebe66342009-08-14 19:22:16 +0800130 /** @hide */
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800131 public static final int RIL_RADIO_TECHNOLOGY_HSDPA = 9;
Li Zheebe66342009-08-14 19:22:16 +0800132 /** @hide */
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800133 public static final int RIL_RADIO_TECHNOLOGY_HSUPA = 10;
Li Zheebe66342009-08-14 19:22:16 +0800134 /** @hide */
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800135 public static final int RIL_RADIO_TECHNOLOGY_HSPA = 11;
Naveen Kalla0a5174a2010-04-21 14:48:03 -0700136 /** @hide */
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800137 public static final int RIL_RADIO_TECHNOLOGY_EVDO_B = 12;
Wink Saville9d7d6282011-03-12 14:52:01 -0800138 /** @hide */
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800139 public static final int RIL_RADIO_TECHNOLOGY_EHRPD = 13;
Wink Saville9d7d6282011-03-12 14:52:01 -0800140 /** @hide */
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800141 public static final int RIL_RADIO_TECHNOLOGY_LTE = 14;
Ramesh Sudinif5727612011-03-08 15:51:52 -0600142 /** @hide */
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800143 public static final int RIL_RADIO_TECHNOLOGY_HSPAP = 15;
Naveen Kallafc2cbe92011-12-29 15:07:41 -0800144 /**
145 * GSM radio technology only supports voice. It does not support data.
146 * @hide
147 */
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800148 public static final int RIL_RADIO_TECHNOLOGY_GSM = 16;
Wink Saville767a6622009-04-02 01:37:02 -0700149
150 /**
151 * Available registration states for GSM, UMTS and CDMA.
152 */
153 /** @hide */
154 public static final int REGISTRATION_STATE_NOT_REGISTERED_AND_NOT_SEARCHING = 0;
155 /** @hide */
156 public static final int REGISTRATION_STATE_HOME_NETWORK = 1;
157 /** @hide */
158 public static final int REGISTRATION_STATE_NOT_REGISTERED_AND_SEARCHING = 2;
159 /** @hide */
160 public static final int REGISTRATION_STATE_REGISTRATION_DENIED = 3;
161 /** @hide */
162 public static final int REGISTRATION_STATE_UNKNOWN = 4;
163 /** @hide */
164 public static final int REGISTRATION_STATE_ROAMING = 5;
Wink Saville767a6622009-04-02 01:37:02 -0700165
Wink Saville0dde2c22012-11-16 08:12:11 -0800166 private int mVoiceRegState = STATE_OUT_OF_SERVICE;
167 private int mDataRegState = STATE_OUT_OF_SERVICE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800168 private boolean mRoaming;
169 private String mOperatorAlphaLong;
170 private String mOperatorAlphaShort;
171 private String mOperatorNumeric;
172 private boolean mIsManualNetworkSelection;
173
John Wang56c2d2f2010-04-07 08:57:17 -0700174 private boolean mIsEmergencyOnly;
175
Wink Saville0dde2c22012-11-16 08:12:11 -0800176 private int mRilVoiceRadioTechnology;
177 private int mRilDataRadioTechnology;
178
Wink Saville767a6622009-04-02 01:37:02 -0700179 private boolean mCssIndicator;
180 private int mNetworkId;
181 private int mSystemId;
Wink Savillee9b06d72009-05-18 21:47:50 -0700182 private int mCdmaRoamingIndicator;
183 private int mCdmaDefaultRoamingIndicator;
Robert Greenwalt98e0b142009-10-08 21:15:52 -0700184 private int mCdmaEriIconIndex;
185 private int mCdmaEriIconMode;
Wink Saville767a6622009-04-02 01:37:02 -0700186
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800187 /**
188 * Create a new ServiceState from a intent notifier Bundle
189 *
190 * This method is used by PhoneStateIntentReceiver and maybe by
191 * external applications.
192 *
193 * @param m Bundle from intent notifier
194 * @return newly created ServiceState
195 * @hide
196 */
197 public static ServiceState newFromBundle(Bundle m) {
198 ServiceState ret;
199 ret = new ServiceState();
200 ret.setFromNotifierBundle(m);
201 return ret;
202 }
203
204 /**
205 * Empty constructor
206 */
207 public ServiceState() {
208 }
209
210 /**
211 * Copy constructors
212 *
213 * @param s Source service state
214 */
215 public ServiceState(ServiceState s) {
216 copyFrom(s);
217 }
218
219 protected void copyFrom(ServiceState s) {
Wink Saville0dde2c22012-11-16 08:12:11 -0800220 mVoiceRegState = s.mVoiceRegState;
221 mDataRegState = s.mDataRegState;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800222 mRoaming = s.mRoaming;
223 mOperatorAlphaLong = s.mOperatorAlphaLong;
224 mOperatorAlphaShort = s.mOperatorAlphaShort;
225 mOperatorNumeric = s.mOperatorNumeric;
226 mIsManualNetworkSelection = s.mIsManualNetworkSelection;
Wink Saville0dde2c22012-11-16 08:12:11 -0800227 mRilVoiceRadioTechnology = s.mRilVoiceRadioTechnology;
228 mRilDataRadioTechnology = s.mRilDataRadioTechnology;
Wink Saville767a6622009-04-02 01:37:02 -0700229 mCssIndicator = s.mCssIndicator;
230 mNetworkId = s.mNetworkId;
231 mSystemId = s.mSystemId;
Wink Savillee9b06d72009-05-18 21:47:50 -0700232 mCdmaRoamingIndicator = s.mCdmaRoamingIndicator;
233 mCdmaDefaultRoamingIndicator = s.mCdmaDefaultRoamingIndicator;
Robert Greenwalt98e0b142009-10-08 21:15:52 -0700234 mCdmaEriIconIndex = s.mCdmaEriIconIndex;
235 mCdmaEriIconMode = s.mCdmaEriIconMode;
John Wang56c2d2f2010-04-07 08:57:17 -0700236 mIsEmergencyOnly = s.mIsEmergencyOnly;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800237 }
238
239 /**
240 * Construct a ServiceState object from the given parcel.
241 */
242 public ServiceState(Parcel in) {
Wink Saville0dde2c22012-11-16 08:12:11 -0800243 mVoiceRegState = in.readInt();
244 mDataRegState = in.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800245 mRoaming = in.readInt() != 0;
246 mOperatorAlphaLong = in.readString();
247 mOperatorAlphaShort = in.readString();
248 mOperatorNumeric = in.readString();
249 mIsManualNetworkSelection = in.readInt() != 0;
Wink Saville0dde2c22012-11-16 08:12:11 -0800250 mRilVoiceRadioTechnology = in.readInt();
251 mRilDataRadioTechnology = in.readInt();
Wink Saville767a6622009-04-02 01:37:02 -0700252 mCssIndicator = (in.readInt() != 0);
253 mNetworkId = in.readInt();
254 mSystemId = in.readInt();
Wink Savillee9b06d72009-05-18 21:47:50 -0700255 mCdmaRoamingIndicator = in.readInt();
256 mCdmaDefaultRoamingIndicator = in.readInt();
Robert Greenwalt98e0b142009-10-08 21:15:52 -0700257 mCdmaEriIconIndex = in.readInt();
258 mCdmaEriIconMode = in.readInt();
John Wang56c2d2f2010-04-07 08:57:17 -0700259 mIsEmergencyOnly = in.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800260 }
261
262 public void writeToParcel(Parcel out, int flags) {
Wink Saville0dde2c22012-11-16 08:12:11 -0800263 out.writeInt(mVoiceRegState);
264 out.writeInt(mDataRegState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800265 out.writeInt(mRoaming ? 1 : 0);
266 out.writeString(mOperatorAlphaLong);
267 out.writeString(mOperatorAlphaShort);
268 out.writeString(mOperatorNumeric);
269 out.writeInt(mIsManualNetworkSelection ? 1 : 0);
Wink Saville0dde2c22012-11-16 08:12:11 -0800270 out.writeInt(mRilVoiceRadioTechnology);
271 out.writeInt(mRilDataRadioTechnology);
Wink Saville767a6622009-04-02 01:37:02 -0700272 out.writeInt(mCssIndicator ? 1 : 0);
273 out.writeInt(mNetworkId);
274 out.writeInt(mSystemId);
Wink Savillee9b06d72009-05-18 21:47:50 -0700275 out.writeInt(mCdmaRoamingIndicator);
276 out.writeInt(mCdmaDefaultRoamingIndicator);
Robert Greenwalt98e0b142009-10-08 21:15:52 -0700277 out.writeInt(mCdmaEriIconIndex);
278 out.writeInt(mCdmaEriIconMode);
John Wang56c2d2f2010-04-07 08:57:17 -0700279 out.writeInt(mIsEmergencyOnly ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800280 }
281
282 public int describeContents() {
283 return 0;
284 }
285
Jake Hamby390de222010-05-10 18:46:45 -0700286 public static final Parcelable.Creator<ServiceState> CREATOR =
287 new Parcelable.Creator<ServiceState>() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800288 public ServiceState createFromParcel(Parcel in) {
289 return new ServiceState(in);
290 }
291
292 public ServiceState[] newArray(int size) {
293 return new ServiceState[size];
294 }
295 };
296
297 /**
Wink Saville0dde2c22012-11-16 08:12:11 -0800298 * Get current voice service state
299 */
300 public int getState() {
301 return getVoiceRegState();
302 }
303
304 /**
305 * Get current voice service state
Wink Savilleb690ac32012-11-14 17:03:01 -0800306 *
Wink Saville69e25222012-11-15 15:16:45 -0800307 * @see #STATE_IN_SERVICE
308 * @see #STATE_OUT_OF_SERVICE
309 * @see #STATE_EMERGENCY_ONLY
310 * @see #STATE_POWER_OFF
Wink Saville0dde2c22012-11-16 08:12:11 -0800311 *
312 * @hide
Wink Savilleb690ac32012-11-14 17:03:01 -0800313 */
Wink Saville0dde2c22012-11-16 08:12:11 -0800314 public int getVoiceRegState() {
315 return mVoiceRegState;
316 }
317
318 /**
319 * Get current data service state
320 *
321 * @see #STATE_IN_SERVICE
322 * @see #STATE_OUT_OF_SERVICE
323 * @see #STATE_EMERGENCY_ONLY
324 * @see #STATE_POWER_OFF
325 *
326 * @hide
327 */
328 public int getDataRegState() {
329 return mDataRegState;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800330 }
331
332 /**
333 * Get current roaming indicator of phone
334 * (note: not just decoding from TS 27.007 7.2)
335 *
336 * @return true if TS 27.007 7.2 roaming is true
337 * and ONS is different from SPN
338 *
339 */
340 public boolean getRoaming() {
341 return mRoaming;
342 }
343
Wink Savillee9b06d72009-05-18 21:47:50 -0700344 /**
345 * @hide
346 */
John Wang56c2d2f2010-04-07 08:57:17 -0700347 public boolean isEmergencyOnly() {
348 return mIsEmergencyOnly;
349 }
350
351 /**
352 * @hide
353 */
Wink Savillee9b06d72009-05-18 21:47:50 -0700354 public int getCdmaRoamingIndicator(){
355 return this.mCdmaRoamingIndicator;
356 }
357
358 /**
359 * @hide
360 */
361 public int getCdmaDefaultRoamingIndicator(){
362 return this.mCdmaDefaultRoamingIndicator;
Wink Saville767a6622009-04-02 01:37:02 -0700363 }
364
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800365 /**
Robert Greenwalt98e0b142009-10-08 21:15:52 -0700366 * @hide
367 */
368 public int getCdmaEriIconIndex() {
369 return this.mCdmaEriIconIndex;
370 }
371
372 /**
373 * @hide
374 */
375 public int getCdmaEriIconMode() {
376 return this.mCdmaEriIconMode;
377 }
378
379 /**
Jake Hamby390de222010-05-10 18:46:45 -0700380 * Get current registered operator name in long alphanumeric format.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800381 *
Jake Hamby390de222010-05-10 18:46:45 -0700382 * In GSM/UMTS, long format can be up to 16 characters long.
383 * In CDMA, returns the ERI text, if set. Otherwise, returns the ONS.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800384 *
385 * @return long name of operator, null if unregistered or unknown
386 */
387 public String getOperatorAlphaLong() {
388 return mOperatorAlphaLong;
389 }
390
391 /**
Jake Hamby390de222010-05-10 18:46:45 -0700392 * Get current registered operator name in short alphanumeric format.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800393 *
Jake Hamby390de222010-05-10 18:46:45 -0700394 * In GSM/UMTS, short format can be up to 8 characters long.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800395 *
396 * @return short name of operator, null if unregistered or unknown
397 */
398 public String getOperatorAlphaShort() {
399 return mOperatorAlphaShort;
400 }
401
402 /**
Jake Hamby390de222010-05-10 18:46:45 -0700403 * Get current registered operator numeric id.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800404 *
405 * In GSM/UMTS, numeric format is 3 digit country code plus 2 or 3 digit
Jake Hamby390de222010-05-10 18:46:45 -0700406 * network code.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800407 *
408 * @return numeric format of operator, null if unregistered or unknown
409 */
Jean-Baptiste Querue25863c2010-05-18 11:54:42 -0700410 /*
Jake Hamby390de222010-05-10 18:46:45 -0700411 * The country code can be decoded using
412 * {@link com.android.internal.telephony.MccTable#countryCodeForMcc(int)}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800413 */
414 public String getOperatorNumeric() {
415 return mOperatorNumeric;
416 }
417
418 /**
Jake Hamby390de222010-05-10 18:46:45 -0700419 * Get current network selection mode.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800420 *
421 * @return true if manual mode, false if automatic mode
422 */
423 public boolean getIsManualSelection() {
424 return mIsManualNetworkSelection;
425 }
426
427 @Override
428 public int hashCode() {
Wink Saville0dde2c22012-11-16 08:12:11 -0800429 return ((mVoiceRegState * 31)
430 + (mDataRegState * 37)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800431 + (mRoaming ? 1 : 0)
432 + (mIsManualNetworkSelection ? 1 : 0)
433 + ((null == mOperatorAlphaLong) ? 0 : mOperatorAlphaLong.hashCode())
434 + ((null == mOperatorAlphaShort) ? 0 : mOperatorAlphaShort.hashCode())
Wink Saville767a6622009-04-02 01:37:02 -0700435 + ((null == mOperatorNumeric) ? 0 : mOperatorNumeric.hashCode())
Wink Savillee9b06d72009-05-18 21:47:50 -0700436 + mCdmaRoamingIndicator
John Wang56c2d2f2010-04-07 08:57:17 -0700437 + mCdmaDefaultRoamingIndicator
438 + (mIsEmergencyOnly ? 1 : 0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800439 }
440
441 @Override
442 public boolean equals (Object o) {
443 ServiceState s;
Wink Saville767a6622009-04-02 01:37:02 -0700444
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800445 try {
446 s = (ServiceState) o;
447 } catch (ClassCastException ex) {
448 return false;
449 }
450
451 if (o == null) {
452 return false;
453 }
454
Wink Saville0dde2c22012-11-16 08:12:11 -0800455 return (mVoiceRegState == s.mVoiceRegState
456 && mDataRegState == s.mDataRegState
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800457 && mRoaming == s.mRoaming
458 && mIsManualNetworkSelection == s.mIsManualNetworkSelection
459 && equalsHandlesNulls(mOperatorAlphaLong, s.mOperatorAlphaLong)
460 && equalsHandlesNulls(mOperatorAlphaShort, s.mOperatorAlphaShort)
Wink Saville767a6622009-04-02 01:37:02 -0700461 && equalsHandlesNulls(mOperatorNumeric, s.mOperatorNumeric)
Wink Saville0dde2c22012-11-16 08:12:11 -0800462 && equalsHandlesNulls(mRilVoiceRadioTechnology, s.mRilVoiceRadioTechnology)
463 && equalsHandlesNulls(mRilDataRadioTechnology, s.mRilDataRadioTechnology)
Wink Saville767a6622009-04-02 01:37:02 -0700464 && equalsHandlesNulls(mCssIndicator, s.mCssIndicator)
465 && equalsHandlesNulls(mNetworkId, s.mNetworkId)
466 && equalsHandlesNulls(mSystemId, s.mSystemId)
Wink Savillee9b06d72009-05-18 21:47:50 -0700467 && equalsHandlesNulls(mCdmaRoamingIndicator, s.mCdmaRoamingIndicator)
468 && equalsHandlesNulls(mCdmaDefaultRoamingIndicator,
John Wang56c2d2f2010-04-07 08:57:17 -0700469 s.mCdmaDefaultRoamingIndicator)
470 && mIsEmergencyOnly == s.mIsEmergencyOnly);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800471 }
472
Wink Savilledb09b5d2011-06-03 09:06:28 -0700473 /**
474 * Convert radio technology to String
475 *
476 * @param radioTechnology
477 * @return String representation of the RAT
478 *
479 * @hide
480 */
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800481 public static String rilRadioTechnologyToString(int rt) {
Wink Savilledb09b5d2011-06-03 09:06:28 -0700482 String rtString;
483
484 switch(rt) {
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800485 case RIL_RADIO_TECHNOLOGY_UNKNOWN:
Wink Savilledb09b5d2011-06-03 09:06:28 -0700486 rtString = "Unknown";
487 break;
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800488 case RIL_RADIO_TECHNOLOGY_GPRS:
Wink Savilledb09b5d2011-06-03 09:06:28 -0700489 rtString = "GPRS";
490 break;
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800491 case RIL_RADIO_TECHNOLOGY_EDGE:
Wink Savilledb09b5d2011-06-03 09:06:28 -0700492 rtString = "EDGE";
493 break;
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800494 case RIL_RADIO_TECHNOLOGY_UMTS:
Wink Savilledb09b5d2011-06-03 09:06:28 -0700495 rtString = "UMTS";
496 break;
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800497 case RIL_RADIO_TECHNOLOGY_IS95A:
Wink Savilledb09b5d2011-06-03 09:06:28 -0700498 rtString = "CDMA-IS95A";
499 break;
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800500 case RIL_RADIO_TECHNOLOGY_IS95B:
Wink Savilledb09b5d2011-06-03 09:06:28 -0700501 rtString = "CDMA-IS95B";
502 break;
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800503 case RIL_RADIO_TECHNOLOGY_1xRTT:
Wink Savilledb09b5d2011-06-03 09:06:28 -0700504 rtString = "1xRTT";
505 break;
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800506 case RIL_RADIO_TECHNOLOGY_EVDO_0:
Wink Savilledb09b5d2011-06-03 09:06:28 -0700507 rtString = "EvDo-rev.0";
508 break;
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800509 case RIL_RADIO_TECHNOLOGY_EVDO_A:
Wink Savilledb09b5d2011-06-03 09:06:28 -0700510 rtString = "EvDo-rev.A";
511 break;
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800512 case RIL_RADIO_TECHNOLOGY_HSDPA:
Wink Savilledb09b5d2011-06-03 09:06:28 -0700513 rtString = "HSDPA";
514 break;
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800515 case RIL_RADIO_TECHNOLOGY_HSUPA:
Wink Savilledb09b5d2011-06-03 09:06:28 -0700516 rtString = "HSUPA";
517 break;
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800518 case RIL_RADIO_TECHNOLOGY_HSPA:
Wink Savilledb09b5d2011-06-03 09:06:28 -0700519 rtString = "HSPA";
520 break;
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800521 case RIL_RADIO_TECHNOLOGY_EVDO_B:
Wink Savilledb09b5d2011-06-03 09:06:28 -0700522 rtString = "EvDo-rev.B";
523 break;
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800524 case RIL_RADIO_TECHNOLOGY_EHRPD:
Wink Savilledb09b5d2011-06-03 09:06:28 -0700525 rtString = "eHRPD";
526 break;
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800527 case RIL_RADIO_TECHNOLOGY_LTE:
Wink Savilledb09b5d2011-06-03 09:06:28 -0700528 rtString = "LTE";
529 break;
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800530 case RIL_RADIO_TECHNOLOGY_HSPAP:
Wink Savilledb09b5d2011-06-03 09:06:28 -0700531 rtString = "HSPAP";
532 break;
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800533 case RIL_RADIO_TECHNOLOGY_GSM:
Naveen Kallafc2cbe92011-12-29 15:07:41 -0800534 rtString = "GSM";
535 break;
Wink Savilledb09b5d2011-06-03 09:06:28 -0700536 default:
537 rtString = "Unexpected";
Wink Saville599a90c2012-11-27 12:29:13 -0800538 Rlog.w(LOG_TAG, "Unexpected radioTechnology=" + rt);
Wink Savilledb09b5d2011-06-03 09:06:28 -0700539 break;
540 }
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800541 return rtString;
Wink Savilledb09b5d2011-06-03 09:06:28 -0700542 }
543
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800544 @Override
545 public String toString() {
Wink Saville0dde2c22012-11-16 08:12:11 -0800546 String radioTechnology = rilRadioTechnologyToString(mRilVoiceRadioTechnology);
547 String dataRadioTechnology = rilRadioTechnologyToString(mRilDataRadioTechnology);
Wink Saville767a6622009-04-02 01:37:02 -0700548
Wink Saville0dde2c22012-11-16 08:12:11 -0800549 return (mVoiceRegState + " " + mDataRegState + " " + (mRoaming ? "roaming" : "home")
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800550 + " " + mOperatorAlphaLong
551 + " " + mOperatorAlphaShort
552 + " " + mOperatorNumeric
Wink Saville767a6622009-04-02 01:37:02 -0700553 + " " + (mIsManualNetworkSelection ? "(manual)" : "")
554 + " " + radioTechnology
Wink Saville0dde2c22012-11-16 08:12:11 -0800555 + " " + dataRadioTechnology
Wink Saville767a6622009-04-02 01:37:02 -0700556 + " " + (mCssIndicator ? "CSS supported" : "CSS not supported")
Wink Savillee9b06d72009-05-18 21:47:50 -0700557 + " " + mNetworkId
558 + " " + mSystemId
Wink Savillee613adc2010-11-16 16:11:41 -0800559 + " RoamInd=" + mCdmaRoamingIndicator
560 + " DefRoamInd=" + mCdmaDefaultRoamingIndicator
561 + " EmergOnly=" + mIsEmergencyOnly);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800562 }
563
Robert Greenwalta2267452011-06-30 12:24:26 -0700564 private void setNullState(int state) {
Wink Saville599a90c2012-11-27 12:29:13 -0800565 if (DBG) Rlog.d(LOG_TAG, "[ServiceState] setNullState=" + state);
Wink Saville0dde2c22012-11-16 08:12:11 -0800566 mVoiceRegState = state;
567 mDataRegState = state;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800568 mRoaming = false;
569 mOperatorAlphaLong = null;
570 mOperatorAlphaShort = null;
571 mOperatorNumeric = null;
572 mIsManualNetworkSelection = false;
Wink Saville0dde2c22012-11-16 08:12:11 -0800573 mRilVoiceRadioTechnology = 0;
574 mRilDataRadioTechnology = 0;
Wink Saville767a6622009-04-02 01:37:02 -0700575 mCssIndicator = false;
576 mNetworkId = -1;
577 mSystemId = -1;
Wink Savillee9b06d72009-05-18 21:47:50 -0700578 mCdmaRoamingIndicator = -1;
579 mCdmaDefaultRoamingIndicator = -1;
Robert Greenwalt98e0b142009-10-08 21:15:52 -0700580 mCdmaEriIconIndex = -1;
581 mCdmaEriIconMode = -1;
John Wang56c2d2f2010-04-07 08:57:17 -0700582 mIsEmergencyOnly = false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800583 }
584
Robert Greenwalta2267452011-06-30 12:24:26 -0700585 public void setStateOutOfService() {
586 setNullState(STATE_OUT_OF_SERVICE);
587 }
588
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800589 public void setStateOff() {
Robert Greenwalta2267452011-06-30 12:24:26 -0700590 setNullState(STATE_POWER_OFF);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800591 }
592
593 public void setState(int state) {
Wink Saville0dde2c22012-11-16 08:12:11 -0800594 setVoiceRegState(state);
Wink Saville599a90c2012-11-27 12:29:13 -0800595 if (DBG) Rlog.e(LOG_TAG, "[ServiceState] setState deprecated use setVoiceRegState()");
Wink Saville0dde2c22012-11-16 08:12:11 -0800596 }
597
598 /** @hide */
599 public void setVoiceRegState(int state) {
600 mVoiceRegState = state;
Wink Saville599a90c2012-11-27 12:29:13 -0800601 if (DBG) Rlog.d(LOG_TAG, "[ServiceState] setVoiceRegState=" + mVoiceRegState);
Wink Saville0dde2c22012-11-16 08:12:11 -0800602 }
603
604 /** @hide */
605 public void setDataRegState(int state) {
606 mDataRegState = state;
Wink Saville599a90c2012-11-27 12:29:13 -0800607 if (DBG) Rlog.d(LOG_TAG, "[ServiceState] setDataRegState=" + mDataRegState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800608 }
609
610 public void setRoaming(boolean roaming) {
611 mRoaming = roaming;
612 }
613
John Wang56c2d2f2010-04-07 08:57:17 -0700614
615 /**
616 * @hide
617 */
618 public void setEmergencyOnly(boolean emergencyOnly) {
619 mIsEmergencyOnly = emergencyOnly;
620 }
621
Wink Savillee9b06d72009-05-18 21:47:50 -0700622 /**
623 * @hide
624 */
625 public void setCdmaRoamingIndicator(int roaming) {
626 this.mCdmaRoamingIndicator = roaming;
627 }
628
629 /**
630 * @hide
631 */
632 public void setCdmaDefaultRoamingIndicator (int roaming) {
633 this.mCdmaDefaultRoamingIndicator = roaming;
Wink Saville767a6622009-04-02 01:37:02 -0700634 }
635
Robert Greenwalt98e0b142009-10-08 21:15:52 -0700636 /**
637 * @hide
638 */
639 public void setCdmaEriIconIndex(int index) {
640 this.mCdmaEriIconIndex = index;
641 }
642
643 /**
644 * @hide
645 */
646 public void setCdmaEriIconMode(int mode) {
647 this.mCdmaEriIconMode = mode;
648 }
649
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800650 public void setOperatorName(String longName, String shortName, String numeric) {
651 mOperatorAlphaLong = longName;
652 mOperatorAlphaShort = shortName;
653 mOperatorNumeric = numeric;
654 }
655
Wink Savillee9b06d72009-05-18 21:47:50 -0700656 /**
Jake Hamby390de222010-05-10 18:46:45 -0700657 * In CDMA, mOperatorAlphaLong can be set from the ERI text.
658 * This is done from the CDMAPhone and not from the CdmaServiceStateTracker.
Wink Savillee9b06d72009-05-18 21:47:50 -0700659 *
660 * @hide
661 */
Kazuhiro Ondoc91c7f92011-06-02 00:19:49 -0500662 public void setOperatorAlphaLong(String longName) {
Wink Savillee9b06d72009-05-18 21:47:50 -0700663 mOperatorAlphaLong = longName;
664 }
665
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800666 public void setIsManualSelection(boolean isManual) {
667 mIsManualNetworkSelection = isManual;
668 }
Wink Saville767a6622009-04-02 01:37:02 -0700669
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800670 /**
Jake Hamby390de222010-05-10 18:46:45 -0700671 * Test whether two objects hold the same data values or both are null.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800672 *
673 * @param a first obj
674 * @param b second obj
675 * @return true if two objects equal or both are null
676 */
677 private static boolean equalsHandlesNulls (Object a, Object b) {
678 return (a == null) ? (b == null) : a.equals (b);
679 }
680
681 /**
Jake Hamby390de222010-05-10 18:46:45 -0700682 * Set ServiceState based on intent notifier map.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800683 *
684 * @param m intent notifier map
685 * @hide
686 */
687 private void setFromNotifierBundle(Bundle m) {
Wink Saville0dde2c22012-11-16 08:12:11 -0800688 mVoiceRegState = m.getInt("voiceRegState");
689 mDataRegState = m.getInt("dataRegState");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800690 mRoaming = m.getBoolean("roaming");
691 mOperatorAlphaLong = m.getString("operator-alpha-long");
692 mOperatorAlphaShort = m.getString("operator-alpha-short");
693 mOperatorNumeric = m.getString("operator-numeric");
694 mIsManualNetworkSelection = m.getBoolean("manual");
Wink Saville0dde2c22012-11-16 08:12:11 -0800695 mRilVoiceRadioTechnology = m.getInt("radioTechnology");
Sungmin Choi20a03ec2013-10-19 17:26:11 -0700696 mRilDataRadioTechnology = m.getInt("dataRadioTechnology");
Wink Saville767a6622009-04-02 01:37:02 -0700697 mCssIndicator = m.getBoolean("cssIndicator");
698 mNetworkId = m.getInt("networkId");
699 mSystemId = m.getInt("systemId");
Wink Savillee9b06d72009-05-18 21:47:50 -0700700 mCdmaRoamingIndicator = m.getInt("cdmaRoamingIndicator");
701 mCdmaDefaultRoamingIndicator = m.getInt("cdmaDefaultRoamingIndicator");
John Wang56c2d2f2010-04-07 08:57:17 -0700702 mIsEmergencyOnly = m.getBoolean("emergencyOnly");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800703 }
704
705 /**
Jake Hamby390de222010-05-10 18:46:45 -0700706 * Set intent notifier Bundle based on service state.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800707 *
708 * @param m intent notifier Bundle
709 * @hide
710 */
711 public void fillInNotifierBundle(Bundle m) {
Wink Saville0dde2c22012-11-16 08:12:11 -0800712 m.putInt("voiceRegState", mVoiceRegState);
713 m.putInt("dataRegState", mDataRegState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800714 m.putBoolean("roaming", Boolean.valueOf(mRoaming));
715 m.putString("operator-alpha-long", mOperatorAlphaLong);
716 m.putString("operator-alpha-short", mOperatorAlphaShort);
717 m.putString("operator-numeric", mOperatorNumeric);
718 m.putBoolean("manual", Boolean.valueOf(mIsManualNetworkSelection));
Wink Saville0dde2c22012-11-16 08:12:11 -0800719 m.putInt("radioTechnology", mRilVoiceRadioTechnology);
720 m.putInt("dataRadioTechnology", mRilDataRadioTechnology);
Wink Saville767a6622009-04-02 01:37:02 -0700721 m.putBoolean("cssIndicator", mCssIndicator);
722 m.putInt("networkId", mNetworkId);
723 m.putInt("systemId", mSystemId);
Wink Savillee9b06d72009-05-18 21:47:50 -0700724 m.putInt("cdmaRoamingIndicator", mCdmaRoamingIndicator);
725 m.putInt("cdmaDefaultRoamingIndicator", mCdmaDefaultRoamingIndicator);
John Wang56c2d2f2010-04-07 08:57:17 -0700726 m.putBoolean("emergencyOnly", Boolean.valueOf(mIsEmergencyOnly));
Wink Saville767a6622009-04-02 01:37:02 -0700727 }
728
Wink Saville767a6622009-04-02 01:37:02 -0700729 /** @hide */
Wink Saville0dde2c22012-11-16 08:12:11 -0800730 public void setRilVoiceRadioTechnology(int rt) {
731 this.mRilVoiceRadioTechnology = rt;
732 }
733
734 /** @hide */
735 public void setRilDataRadioTechnology(int rt) {
736 this.mRilDataRadioTechnology = rt;
Wink Saville599a90c2012-11-27 12:29:13 -0800737 if (DBG) Rlog.d(LOG_TAG, "[ServiceState] setDataRadioTechnology=" + mRilDataRadioTechnology);
Wink Saville767a6622009-04-02 01:37:02 -0700738 }
739
740 /** @hide */
741 public void setCssIndicator(int css) {
742 this.mCssIndicator = (css != 0);
743 }
744
745 /** @hide */
746 public void setSystemAndNetworkId(int systemId, int networkId) {
747 this.mSystemId = systemId;
748 this.mNetworkId = networkId;
749 }
750
751 /** @hide */
Wink Saville0dde2c22012-11-16 08:12:11 -0800752 public int getRilVoiceRadioTechnology() {
753 return this.mRilVoiceRadioTechnology;
Wink Saville767a6622009-04-02 01:37:02 -0700754 }
Mathias Agopiand13f9aa2012-02-24 19:28:42 -0800755 /** @hide */
Wink Saville0dde2c22012-11-16 08:12:11 -0800756 public int getRilDataRadioTechnology() {
757 return this.mRilDataRadioTechnology;
758 }
759 /**
760 * @hide
761 * @Deprecated to be removed Q3 2013 use {@link #getRilDataRadioTechnology} or
762 * {@link #getRilVoiceRadioTechnology}
763 */
Mathias Agopiand13f9aa2012-02-24 19:28:42 -0800764 public int getRadioTechnology() {
Wink Saville599a90c2012-11-27 12:29:13 -0800765 Rlog.e(LOG_TAG, "ServiceState.getRadioTechnology() DEPRECATED will be removed *******");
Wink Saville0dde2c22012-11-16 08:12:11 -0800766 return getRilDataRadioTechnology();
Mathias Agopiand13f9aa2012-02-24 19:28:42 -0800767 }
Wink Saville767a6622009-04-02 01:37:02 -0700768
Wink Saville0dde2c22012-11-16 08:12:11 -0800769 private int rilRadioTechnologyToNetworkType(int rt) {
770 switch(rt) {
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800771 case ServiceState.RIL_RADIO_TECHNOLOGY_GPRS:
772 return TelephonyManager.NETWORK_TYPE_GPRS;
773 case ServiceState.RIL_RADIO_TECHNOLOGY_EDGE:
774 return TelephonyManager.NETWORK_TYPE_EDGE;
775 case ServiceState.RIL_RADIO_TECHNOLOGY_UMTS:
776 return TelephonyManager.NETWORK_TYPE_UMTS;
777 case ServiceState.RIL_RADIO_TECHNOLOGY_HSDPA:
778 return TelephonyManager.NETWORK_TYPE_HSDPA;
779 case ServiceState.RIL_RADIO_TECHNOLOGY_HSUPA:
780 return TelephonyManager.NETWORK_TYPE_HSUPA;
781 case ServiceState.RIL_RADIO_TECHNOLOGY_HSPA:
782 return TelephonyManager.NETWORK_TYPE_HSPA;
783 case ServiceState.RIL_RADIO_TECHNOLOGY_IS95A:
784 case ServiceState.RIL_RADIO_TECHNOLOGY_IS95B:
785 return TelephonyManager.NETWORK_TYPE_CDMA;
786 case ServiceState.RIL_RADIO_TECHNOLOGY_1xRTT:
787 return TelephonyManager.NETWORK_TYPE_1xRTT;
788 case ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_0:
789 return TelephonyManager.NETWORK_TYPE_EVDO_0;
790 case ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_A:
791 return TelephonyManager.NETWORK_TYPE_EVDO_A;
792 case ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_B:
793 return TelephonyManager.NETWORK_TYPE_EVDO_B;
794 case ServiceState.RIL_RADIO_TECHNOLOGY_EHRPD:
795 return TelephonyManager.NETWORK_TYPE_EHRPD;
796 case ServiceState.RIL_RADIO_TECHNOLOGY_LTE:
797 return TelephonyManager.NETWORK_TYPE_LTE;
798 case ServiceState.RIL_RADIO_TECHNOLOGY_HSPAP:
799 return TelephonyManager.NETWORK_TYPE_HSPAP;
800 default:
801 return TelephonyManager.NETWORK_TYPE_UNKNOWN;
802 }
803 }
804
Wink Saville0dde2c22012-11-16 08:12:11 -0800805 /**
806 * @Deprecated to be removed Q3 2013 use {@link #getVoiceNetworkType}
807 * @hide
808 */
809 public int getNetworkType() {
Wink Saville599a90c2012-11-27 12:29:13 -0800810 Rlog.e(LOG_TAG, "ServiceState.getNetworkType() DEPRECATED will be removed *******");
Wink Saville0dde2c22012-11-16 08:12:11 -0800811 return rilRadioTechnologyToNetworkType(mRilVoiceRadioTechnology);
812 }
813
814 /** @hide */
815 public int getDataNetworkType() {
816 return rilRadioTechnologyToNetworkType(mRilDataRadioTechnology);
817 }
818
819 /** @hide */
820 public int getVoiceNetworkType() {
821 return rilRadioTechnologyToNetworkType(mRilVoiceRadioTechnology);
822 }
823
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800824 /** @hide */
Wink Saville767a6622009-04-02 01:37:02 -0700825 public int getCssIndicator() {
826 return this.mCssIndicator ? 1 : 0;
827 }
828
829 /** @hide */
830 public int getNetworkId() {
831 return this.mNetworkId;
832 }
833
834 /** @hide */
835 public int getSystemId() {
836 return this.mSystemId;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800837 }
Naveen Kallafc2cbe92011-12-29 15:07:41 -0800838
839 /** @hide */
840 public static boolean isGsm(int radioTechnology) {
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800841 return radioTechnology == RIL_RADIO_TECHNOLOGY_GPRS
842 || radioTechnology == RIL_RADIO_TECHNOLOGY_EDGE
843 || radioTechnology == RIL_RADIO_TECHNOLOGY_UMTS
844 || radioTechnology == RIL_RADIO_TECHNOLOGY_HSDPA
845 || radioTechnology == RIL_RADIO_TECHNOLOGY_HSUPA
846 || radioTechnology == RIL_RADIO_TECHNOLOGY_HSPA
847 || radioTechnology == RIL_RADIO_TECHNOLOGY_LTE
848 || radioTechnology == RIL_RADIO_TECHNOLOGY_HSPAP
849 || radioTechnology == RIL_RADIO_TECHNOLOGY_GSM;
Naveen Kallafc2cbe92011-12-29 15:07:41 -0800850 }
851
852 /** @hide */
853 public static boolean isCdma(int radioTechnology) {
Robert Greenwalt1434d7b2012-02-17 13:14:08 -0800854 return radioTechnology == RIL_RADIO_TECHNOLOGY_IS95A
855 || radioTechnology == RIL_RADIO_TECHNOLOGY_IS95B
856 || radioTechnology == RIL_RADIO_TECHNOLOGY_1xRTT
857 || radioTechnology == RIL_RADIO_TECHNOLOGY_EVDO_0
858 || radioTechnology == RIL_RADIO_TECHNOLOGY_EVDO_A
859 || radioTechnology == RIL_RADIO_TECHNOLOGY_EVDO_B
860 || radioTechnology == RIL_RADIO_TECHNOLOGY_EHRPD;
Naveen Kallafc2cbe92011-12-29 15:07:41 -0800861 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800862}