Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64ba8e40 authored by Robert CH Chou's avatar Robert CH Chou
Browse files

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
parent 0b7bd95d
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -122,6 +122,14 @@ class AlarmManagerService extends IAlarmManager.Stub {
    public AlarmManagerService(Context context) {
    public AlarmManagerService(Context context) {
        mContext = context;
        mContext = context;
        mDescriptor = init();
        mDescriptor = init();

        // We have to set current TimeZone info to kernel
        // because kernel doesn't keep this after reboot
        String tz = SystemProperties.get(TIMEZONE_PROPERTY);
        if (tz != null) {
            setTimeZone(tz);
        }

        PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
        PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
        mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
        mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);