Skip to content

Commit 64ba8e4

Browse files
Robert CH ChouRobert CH Chou
authored andcommitted
Fix time zone info in kernel is nothing after reboot
If sys_tz is not set correctly, the timestamp of filesystem will be in-consistent with android's time, until time zone is set from android's UI. Set kernel timezone while initializing AlarmManagerService. Change-Id: Ic85def954fc9388e943e3dee45767d8179825a49
1 parent 0b7bd95 commit 64ba8e4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

services/java/com/android/server/AlarmManagerService.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@ private static final class BroadcastStats {
122122
public AlarmManagerService(Context context) {
123123
mContext = context;
124124
mDescriptor = init();
125+
126+
// We have to set current TimeZone info to kernel
127+
// because kernel doesn't keep this after reboot
128+
String tz = SystemProperties.get(TIMEZONE_PROPERTY);
129+
if (tz != null) {
130+
setTimeZone(tz);
131+
}
132+
125133
PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
126134
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
127135

0 commit comments

Comments
 (0)