Loading apex/jobscheduler/framework/java/android/app/AlarmManager.java +1 −7 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ import android.util.proto.ProtoOutputStream; import libcore.timezone.ZoneInfoDb; import java.io.IOException; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.ref.WeakReference; Loading Loading @@ -996,12 +995,7 @@ public class AlarmManager { // Reject this timezone if it isn't an Olson zone we recognize. if (mTargetSdkVersion >= Build.VERSION_CODES.M) { boolean hasTimeZone = false; try { hasTimeZone = ZoneInfoDb.getInstance().hasTimeZone(timeZone); } catch (IOException ignored) { } boolean hasTimeZone = ZoneInfoDb.getInstance().hasTimeZone(timeZone); if (!hasTimeZone) { throw new IllegalArgumentException("Timezone: " + timeZone + " is not an Olson ID"); } Loading core/java/android/text/format/Time.java +7 −13 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import android.util.TimeFormatException; import libcore.timezone.ZoneInfoDb; import libcore.util.ZoneInfo; import java.io.IOException; import java.util.Locale; import java.util.TimeZone; Loading Loading @@ -1117,7 +1116,6 @@ public class Time { } private static ZoneInfo lookupZoneInfo(String timezoneId) { try { ZoneInfo zoneInfo = ZoneInfoDb.getInstance().makeTimeZone(timezoneId); if (zoneInfo == null) { zoneInfo = ZoneInfoDb.getInstance().makeTimeZone("GMT"); Loading @@ -1126,10 +1124,6 @@ public class Time { throw new AssertionError("GMT not found: \"" + timezoneId + "\""); } return zoneInfo; } catch (IOException e) { // This should not ever be thrown. throw new AssertionError("Error loading timezone: \"" + timezoneId + "\"", e); } } public void switchTimeZone(String timezone) { Loading services/java/com/android/server/SystemServer.java +11 −2 Original line number Diff line number Diff line Loading @@ -184,6 +184,8 @@ import dalvik.system.VMRuntime; import com.google.android.startop.iorap.IorapForwardingService; import libcore.timezone.ZoneInfoDb; import java.io.File; import java.io.IOException; import java.util.LinkedList; Loading Loading @@ -448,8 +450,9 @@ public final class SystemServer { // 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."); if (!isValidTimeZoneId(timezoneProperty)) { Slog.w(TAG, "persist.sys.timezone is not valid (" + timezoneProperty + "); setting to GMT."); SystemProperties.set("persist.sys.timezone", "GMT"); } Loading Loading @@ -627,6 +630,12 @@ public final class SystemServer { throw new RuntimeException("Main thread loop unexpectedly exited"); } private static boolean isValidTimeZoneId(String timezoneProperty) { return timezoneProperty != null && !timezoneProperty.isEmpty() && ZoneInfoDb.getInstance().hasTimeZone(timezoneProperty); } private boolean isFirstBootOrUpgrade() { return mPackageManagerService.isFirstBoot() || mPackageManagerService.isDeviceUpgrading(); } Loading Loading
apex/jobscheduler/framework/java/android/app/AlarmManager.java +1 −7 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ import android.util.proto.ProtoOutputStream; import libcore.timezone.ZoneInfoDb; import java.io.IOException; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.ref.WeakReference; Loading Loading @@ -996,12 +995,7 @@ public class AlarmManager { // Reject this timezone if it isn't an Olson zone we recognize. if (mTargetSdkVersion >= Build.VERSION_CODES.M) { boolean hasTimeZone = false; try { hasTimeZone = ZoneInfoDb.getInstance().hasTimeZone(timeZone); } catch (IOException ignored) { } boolean hasTimeZone = ZoneInfoDb.getInstance().hasTimeZone(timeZone); if (!hasTimeZone) { throw new IllegalArgumentException("Timezone: " + timeZone + " is not an Olson ID"); } Loading
core/java/android/text/format/Time.java +7 −13 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import android.util.TimeFormatException; import libcore.timezone.ZoneInfoDb; import libcore.util.ZoneInfo; import java.io.IOException; import java.util.Locale; import java.util.TimeZone; Loading Loading @@ -1117,7 +1116,6 @@ public class Time { } private static ZoneInfo lookupZoneInfo(String timezoneId) { try { ZoneInfo zoneInfo = ZoneInfoDb.getInstance().makeTimeZone(timezoneId); if (zoneInfo == null) { zoneInfo = ZoneInfoDb.getInstance().makeTimeZone("GMT"); Loading @@ -1126,10 +1124,6 @@ public class Time { throw new AssertionError("GMT not found: \"" + timezoneId + "\""); } return zoneInfo; } catch (IOException e) { // This should not ever be thrown. throw new AssertionError("Error loading timezone: \"" + timezoneId + "\"", e); } } public void switchTimeZone(String timezone) { Loading
services/java/com/android/server/SystemServer.java +11 −2 Original line number Diff line number Diff line Loading @@ -184,6 +184,8 @@ import dalvik.system.VMRuntime; import com.google.android.startop.iorap.IorapForwardingService; import libcore.timezone.ZoneInfoDb; import java.io.File; import java.io.IOException; import java.util.LinkedList; Loading Loading @@ -448,8 +450,9 @@ public final class SystemServer { // 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."); if (!isValidTimeZoneId(timezoneProperty)) { Slog.w(TAG, "persist.sys.timezone is not valid (" + timezoneProperty + "); setting to GMT."); SystemProperties.set("persist.sys.timezone", "GMT"); } Loading Loading @@ -627,6 +630,12 @@ public final class SystemServer { throw new RuntimeException("Main thread loop unexpectedly exited"); } private static boolean isValidTimeZoneId(String timezoneProperty) { return timezoneProperty != null && !timezoneProperty.isEmpty() && ZoneInfoDb.getInstance().hasTimeZone(timezoneProperty); } private boolean isFirstBootOrUpgrade() { return mPackageManagerService.isFirstBoot() || mPackageManagerService.isDeviceUpgrading(); } Loading