]> nv-tegra.nvidia Code Review - android/platform/frameworks/opt/telephony.git/blob - src/java/com/android/internal/telephony/ServiceStateTracker.java
am 193becaf: Merge commit \'33f24931ad25942ed8abb142df2edc2c1811350e\' into fix-merge...
[android/platform/frameworks/opt/telephony.git] / src / java / com / android / internal / telephony / ServiceStateTracker.java
1 /*
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
17 package com.android.internal.telephony;
18
19 import android.os.AsyncResult;
20 import android.os.Handler;
21 import android.os.Looper;
22 import android.os.Message;
23 import android.os.Registrant;
24 import android.os.RegistrantList;
25 import android.os.SystemClock;
26 import android.telephony.CellInfo;
27 import android.telephony.ServiceState;
28 import android.telephony.SignalStrength;
29 import android.util.TimeUtils;
30
31 import java.io.FileDescriptor;
32 import java.io.PrintWriter;
33 import java.util.List;
34
35 import com.android.internal.telephony.uicc.UiccController;
36
37 /**
38  * {@hide}
39  */
40 public abstract class ServiceStateTracker extends Handler {
41
42     protected CommandsInterface cm;
43     protected UiccController mUiccController = null;
44     protected IccCard mIccCard = null;
45     protected IccRecords mIccRecords = null;
46
47     protected PhoneBase mPhoneBase;
48
49     public ServiceState ss = new ServiceState();
50     protected ServiceState newSS = new ServiceState();
51
52     protected CellInfo mLastCellInfo = null;
53
54     // This is final as subclasses alias to a more specific type
55     // so we don't want the reference to change.
56     protected final CellInfo mCellInfo;
57
58     protected SignalStrength mSignalStrength = new SignalStrength();
59
60     // TODO - this should not be public, right now used externally GsmConnetion.
61     public RestrictedState mRestrictedState = new RestrictedState();
62
63     /* The otaspMode passed to PhoneStateListener#onOtaspChanged */
64     static public final int OTASP_UNINITIALIZED = 0;
65     static public final int OTASP_UNKNOWN = 1;
66     static public final int OTASP_NEEDED = 2;
67     static public final int OTASP_NOT_NEEDED = 3;
68
69     /**
70      * A unique identifier to track requests associated with a poll
71      * and ignore stale responses.  The value is a count-down of
72      * expected responses in this pollingContext.
73      */
74     protected int[] pollingContext;
75     protected boolean mDesiredPowerState;
76
77     /**
78      *  Values correspond to ServiceState.RIL_RADIO_TECHNOLOGY_ definitions.
79      */
80     protected int mRilRadioTechnology = 0;
81     protected int mNewRilRadioTechnology = 0;
82
83     /**
84      * By default, strength polling is enabled.  However, if we're
85      * getting unsolicited signal strength updates from the radio, set
86      * value to true and don't bother polling any more.
87      */
88     protected boolean dontPollSignalStrength = false;
89
90     protected RegistrantList mRoamingOnRegistrants = new RegistrantList();
91     protected RegistrantList mRoamingOffRegistrants = new RegistrantList();
92     protected RegistrantList mAttachedRegistrants = new RegistrantList();
93     protected RegistrantList mDetachedRegistrants = new RegistrantList();
94     protected RegistrantList mNetworkAttachedRegistrants = new RegistrantList();
95     protected RegistrantList mPsRestrictEnabledRegistrants = new RegistrantList();
96     protected RegistrantList mPsRestrictDisabledRegistrants = new RegistrantList();
97
98     /* Radio power off pending flag and tag counter */
99     private boolean mPendingRadioPowerOffAfterDataOff = false;
100     private int mPendingRadioPowerOffAfterDataOffTag = 0;
101
102     protected  static final boolean DBG = true;
103
104     /** Signal strength poll rate. */
105     protected static final int POLL_PERIOD_MILLIS = 20 * 1000;
106
107     /** Waiting period before recheck gprs and voice registration. */
108     public static final int DEFAULT_GPRS_CHECK_PERIOD_MILLIS = 60 * 1000;
109
110     /** GSM events */
111     protected static final int EVENT_RADIO_STATE_CHANGED               = 1;
112     protected static final int EVENT_NETWORK_STATE_CHANGED             = 2;
113     protected static final int EVENT_GET_SIGNAL_STRENGTH               = 3;
114     protected static final int EVENT_POLL_STATE_REGISTRATION           = 4;
115     protected static final int EVENT_POLL_STATE_GPRS                   = 5;
116     protected static final int EVENT_POLL_STATE_OPERATOR               = 6;
117     protected static final int EVENT_POLL_SIGNAL_STRENGTH              = 10;
118     protected static final int EVENT_NITZ_TIME                         = 11;
119     protected static final int EVENT_SIGNAL_STRENGTH_UPDATE            = 12;
120     protected static final int EVENT_RADIO_AVAILABLE                   = 13;
121     protected static final int EVENT_POLL_STATE_NETWORK_SELECTION_MODE = 14;
122     protected static final int EVENT_GET_LOC_DONE                      = 15;
123     protected static final int EVENT_SIM_RECORDS_LOADED                = 16;
124     protected static final int EVENT_SIM_READY                         = 17;
125     protected static final int EVENT_LOCATION_UPDATES_ENABLED          = 18;
126     protected static final int EVENT_GET_PREFERRED_NETWORK_TYPE        = 19;
127     protected static final int EVENT_SET_PREFERRED_NETWORK_TYPE        = 20;
128     protected static final int EVENT_RESET_PREFERRED_NETWORK_TYPE      = 21;
129     protected static final int EVENT_CHECK_REPORT_GPRS                 = 22;
130     protected static final int EVENT_RESTRICTED_STATE_CHANGED          = 23;
131
132     /** CDMA events */
133     protected static final int EVENT_POLL_STATE_REGISTRATION_CDMA      = 24;
134     protected static final int EVENT_POLL_STATE_OPERATOR_CDMA          = 25;
135     protected static final int EVENT_RUIM_READY                        = 26;
136     protected static final int EVENT_RUIM_RECORDS_LOADED               = 27;
137     protected static final int EVENT_POLL_SIGNAL_STRENGTH_CDMA         = 28;
138     protected static final int EVENT_GET_SIGNAL_STRENGTH_CDMA          = 29;
139     protected static final int EVENT_NETWORK_STATE_CHANGED_CDMA        = 30;
140     protected static final int EVENT_GET_LOC_DONE_CDMA                 = 31;
141     //protected static final int EVENT_UNUSED                            = 32;
142     protected static final int EVENT_NV_LOADED                         = 33;
143     protected static final int EVENT_POLL_STATE_CDMA_SUBSCRIPTION      = 34;
144     protected static final int EVENT_NV_READY                          = 35;
145     protected static final int EVENT_ERI_FILE_LOADED                   = 36;
146     protected static final int EVENT_OTA_PROVISION_STATUS_CHANGE       = 37;
147     protected static final int EVENT_SET_RADIO_POWER_OFF               = 38;
148     protected static final int EVENT_CDMA_SUBSCRIPTION_SOURCE_CHANGED  = 39;
149     protected static final int EVENT_CDMA_PRL_VERSION_CHANGED          = 40;
150     protected static final int EVENT_RADIO_ON                          = 41;
151     protected static final int EVENT_ICC_CHANGED                       = 42;
152
153     protected static final String TIMEZONE_PROPERTY = "persist.sys.timezone";
154
155     /**
156      * List of ISO codes for countries that can have an offset of
157      * GMT+0 when not in daylight savings time.  This ignores some
158      * small places such as the Canary Islands (Spain) and
159      * Danmarkshavn (Denmark).  The list must be sorted by code.
160     */
161     protected static final String[] GMT_COUNTRY_CODES = {
162         "bf", // Burkina Faso
163         "ci", // Cote d'Ivoire
164         "eh", // Western Sahara
165         "fo", // Faroe Islands, Denmark
166         "gb", // United Kingdom of Great Britain and Northern Ireland
167         "gh", // Ghana
168         "gm", // Gambia
169         "gn", // Guinea
170         "gw", // Guinea Bissau
171         "ie", // Ireland
172         "lr", // Liberia
173         "is", // Iceland
174         "ma", // Morocco
175         "ml", // Mali
176         "mr", // Mauritania
177         "pt", // Portugal
178         "sl", // Sierra Leone
179         "sn", // Senegal
180         "st", // Sao Tome and Principe
181         "tg", // Togo
182     };
183
184     /** Reason for registration denial. */
185     protected static final String REGISTRATION_DENIED_GEN  = "General";
186     protected static final String REGISTRATION_DENIED_AUTH = "Authentication Failure";
187
188     protected ServiceStateTracker(PhoneBase phoneBase, CommandsInterface ci, CellInfo cellInfo) {
189         mPhoneBase = phoneBase;
190         mCellInfo = cellInfo;
191         cm = ci;
192         mUiccController = UiccController.getInstance();
193         mUiccController.registerForIccChanged(this, EVENT_ICC_CHANGED, null);
194         cm.setOnSignalStrengthUpdate(this, EVENT_SIGNAL_STRENGTH_UPDATE, null);
195     }
196
197     public void dispose() {
198         cm.unSetOnSignalStrengthUpdate(this);
199     }
200
201     public boolean getDesiredPowerState() {
202         return mDesiredPowerState;
203     }
204
205     private SignalStrength mLastSignalStrength = null;
206     protected boolean notifySignalStrength() {
207         boolean notified = false;
208         synchronized(mCellInfo) {
209             if (!mSignalStrength.equals(mLastSignalStrength)) {
210                 try {
211                     mPhoneBase.notifySignalStrength();
212                     notified = true;
213                 } catch (NullPointerException ex) {
214                     loge("updateSignalStrength() Phone already destroyed: " + ex
215                             + "SignalStrength not notified");
216                 }
217             }
218         }
219         return notified;
220     }
221
222     /**
223      * Set the mCellInfo.signalStrength to its default values
224      */
225     protected void setSignalStrengthDefaultValues() {
226         setSignalStrengthDefaultValues(mSignalStrength);
227     }
228
229     /**
230      * Set the signal strength default values
231      */
232     protected void setSignalStrengthDefaultValues(SignalStrength signalStrength) {
233         signalStrength.initialize(99, -1, -1, -1, -1, -1, -1,
234                 -1, -1, -1, SignalStrength.INVALID_SNR, -1, isGsmSignalStrength());
235     }
236
237     /**
238      * Return true if this SST is a GSM category device.
239      */
240     protected abstract boolean isGsmSignalStrength();
241
242     /**
243      * Registration point for combined roaming on
244      * combined roaming is true when roaming is true and ONS differs SPN
245      *
246      * @param h handler to notify
247      * @param what what code of message when delivered
248      * @param obj placed in Message.obj
249      */
250     public  void registerForRoamingOn(Handler h, int what, Object obj) {
251         Registrant r = new Registrant(h, what, obj);
252         mRoamingOnRegistrants.add(r);
253
254         if (ss.getRoaming()) {
255             r.notifyRegistrant();
256         }
257     }
258
259     public  void unregisterForRoamingOn(Handler h) {
260         mRoamingOnRegistrants.remove(h);
261     }
262
263     /**
264      * Registration point for combined roaming off
265      * combined roaming is true when roaming is true and ONS differs SPN
266      *
267      * @param h handler to notify
268      * @param what what code of message when delivered
269      * @param obj placed in Message.obj
270      */
271     public  void registerForRoamingOff(Handler h, int what, Object obj) {
272         Registrant r = new Registrant(h, what, obj);
273         mRoamingOffRegistrants.add(r);
274
275         if (!ss.getRoaming()) {
276             r.notifyRegistrant();
277         }
278     }
279
280     public  void unregisterForRoamingOff(Handler h) {
281         mRoamingOffRegistrants.remove(h);
282     }
283
284     /**
285      * Re-register network by toggling preferred network type.
286      * This is a work-around to deregister and register network since there is
287      * no ril api to set COPS=2 (deregister) only.
288      *
289      * @param onComplete is dispatched when this is complete.  it will be
290      * an AsyncResult, and onComplete.obj.exception will be non-null
291      * on failure.
292      */
293     public void reRegisterNetwork(Message onComplete) {
294         cm.getPreferredNetworkType(
295                 obtainMessage(EVENT_GET_PREFERRED_NETWORK_TYPE, onComplete));
296     }
297
298     public void
299     setRadioPower(boolean power) {
300         mDesiredPowerState = power;
301
302         setPowerStateToDesired();
303     }
304
305     /**
306      * These two flags manage the behavior of the cell lock -- the
307      * lock should be held if either flag is true.  The intention is
308      * to allow temporary acquisition of the lock to get a single
309      * update.  Such a lock grab and release can thus be made to not
310      * interfere with more permanent lock holds -- in other words, the
311      * lock will only be released if both flags are false, and so
312      * releases by temporary users will only affect the lock state if
313      * there is no continuous user.
314      */
315     private boolean mWantContinuousLocationUpdates;
316     private boolean mWantSingleLocationUpdate;
317
318     public void enableSingleLocationUpdate() {
319         if (mWantSingleLocationUpdate || mWantContinuousLocationUpdates) return;
320         mWantSingleLocationUpdate = true;
321         cm.setLocationUpdates(true, obtainMessage(EVENT_LOCATION_UPDATES_ENABLED));
322     }
323
324     public void enableLocationUpdates() {
325         if (mWantSingleLocationUpdate || mWantContinuousLocationUpdates) return;
326         mWantContinuousLocationUpdates = true;
327         cm.setLocationUpdates(true, obtainMessage(EVENT_LOCATION_UPDATES_ENABLED));
328     }
329
330     protected void disableSingleLocationUpdate() {
331         mWantSingleLocationUpdate = false;
332         if (!mWantSingleLocationUpdate && !mWantContinuousLocationUpdates) {
333             cm.setLocationUpdates(false, null);
334         }
335     }
336
337     public void disableLocationUpdates() {
338         mWantContinuousLocationUpdates = false;
339         if (!mWantSingleLocationUpdate && !mWantContinuousLocationUpdates) {
340             cm.setLocationUpdates(false, null);
341         }
342     }
343
344     @Override
345     public void handleMessage(Message msg) {
346         switch (msg.what) {
347             case EVENT_SET_RADIO_POWER_OFF:
348                 synchronized(this) {
349                     if (mPendingRadioPowerOffAfterDataOff &&
350                             (msg.arg1 == mPendingRadioPowerOffAfterDataOffTag)) {
351                         if (DBG) log("EVENT_SET_RADIO_OFF, turn radio off now.");
352                         hangupAndPowerOff();
353                         mPendingRadioPowerOffAfterDataOffTag += 1;
354                         mPendingRadioPowerOffAfterDataOff = false;
355                     } else {
356                         log("EVENT_SET_RADIO_OFF is stale arg1=" + msg.arg1 +
357                                 "!= tag=" + mPendingRadioPowerOffAfterDataOffTag);
358                     }
359                 }
360                 break;
361
362             case EVENT_ICC_CHANGED:
363                 onUpdateIccAvailability();
364                 break;
365
366             default:
367                 log("Unhandled message with number: " + msg.what);
368                 break;
369         }
370     }
371
372     protected abstract Phone getPhone();
373     protected abstract void handlePollStateResult(int what, AsyncResult ar);
374     protected abstract void updateSpnDisplay();
375     protected abstract void setPowerStateToDesired();
376     protected abstract void onUpdateIccAvailability();
377     protected abstract void log(String s);
378     protected abstract void loge(String s);
379
380     public abstract int getCurrentDataConnectionState();
381     public abstract boolean isConcurrentVoiceAndDataAllowed();
382
383     /**
384      * Registration point for transition into DataConnection attached.
385      * @param h handler to notify
386      * @param what what code of message when delivered
387      * @param obj placed in Message.obj
388      */
389     public void registerForDataConnectionAttached(Handler h, int what, Object obj) {
390         Registrant r = new Registrant(h, what, obj);
391         mAttachedRegistrants.add(r);
392
393         if (getCurrentDataConnectionState() == ServiceState.STATE_IN_SERVICE) {
394             r.notifyRegistrant();
395         }
396     }
397     public void unregisterForDataConnectionAttached(Handler h) {
398         mAttachedRegistrants.remove(h);
399     }
400
401     /**
402      * Registration point for transition into DataConnection detached.
403      * @param h handler to notify
404      * @param what what code of message when delivered
405      * @param obj placed in Message.obj
406      */
407     public void registerForDataConnectionDetached(Handler h, int what, Object obj) {
408         Registrant r = new Registrant(h, what, obj);
409         mDetachedRegistrants.add(r);
410
411         if (getCurrentDataConnectionState() != ServiceState.STATE_IN_SERVICE) {
412             r.notifyRegistrant();
413         }
414     }
415     public void unregisterForDataConnectionDetached(Handler h) {
416         mDetachedRegistrants.remove(h);
417     }
418
419     /**
420      * Registration point for transition into network attached.
421      * @param h handler to notify
422      * @param what what code of message when delivered
423      * @param obj in Message.obj
424      */
425     public void registerForNetworkAttached(Handler h, int what, Object obj) {
426         Registrant r = new Registrant(h, what, obj);
427
428         mNetworkAttachedRegistrants.add(r);
429         if (ss.getState() == ServiceState.STATE_IN_SERVICE) {
430             r.notifyRegistrant();
431         }
432     }
433     public void unregisterForNetworkAttached(Handler h) {
434         mNetworkAttachedRegistrants.remove(h);
435     }
436
437     /**
438      * Registration point for transition into packet service restricted zone.
439      * @param h handler to notify
440      * @param what what code of message when delivered
441      * @param obj placed in Message.obj
442      */
443     public void registerForPsRestrictedEnabled(Handler h, int what, Object obj) {
444         Registrant r = new Registrant(h, what, obj);
445         mPsRestrictEnabledRegistrants.add(r);
446
447         if (mRestrictedState.isPsRestricted()) {
448             r.notifyRegistrant();
449         }
450     }
451
452     public void unregisterForPsRestrictedEnabled(Handler h) {
453         mPsRestrictEnabledRegistrants.remove(h);
454     }
455
456     /**
457      * Registration point for transition out of packet service restricted zone.
458      * @param h handler to notify
459      * @param what what code of message when delivered
460      * @param obj placed in Message.obj
461      */
462     public void registerForPsRestrictedDisabled(Handler h, int what, Object obj) {
463         Registrant r = new Registrant(h, what, obj);
464         mPsRestrictDisabledRegistrants.add(r);
465
466         if (mRestrictedState.isPsRestricted()) {
467             r.notifyRegistrant();
468         }
469     }
470
471     public void unregisterForPsRestrictedDisabled(Handler h) {
472         mPsRestrictDisabledRegistrants.remove(h);
473     }
474
475     /**
476      * Clean up existing voice and data connection then turn off radio power.
477      *
478      * Hang up the existing voice calls to decrease call drop rate.
479      */
480     public void powerOffRadioSafely(DataConnectionTracker dcTracker) {
481         synchronized (this) {
482             if (!mPendingRadioPowerOffAfterDataOff) {
483                 // To minimize race conditions we call cleanUpAllConnections on
484                 // both if else paths instead of before this isDisconnected test.
485                 if (dcTracker.isDisconnected()) {
486                     // To minimize race conditions we do this after isDisconnected
487                     dcTracker.cleanUpAllConnections(Phone.REASON_RADIO_TURNED_OFF);
488                     if (DBG) log("Data disconnected, turn off radio right away.");
489                     hangupAndPowerOff();
490                 } else {
491                     dcTracker.cleanUpAllConnections(Phone.REASON_RADIO_TURNED_OFF);
492                     Message msg = Message.obtain(this);
493                     msg.what = EVENT_SET_RADIO_POWER_OFF;
494                     msg.arg1 = ++mPendingRadioPowerOffAfterDataOffTag;
495                     if (sendMessageDelayed(msg, 30000)) {
496                         if (DBG) log("Wait upto 30s for data to disconnect, then turn off radio.");
497                         mPendingRadioPowerOffAfterDataOff = true;
498                     } else {
499                         log("Cannot send delayed Msg, turn off radio right away.");
500                         hangupAndPowerOff();
501                     }
502                 }
503             }
504         }
505     }
506
507     /**
508      * process the pending request to turn radio off after data is disconnected
509      *
510      * return true if there is pending request to process; false otherwise.
511      */
512     public boolean processPendingRadioPowerOffAfterDataOff() {
513         synchronized(this) {
514             if (mPendingRadioPowerOffAfterDataOff) {
515                 if (DBG) log("Process pending request to turn radio off.");
516                 mPendingRadioPowerOffAfterDataOffTag += 1;
517                 hangupAndPowerOff();
518                 mPendingRadioPowerOffAfterDataOff = false;
519                 return true;
520             }
521             return false;
522         }
523     }
524
525     /**
526      * Hang up all voice call and turn off radio. Implemented by derived class.
527      */
528     protected abstract void hangupAndPowerOff();
529
530     /** Cancel a pending (if any) pollState() operation */
531     protected void cancelPollState() {
532         // This will effectively cancel the rest of the poll requests.
533         pollingContext = new int[1];
534     }
535
536     /**
537      * Return true if time zone needs fixing.
538      *
539      * @param phoneBase
540      * @param operatorNumeric
541      * @param prevOperatorNumeric
542      * @param needToFixTimeZone
543      * @return true if time zone needs to be fixed
544      */
545     protected boolean shouldFixTimeZoneNow(PhoneBase phoneBase, String operatorNumeric,
546             String prevOperatorNumeric, boolean needToFixTimeZone) {
547         // Return false if the mcc isn't valid as we don't know where we are.
548         // Return true if we have an IccCard and the mcc changed or we
549         // need to fix it because when the NITZ time came in we didn't
550         // know the country code.
551
552         // If mcc is invalid then we'll return false
553         int mcc;
554         try {
555             mcc = Integer.parseInt(operatorNumeric.substring(0, 3));
556         } catch (Exception e) {
557             if (DBG) {
558                 log("shouldFixTimeZoneNow: no mcc, operatorNumeric=" + operatorNumeric +
559                         " retVal=false");
560             }
561             return false;
562         }
563
564         // If prevMcc is invalid will make it different from mcc
565         // so we'll return true if the card exists.
566         int prevMcc;
567         try {
568             prevMcc = Integer.parseInt(prevOperatorNumeric.substring(0, 3));
569         } catch (Exception e) {
570             prevMcc = mcc + 1;
571         }
572
573         // Determine if the Icc card exists
574         IccCard iccCard = phoneBase.getIccCard();
575         boolean iccCardExist = (iccCard != null) && iccCard.getState().iccCardExist();
576
577         // Determine retVal
578         boolean retVal = ((iccCardExist && (mcc != prevMcc)) || needToFixTimeZone);
579         if (DBG) {
580             long ctm = System.currentTimeMillis();
581             log("shouldFixTimeZoneNow: retVal=" + retVal +
582                     " iccCard=" + iccCard +
583                     " iccCard.state=" + (iccCard == null ? "null" : iccCard.getState().toString()) +
584                     " iccCardExist=" + iccCardExist +
585                     " operatorNumeric=" + operatorNumeric + " mcc=" + mcc +
586                     " prevOperatorNumeric=" + prevOperatorNumeric + " prevMcc=" + prevMcc +
587                     " needToFixTimeZone=" + needToFixTimeZone +
588                     " ltod=" + TimeUtils.logTimeOfDay(ctm));
589         }
590         return retVal;
591     }
592
593     /**
594      * @return all available cell information or null if none.
595      */
596     public List<CellInfo> getAllCellInfo() {
597         return null;
598     }
599
600     /**
601      * @return signal strength
602      */
603     public SignalStrength getSignalStrength() {
604         synchronized(mCellInfo) {
605             return mSignalStrength;
606         }
607     }
608
609     public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
610         pw.println("ServiceStateTracker:");
611         pw.println(" ss=" + ss);
612         pw.println(" newSS=" + newSS);
613         pw.println(" mCellInfo=" + mCellInfo);
614         pw.println(" mRestrictedState=" + mRestrictedState);
615         pw.println(" pollingContext=" + pollingContext);
616         pw.println(" mDesiredPowerState=" + mDesiredPowerState);
617         pw.println(" mRilRadioTechnology=" + mRilRadioTechnology);
618         pw.println(" mNewRilRadioTechnology=" + mNewRilRadioTechnology);
619         pw.println(" dontPollSignalStrength=" + dontPollSignalStrength);
620         pw.println(" mPendingRadioPowerOffAfterDataOff=" + mPendingRadioPowerOffAfterDataOff);
621         pw.println(" mPendingRadioPowerOffAfterDataOffTag=" + mPendingRadioPowerOffAfterDataOffTag);
622     }
623
624     /**
625      * Verifies the current thread is the same as the thread originally
626      * used in the initialization of this instance. Throws RuntimeException
627      * if not.
628      *
629      * @exception RuntimeException if the current thread is not
630      * the thread that originally obtained this PhoneBase instance.
631      */
632     protected void checkCorrectThread() {
633         if (Thread.currentThread() != getLooper().getThread()) {
634             throw new RuntimeException(
635                     "ServiceStateTracker must be used from within one thread");
636         }
637     }
638 }