Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de0da030 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

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

Change-Id: I361650400e71976d8327ee3929947ca26a9eff57
(cherry picked from commit f440bcd7)
parent 69941ec5
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1542,7 +1542,16 @@ 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);