From fbe00fa62baa5392ac1358e2028ad92cfb443b08 Mon Sep 17 00:00:00 2001 From: Przemyslaw Szczepaniak Date: Fri, 28 Jul 2017 13:21:48 +0000 Subject: Revert "Revert "Default 'persist.sys.timezone' property to GMT if not set on init."" This reverts commit 27c461ab3c683ecb9cce7a0b1950672371b3079f. I'm taking alternative approach, telephony code will treat "GMT" value as it would be unset. This is fine because GMT is a synthetic value that would never be set from other sources. Change-Id: I889a844bfd75b7730a5d967065d27de03ef3ce2f Test: flashed device, tested manually Bug: 64056758 --- services/java/com/android/server/SystemServer.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'services/java') diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 1a1d31e6ed6a..ed429881a4f8 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -241,6 +241,15 @@ public final class SystemServer { SystemClock.setCurrentTimeMillis(EARLIEST_SUPPORTED_TIME); } + // + // Default the timezone property to GMT if not set. + // + String timezoneProperty = SystemProperties.get("persist.sys.timezone"); + if (timezoneProperty == null || timezoneProperty.isEmpty()) { + Slog.w(TAG, "Timezone not set; setting to GMT."); + SystemProperties.set("persist.sys.timezone", "GMT"); + } + // If the system has "persist.sys.language" and friends set, replace them with // "persist.sys.locale". Note that the default locale at this point is calculated // using the "-Duser.locale" command line flag. That flag is usually populated by -- cgit v1.2.3-59-g8ed1b