diff options
author | Mike Lockwood <lockwood@android.com> | 2009-11-20 15:12:51 -0500 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2009-11-20 15:16:58 -0500 |
commit | 1f7b4134db07acbb429cd770441ff460fa6f4b1b (patch) | |
tree | 10b9002ddf06bd6e6550aadee867317f103f1d1e | |
parent | 2a6a149fc2abfb8ef654ed36ce4524209f5e33bc (diff) | |
download | frameworks_base-1f7b4134db07acbb429cd770441ff460fa6f4b1b.zip frameworks_base-1f7b4134db07acbb429cd770441ff460fa6f4b1b.tar.gz frameworks_base-1f7b4134db07acbb429cd770441ff460fa6f4b1b.tar.bz2 |
AlarmManagerService: Fix daylight savings time offset computation
Fixes b/2244560 (Time Stamp On Bug Reports And Pictures Is One Hour Off)
Change-Id: I69324a33f80e41ce68a0e6fdba08b80ed9453e19
Signed-off-by: Mike Lockwood <lockwood@android.com>
-rw-r--r-- | services/java/com/android/server/AlarmManagerService.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/services/java/com/android/server/AlarmManagerService.java b/services/java/com/android/server/AlarmManagerService.java index 9c4ace1..8d86219 100644 --- a/services/java/com/android/server/AlarmManagerService.java +++ b/services/java/com/android/server/AlarmManagerService.java @@ -44,6 +44,7 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; import java.util.Comparator; +import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -260,8 +261,11 @@ class AlarmManagerService extends IAlarmManager.Stub { // Update the kernel timezone information // Kernel tracks time offsets as 'minutes west of GMT' - int gmtOffset = (zone.getRawOffset() + zone.getDSTSavings()) / 60000; - setKernelTimezone(mDescriptor, -(gmtOffset)); + int gmtOffset = zone.getRawOffset(); + if (zone.inDaylightTime(new Date(System.currentTimeMillis()))) { + gmtOffset += zone.getDSTSavings(); + } + setKernelTimezone(mDescriptor, -(gmtOffset / 60000)); } TimeZone.setDefault(null); |