summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorLavettacn Xiao <lavettacn.xiao@sonyericsson.com>2010-08-30 12:47:23 +0200
committerSteve Kondik <shade@chemlab.org>2010-10-17 04:55:49 -0400
commit70c2a4c251e55aaab65f9adf709486057af3d343 (patch)
treed121e6e1a15e59c9ab1d7901eba59a9431362554 /services
parent34f797371f0066697ec58e7c4bbd0f9e12d4b9b5 (diff)
downloadframeworks_base-70c2a4c251e55aaab65f9adf709486057af3d343.zip
frameworks_base-70c2a4c251e55aaab65f9adf709486057af3d343.tar.gz
frameworks_base-70c2a4c251e55aaab65f9adf709486057af3d343.tar.bz2
Check if we are in daylight time when calculating timezone
The code that calculates the Kernel TimeZone does not check if we are actually in daylite time prior updating the kernel time zone. Add a call to TimeZone.inDaylightTime to get correct time zone. Change-Id: I44565bc8df48e81370ea3bfbb099a6a5675e343d
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/AlarmManagerService.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/services/java/com/android/server/AlarmManagerService.java b/services/java/com/android/server/AlarmManagerService.java
index e088417..2de09a6 100644
--- a/services/java/com/android/server/AlarmManagerService.java
+++ b/services/java/com/android/server/AlarmManagerService.java
@@ -771,9 +771,11 @@ class AlarmManagerService extends IAlarmManager.Stub {
// based off of the current Zone gmt offset + userspace tracked
// daylight savings information.
TimeZone zone = TimeZone.getTimeZone(SystemProperties.get(TIMEZONE_PROPERTY));
- 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));
scheduleDateChangedEvent();
}
}