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

Commit 3d1c8cc4 authored by Jorge De la Torre's avatar Jorge De la Torre Committed by Android (Google) Code Review
Browse files

Merge "AlarmManager: Store time offset system property" into main

parents 39823383 45f7d870
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -115,6 +115,7 @@ import android.os.ServiceManager;
import android.os.ShellCallback;
import android.os.ShellCommand;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.ThreadLocalWorkSource;
import android.os.Trace;
import android.os.UserHandle;
@@ -229,6 +230,9 @@ public class AlarmManagerService extends SystemService {

    private static final long TEMPORARY_QUOTA_DURATION = INTERVAL_DAY;

    // System property read on some device configurations to initialize time properly.
    private static final String TIMEOFFSET_PROPERTY = "persist.sys.time.offset";

    private final Intent mBackgroundIntent
            = new Intent().addFlags(Intent.FLAG_FROM_BACKGROUND);

@@ -2142,6 +2146,9 @@ public class AlarmManagerService extends SystemService {
            // "GMT" if the ID is unrecognized). The parameter ID is used here rather than
            // newZone.getId(). It will be rejected if it is invalid.
            timeZoneWasChanged = SystemTimeZone.setTimeZoneId(tzId, confidence, logInfo);

            final int gmtOffset = newZone.getOffset(mInjector.getCurrentTimeMillis());
            SystemProperties.set(TIMEOFFSET_PROPERTY, String.valueOf(gmtOffset));
        }

        // Clear the default time zone in the system server process. This forces the next call