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. Use TimeZone.getOffset which checks for daylight savings. Also updated setTimeZone for consistency. Change-Id: I44565bc8df48e81370ea3bfbb099a6a5675e343d
This commit is contained in:
committed by
Johan Redestig
parent
08d9d9a462
commit
c84cc4f183
@@ -281,10 +281,7 @@ class AlarmManagerService extends IAlarmManager.Stub {
|
||||
|
||||
// Update the kernel timezone information
|
||||
// Kernel tracks time offsets as 'minutes west of GMT'
|
||||
int gmtOffset = zone.getRawOffset();
|
||||
if (zone.inDaylightTime(new Date(System.currentTimeMillis()))) {
|
||||
gmtOffset += zone.getDSTSavings();
|
||||
}
|
||||
int gmtOffset = zone.getOffset(System.currentTimeMillis());
|
||||
setKernelTimezone(mDescriptor, -(gmtOffset / 60000));
|
||||
}
|
||||
|
||||
@@ -784,9 +781,8 @@ 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.getOffset(System.currentTimeMillis());
|
||||
setKernelTimezone(mDescriptor, -(gmtOffset / 60000));
|
||||
scheduleDateChangedEvent();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user