From 949aeb6d16adcc45453bbb8a76a1eb105641ebde Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Thu, 19 Sep 2013 20:04:10 +0100 Subject: GsmSST: Disregard any invalid verbose values for timezones in NITZ requests And assume anything resulting in "GMT" is invalid, since that's the default value returned by libcore Should fix CYAN-2271 Change-Id: I361650400e71976d8327ee3929947ca26a9eff57 --- .../android/internal/telephony/gsm/GsmServiceStateTracker.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java b/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java index 63e4d97..8dc7573 100644 --- a/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java +++ b/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java @@ -1422,8 +1422,17 @@ final class GsmServiceStateTracker extends ServiceStateTracker { if (nitzSubs.length >= 9) { String tzname = nitzSubs[8].replace('!','/'); zone = TimeZone.getTimeZone( tzname ); + // From luni's getTimeZone() "We never return null; on failure we return the + // equivalent of "GMT"." This is bad, since it'll force all invalid strings + // to "GMT"... and all the null-zone checks below will fail, making tzOffset + // irrelevant and GMT the active TZ. So tzOffset will take precedence if this + // results in "GMT" + if (TimeZone.getTimeZone("GMT").equals(zone) && tzOffset != 0) { + zone = null; + } } + String iso = SystemProperties.get(TelephonyProperties.PROPERTY_OPERATOR_ISO_COUNTRY); if (zone == null) { -- cgit v1.1