Loading src/java/com/android/internal/telephony/NitzData.java +4 −4 Original line number Diff line number Diff line Loading @@ -56,14 +56,14 @@ public final class NitzData { private final TimeZone mEmulatorHostTimeZone; private NitzData(String originalString, int zoneOffsetMillis, Integer dstOffsetMillis, long utcTimeMillis, TimeZone emulatorHostTimeZone) { long unixEpochTimeMillis, TimeZone emulatorHostTimeZone) { if (originalString == null) { throw new NullPointerException("originalString==null"); } this.mOriginalString = originalString; this.mZoneOffset = zoneOffsetMillis; this.mDstOffset = dstOffsetMillis; this.mCurrentTimeMillis = utcTimeMillis; this.mCurrentTimeMillis = unixEpochTimeMillis; this.mEmulatorHostTimeZone = emulatorHostTimeZone; } Loading Loading @@ -130,8 +130,8 @@ public final class NitzData { /** A method for use in tests to create NitzData instances. */ public static NitzData createForTests(int zoneOffsetMillis, Integer dstOffsetMillis, long utcTimeMillis, TimeZone emulatorHostTimeZone) { return new NitzData("Test data", zoneOffsetMillis, dstOffsetMillis, utcTimeMillis, long unixEpochTimeMillis, TimeZone emulatorHostTimeZone) { return new NitzData("Test data", zoneOffsetMillis, dstOffsetMillis, unixEpochTimeMillis, emulatorHostTimeZone); } Loading src/java/com/android/internal/telephony/NitzStateMachine.java +2 −2 Original line number Diff line number Diff line Loading @@ -95,8 +95,8 @@ public interface NitzStateMachine { int getNitzUpdateSpacingMillis(); /** * If UTC time between two NITZ signals is greater than this value then the second signal * cannot be ignored. * If Unix epoch time between two NITZ signals is greater than this value then the second * signal cannot be ignored. */ int getNitzUpdateDiffMillis(); Loading src/java/com/android/internal/telephony/nitz/NitzSignalInputFilterPredicateFactory.java +9 −9 Original line number Diff line number Diff line Loading @@ -207,24 +207,24 @@ public final class NitzSignalInputFilterPredicateFactory { return true; } // See if the NITZ signals have sufficiently different encoded UTC times. If yes, // then we want to process the new one. // See if the NITZ signals have sufficiently different encoded Unix epoch times. If // yes, then we want to process the new one. int nitzUpdateDiff = deviceState.getNitzUpdateDiffMillis(); // Calculate the UTC difference between the time the two signals hold, accounting // for any difference in receipt time and age. long utcTimeDifferenceMillis = newNitzData.getCurrentTimeInMillis() // Calculate the Unix epoch difference between the time the two signals hold, // accounting for any difference in receipt time and age. long unixEpochTimeDifferenceMillis = newNitzData.getCurrentTimeInMillis() - previousNitzData.getCurrentTimeInMillis(); long ageAdjustedElapsedRealtimeDifferenceMillis = newSignal.getAgeAdjustedElapsedRealtimeMillis() - previousSignal.getAgeAdjustedElapsedRealtimeMillis(); // In ideal conditions, the difference between // ageAdjustedElapsedRealtimeSinceLastSaved and utcTimeDifferenceMillis will be zero // if two NITZ signals are consistent and if the elapsed realtime clock is ticking // at the correct rate. // ageAdjustedElapsedRealtimeSinceLastSaved and unixEpochTimeDifferenceMillis will // be zero if two NITZ signals are consistent and if the elapsed realtime clock is // ticking at the correct rate. long millisGainedOrLost = Math.abs( utcTimeDifferenceMillis - ageAdjustedElapsedRealtimeDifferenceMillis); unixEpochTimeDifferenceMillis - ageAdjustedElapsedRealtimeDifferenceMillis); if (millisGainedOrLost > nitzUpdateDiff) { return true; } Loading src/java/com/android/internal/telephony/nitz/NitzStateMachineImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -366,7 +366,7 @@ public final class NitzStateMachineImpl implements NitzStateMachine { + " reason=" + reason); } else { TimestampedValue<Long> newNitzTime = nitzSignal.createTimeSignal(); builder.setUtcTime(newNitzTime); builder.setUnixEpochTime(newNitzTime); builder.addDebugInfo("Sending new time suggestion" + " nitzSignal=" + nitzSignal + ", reason=" + reason); Loading src/java/com/android/internal/telephony/nitz/TimeServiceHelperImpl.java +3 −3 Original line number Diff line number Diff line Loading @@ -68,9 +68,9 @@ public final class TimeServiceHelperImpl implements TimeServiceHelper { Objects.requireNonNull(timeSuggestion); if (timeSuggestion.getUtcTime() != null) { TimestampedValue<Long> utcTime = timeSuggestion.getUtcTime(); TelephonyMetrics.getInstance().writeNITZEvent(mSlotIndex, utcTime.getValue()); if (timeSuggestion.getUnixEpochTime() != null) { TimestampedValue<Long> unixEpochTime = timeSuggestion.getUnixEpochTime(); TelephonyMetrics.getInstance().writeNITZEvent(mSlotIndex, unixEpochTime.getValue()); } mTimeDetector.suggestTelephonyTime(timeSuggestion); } Loading Loading
src/java/com/android/internal/telephony/NitzData.java +4 −4 Original line number Diff line number Diff line Loading @@ -56,14 +56,14 @@ public final class NitzData { private final TimeZone mEmulatorHostTimeZone; private NitzData(String originalString, int zoneOffsetMillis, Integer dstOffsetMillis, long utcTimeMillis, TimeZone emulatorHostTimeZone) { long unixEpochTimeMillis, TimeZone emulatorHostTimeZone) { if (originalString == null) { throw new NullPointerException("originalString==null"); } this.mOriginalString = originalString; this.mZoneOffset = zoneOffsetMillis; this.mDstOffset = dstOffsetMillis; this.mCurrentTimeMillis = utcTimeMillis; this.mCurrentTimeMillis = unixEpochTimeMillis; this.mEmulatorHostTimeZone = emulatorHostTimeZone; } Loading Loading @@ -130,8 +130,8 @@ public final class NitzData { /** A method for use in tests to create NitzData instances. */ public static NitzData createForTests(int zoneOffsetMillis, Integer dstOffsetMillis, long utcTimeMillis, TimeZone emulatorHostTimeZone) { return new NitzData("Test data", zoneOffsetMillis, dstOffsetMillis, utcTimeMillis, long unixEpochTimeMillis, TimeZone emulatorHostTimeZone) { return new NitzData("Test data", zoneOffsetMillis, dstOffsetMillis, unixEpochTimeMillis, emulatorHostTimeZone); } Loading
src/java/com/android/internal/telephony/NitzStateMachine.java +2 −2 Original line number Diff line number Diff line Loading @@ -95,8 +95,8 @@ public interface NitzStateMachine { int getNitzUpdateSpacingMillis(); /** * If UTC time between two NITZ signals is greater than this value then the second signal * cannot be ignored. * If Unix epoch time between two NITZ signals is greater than this value then the second * signal cannot be ignored. */ int getNitzUpdateDiffMillis(); Loading
src/java/com/android/internal/telephony/nitz/NitzSignalInputFilterPredicateFactory.java +9 −9 Original line number Diff line number Diff line Loading @@ -207,24 +207,24 @@ public final class NitzSignalInputFilterPredicateFactory { return true; } // See if the NITZ signals have sufficiently different encoded UTC times. If yes, // then we want to process the new one. // See if the NITZ signals have sufficiently different encoded Unix epoch times. If // yes, then we want to process the new one. int nitzUpdateDiff = deviceState.getNitzUpdateDiffMillis(); // Calculate the UTC difference between the time the two signals hold, accounting // for any difference in receipt time and age. long utcTimeDifferenceMillis = newNitzData.getCurrentTimeInMillis() // Calculate the Unix epoch difference between the time the two signals hold, // accounting for any difference in receipt time and age. long unixEpochTimeDifferenceMillis = newNitzData.getCurrentTimeInMillis() - previousNitzData.getCurrentTimeInMillis(); long ageAdjustedElapsedRealtimeDifferenceMillis = newSignal.getAgeAdjustedElapsedRealtimeMillis() - previousSignal.getAgeAdjustedElapsedRealtimeMillis(); // In ideal conditions, the difference between // ageAdjustedElapsedRealtimeSinceLastSaved and utcTimeDifferenceMillis will be zero // if two NITZ signals are consistent and if the elapsed realtime clock is ticking // at the correct rate. // ageAdjustedElapsedRealtimeSinceLastSaved and unixEpochTimeDifferenceMillis will // be zero if two NITZ signals are consistent and if the elapsed realtime clock is // ticking at the correct rate. long millisGainedOrLost = Math.abs( utcTimeDifferenceMillis - ageAdjustedElapsedRealtimeDifferenceMillis); unixEpochTimeDifferenceMillis - ageAdjustedElapsedRealtimeDifferenceMillis); if (millisGainedOrLost > nitzUpdateDiff) { return true; } Loading
src/java/com/android/internal/telephony/nitz/NitzStateMachineImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -366,7 +366,7 @@ public final class NitzStateMachineImpl implements NitzStateMachine { + " reason=" + reason); } else { TimestampedValue<Long> newNitzTime = nitzSignal.createTimeSignal(); builder.setUtcTime(newNitzTime); builder.setUnixEpochTime(newNitzTime); builder.addDebugInfo("Sending new time suggestion" + " nitzSignal=" + nitzSignal + ", reason=" + reason); Loading
src/java/com/android/internal/telephony/nitz/TimeServiceHelperImpl.java +3 −3 Original line number Diff line number Diff line Loading @@ -68,9 +68,9 @@ public final class TimeServiceHelperImpl implements TimeServiceHelper { Objects.requireNonNull(timeSuggestion); if (timeSuggestion.getUtcTime() != null) { TimestampedValue<Long> utcTime = timeSuggestion.getUtcTime(); TelephonyMetrics.getInstance().writeNITZEvent(mSlotIndex, utcTime.getValue()); if (timeSuggestion.getUnixEpochTime() != null) { TimestampedValue<Long> unixEpochTime = timeSuggestion.getUnixEpochTime(); TelephonyMetrics.getInstance().writeNITZEvent(mSlotIndex, unixEpochTime.getValue()); } mTimeDetector.suggestTelephonyTime(timeSuggestion); } Loading