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

Commit ac9139a6 authored by Kanyinsola Fapohunda's avatar Kanyinsola Fapohunda Committed by Automerger Merge Worker
Browse files

Merge "Fix bug in NetworkTimeUpdateService" am: aca3aa17

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1999011

Change-Id: If1aabde051ad948cb6741b0ff6037a3f07a83a42
parents cf6d8549 aca3aa17
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -171,7 +171,9 @@ public class NetworkTimeUpdateService extends Binder {
                >= mPollingIntervalMs) {
            if (DBG) Log.d(TAG, "Stale NTP fix; forcing refresh");
            boolean isSuccessful = mTime.forceRefresh();
            if (!isSuccessful) {
            if (isSuccessful) {
                mTryAgainCounter = 0;
            } else {
                String logMsg = "forceRefresh() returned false: cachedNtpResult=" + cachedNtpResult
                        + ", currentElapsedRealtimeMillis=" + currentElapsedRealtimeMillis;

@@ -188,7 +190,8 @@ public class NetworkTimeUpdateService extends Binder {
                && cachedNtpResult.getAgeMillis(currentElapsedRealtimeMillis)
                < mPollingIntervalMs) {
            // Obtained fresh fix; schedule next normal update
            resetAlarm(mPollingIntervalMs);
            resetAlarm(mPollingIntervalMs
                    - cachedNtpResult.getAgeMillis(currentElapsedRealtimeMillis));

            // Suggest the time to the time detector. It may choose use it to set the system clock.
            TimestampedValue<Long> timeSignal = new TimestampedValue<>(