Permalink
Browse files

Merge "Check if we are in daylight time when calculating timezone"

  • Loading branch information...
Conley Owens Android Code Review
Conley Owens authored and Android Code Review committed Jun 20, 2011
2 parents e3b05d0 + c84cc4f commit bf5adfa5e558827fbb4771720433887bb3cbaefd
Showing with 3 additions and 7 deletions.
  1. +3 −7 services/java/com/android/server/AlarmManagerService.java
@@ -281,10 +281,7 @@ public void setTimeZone(String tz) {
// 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 @@ public void onReceive(Context context, Intent intent) {
// 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();
}
}

0 comments on commit bf5adfa

Please sign in to comment.