diff options
author | Wink Saville <wink@google.com> | 2009-11-12 23:13:17 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-11-12 23:13:17 -0800 |
commit | b74ebcabe05d8ba91ff4a3bda4cc3fc6790ac39d (patch) | |
tree | 83e4994b4bf44c3f583faef99b7918db860e6a2a /telephony | |
parent | 5b65ef4c95e289ac3e8dca8c9ebfd8b71a7f0e4e (diff) | |
parent | 126fee88d480939d46b8ddd1e3a03cdd193fa040 (diff) | |
download | frameworks_base-b74ebcabe05d8ba91ff4a3bda4cc3fc6790ac39d.zip frameworks_base-b74ebcabe05d8ba91ff4a3bda4cc3fc6790ac39d.tar.gz frameworks_base-b74ebcabe05d8ba91ff4a3bda4cc3fc6790ac39d.tar.bz2 |
am 126fee88: am db9f06d9: resolved conflicts for merge of 2a1e9641 to eclair-mr2
Merge commit '126fee88d480939d46b8ddd1e3a03cdd193fa040'
* commit '126fee88d480939d46b8ddd1e3a03cdd193fa040':
Add code to use Gservices provided values for throtting NITZ updates.
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java index 799277b..c3d4940 100644 --- a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java +++ b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java @@ -76,6 +76,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker { private static final int NITZ_UPDATE_DIFF_DEFAULT = 2000; private int mNitzUpdateDiff = SystemProperties.getInt("ro.nitz_update_diff", NITZ_UPDATE_DIFF_DEFAULT); + /** * Values correspond to ServiceStateTracker.DATA_ACCESS_ definitions. */ @@ -159,6 +160,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker { super(); this.phone = phone; + cr = phone.getContext().getContentResolver(); cm = phone.mCM; ss = new ServiceState(); newSS = new ServiceState(); @@ -184,12 +186,9 @@ final class CdmaServiceStateTracker extends ServiceStateTracker { cm.registerForCdmaOtaProvision(this,EVENT_OTA_PROVISION_STATUS_CHANGE, null); // System setting property AIRPLANE_MODE_ON is set in Settings. - int airplaneMode = Settings.System.getInt( - phone.getContext().getContentResolver(), - Settings.System.AIRPLANE_MODE_ON, 0); + int airplaneMode = Settings.System.getInt(cr, Settings.System.AIRPLANE_MODE_ON, 0); mDesiredPowerState = ! (airplaneMode > 0); - cr = phone.getContext().getContentResolver(); cr.registerContentObserver( Settings.System.getUriFor(Settings.System.AUTO_TIME), true, mAutoTimeObserver); @@ -1027,8 +1026,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker { } if (hasRegistered) { - Checkin.updateStats(phone.getContext().getContentResolver(), - Checkin.Stats.Tag.PHONE_CDMA_REGISTERED, 1, 0.0); + Checkin.updateStats(cr, Checkin.Stats.Tag.PHONE_CDMA_REGISTERED, 1, 0.0); networkAttachedRegistrants.notifyRegistrants(); } @@ -1466,9 +1464,13 @@ final class CdmaServiceStateTracker extends ServiceStateTracker { */ long gained = c.getTimeInMillis() - System.currentTimeMillis(); long timeSinceLastUpdate = SystemClock.elapsedRealtime() - mSavedAtTime; + int nitzUpdateSpacing = Settings.Gservices.getInt(cr, + Settings.Gservices.NITZ_UPDATE_SPACING, mNitzUpdateSpacing); + int nitzUpdateDiff = Settings.Gservices.getInt(cr, + Settings.Gservices.NITZ_UPDATE_DIFF, mNitzUpdateDiff); - if ((timeSinceLastUpdate > mNitzUpdateSpacing) - || (Math.abs(gained) > mNitzUpdateDiff)) { + if ((mSavedAtTime == 0) || (timeSinceLastUpdate > nitzUpdateSpacing) + || (Math.abs(gained) > nitzUpdateDiff)) { Log.i(LOG_TAG, "NITZ: Auto updating time of day to " + c.getTime() + " NITZ receive delay=" + millisSinceNitzReceived + "ms gained=" + gained + "ms from " + nitz); @@ -1500,8 +1502,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker { private boolean getAutoTime() { try { - return Settings.System.getInt(phone.getContext().getContentResolver(), - Settings.System.AUTO_TIME) > 0; + return Settings.System.getInt(cr, Settings.System.AUTO_TIME) > 0; } catch (SettingNotFoundException snfe) { return true; } @@ -1540,8 +1541,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker { } private void revertToNitz() { - if (Settings.System.getInt(phone.getContext().getContentResolver(), - Settings.System.AUTO_TIME, 0) == 0) { + if (Settings.System.getInt(cr, Settings.System.AUTO_TIME, 0) == 0) { return; } Log.d(LOG_TAG, "Reverting to NITZ: tz='" + mSavedTimeZone |