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

Commit 45684db3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Treat "GMT" persist.sys.timezone as unset." into oc-mr1-dev

parents e4afd24b 327cd4fe
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -376,7 +376,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