Merge "Fix bug in NetworkTimeUpdateService" am: aca3aa1748 am: ac9139a6f7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1999011 Change-Id: I2ebd094d8f061bc82fefee6f2b939bc0fa2c820b
This commit is contained in:
committed by
Automerger Merge Worker
commit
a9120ace60
@@ -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<>(
|
||||
|
||||
Reference in New Issue
Block a user