summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-09-19 20:04:10 +0100
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-09-19 20:08:23 +0100
commit949aeb6d16adcc45453bbb8a76a1eb105641ebde (patch)
treee4df01070ebc5f14ea23cdfca5a6e900d6959f5e
parent0d93107fc3228382a892fa6ca2659e027888f27f (diff)
downloadframeworks_opt_telephony-949aeb6d16adcc45453bbb8a76a1eb105641ebde.zip
frameworks_opt_telephony-949aeb6d16adcc45453bbb8a76a1eb105641ebde.tar.gz
frameworks_opt_telephony-949aeb6d16adcc45453bbb8a76a1eb105641ebde.tar.bz2
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
-rw-r--r--src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java9
1 files changed, 9 insertions, 0 deletions
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) {