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

Commit 82afccd5 authored by Przemyslaw Szczepaniak's avatar Przemyslaw Szczepaniak Committed by Gerrit Code Review
Browse files

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

parents 39443c82 5eb42db3
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