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

Commit 5eb42db3 authored by Przemyslaw Szczepaniak's avatar Przemyslaw Szczepaniak
Browse files

Treat "GMT" persist.sys.timezone as unset.

Previously, telephony coded depended on
persist.sys.timezone not being set as a signal
to try to deduce a timezone from sim card information.

Due to recent change, timezone is set by default to
"GMT" value. This value is synthetic and never occurs
when set from other sources.

Test: flashall & FrameworksTelephonyTests
Bug: 64056758
Change-Id: I219c2745aff38687b5039ce47eb9f5de3ff57256
parent 39443c82
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -362,7 +362,14 @@ public final class MccTable {
     */
    private static void setTimezoneFromMccIfNeeded(Context context, int mcc) {
        String timezone = SystemProperties.get(ServiceStateTracker.TIMEZONE_PROPERTY);
        if (timezone == null || timezone.length() == 0) {
        // timezone.equals("GMT") will be true and only true if the timezone was
        // set to a default value by the system server (when starting, system server.
        // sets the persist.sys.timezone to "GMT" if it's not set)."GMT" is not used by
        // any code that sets it explicitly (in case where something sets GMT explicitly,
        // "Etc/GMT" Olsen ID would be used).
        // TODO(b/64056758): Remove "timezone.equals("GMT")" hack when there's a
        // better way of telling if the value has been defaulted.
        if (timezone == null || timezone.length() == 0 || timezone.equals("GMT")) {
            String zoneId = defaultTimeZoneForMcc(mcc);
            if (zoneId != null && zoneId.length() > 0) {
                // Set time zone based on MCC