Loading src/java/com/android/internal/telephony/NitzStateMachineImpl.java +6 −6 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package com.android.internal.telephony; import android.app.timedetector.PhoneTimeSuggestion; import android.app.timedetector.TelephonyTimeSuggestion; import android.content.Context; import android.os.PowerManager; import android.os.TimestampedValue; Loading Loading @@ -402,8 +402,8 @@ public final class NitzStateMachineImpl implements NitzStateMachine { } private void sendEmptyTimeSuggestion(String reason) { PhoneTimeSuggestion timeSuggestion = new PhoneTimeSuggestion.Builder(mPhone.getPhoneId()).build(); TelephonyTimeSuggestion timeSuggestion = new TelephonyTimeSuggestion.Builder(mPhone.getPhoneId()).build(); timeSuggestion.addDebugInfo("Empty suggestion, reason=" + reason); mTimeServiceHelper.suggestDeviceTime(timeSuggestion); } Loading Loading @@ -485,12 +485,12 @@ public final class NitzStateMachineImpl implements NitzStateMachine { Rlog.d(LOG_TAG, logMsg); } mTimeLog.log(logMsg); PhoneTimeSuggestion phoneTimeSuggestion = new PhoneTimeSuggestion.Builder(mPhone.getPhoneId()) TelephonyTimeSuggestion timeSuggestion = new TelephonyTimeSuggestion.Builder(mPhone.getPhoneId()) .setUtcTime(newNitzTime) .addDebugInfo(logMsg) .build(); mTimeServiceHelper.suggestDeviceTime(phoneTimeSuggestion); mTimeServiceHelper.suggestDeviceTime(timeSuggestion); TelephonyMetrics.getInstance().writeNITZEvent( mPhone.getPhoneId(), newNitzTime.getValue()); Loading src/java/com/android/internal/telephony/TimeServiceHelper.java +3 −3 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package com.android.internal.telephony; import android.app.timedetector.PhoneTimeSuggestion; import android.app.timedetector.TelephonyTimeSuggestion; import android.app.timedetector.TimeDetector; /** Loading Loading @@ -62,8 +62,8 @@ public interface TimeServiceHelper { /** * Suggest the time to the {@link TimeDetector}. * * @param phoneTimeSuggestion the suggested time * @param timeSuggestion the suggested time */ void suggestDeviceTime(PhoneTimeSuggestion phoneTimeSuggestion); void suggestDeviceTime(TelephonyTimeSuggestion timeSuggestion); } src/java/com/android/internal/telephony/TimeServiceHelperImpl.java +3 −3 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ package com.android.internal.telephony; import android.app.AlarmManager; import android.app.timedetector.PhoneTimeSuggestion; import android.app.timedetector.TelephonyTimeSuggestion; import android.app.timedetector.TimeDetector; import android.content.ContentResolver; import android.content.Context; Loading Loading @@ -96,7 +96,7 @@ public final class TimeServiceHelperImpl implements TimeServiceHelper { } @Override public void suggestDeviceTime(PhoneTimeSuggestion phoneTimeSuggestion) { mTimeDetector.suggestPhoneTime(phoneTimeSuggestion); public void suggestDeviceTime(TelephonyTimeSuggestion timeSuggestion) { mTimeDetector.suggestTelephonyTime(timeSuggestion); } } src/java/com/android/internal/telephony/nitz/NewNitzStateMachineImpl.java +14 −11 Original line number Diff line number Diff line Loading @@ -18,8 +18,8 @@ package com.android.internal.telephony.nitz; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.timedetector.PhoneTimeSuggestion; import android.app.timezonedetector.PhoneTimeZoneSuggestion; import android.app.timedetector.TelephonyTimeSuggestion; import android.app.timezonedetector.TelephonyTimeZoneSuggestion; import android.content.Context; import android.os.TimestampedValue; Loading Loading @@ -83,14 +83,14 @@ public final class NewNitzStateMachineImpl implements NitzStateMachine { public interface TimeZoneSuggester { /** * Generates a {@link PhoneTimeZoneSuggestion} given the information available. This method * must always return a non-null {@link PhoneTimeZoneSuggestion} but that object does not * have to contain a time zone if the available information is not sufficient to determine * one. {@link PhoneTimeZoneSuggestion#getDebugInfo()} provides debugging / logging * information explaining the choice. * Generates a {@link TelephonyTimeZoneSuggestion} given the information available. This * method must always return a non-null {@link TelephonyTimeZoneSuggestion} but that object * does not have to contain a time zone if the available information is not sufficient to * determine one. {@link TelephonyTimeZoneSuggestion#getDebugInfo()} provides debugging / * logging information explaining the choice. */ @NonNull PhoneTimeZoneSuggestion getTimeZoneSuggestion( TelephonyTimeZoneSuggestion getTimeZoneSuggestion( int slotIndex, @Nullable String countryIsoCode, @Nullable TimestampedValue<NitzData> nitzSignal); } Loading @@ -102,7 +102,9 @@ public final class NewNitzStateMachineImpl implements NitzStateMachine { private final int mSlotIndex; /** Applied to NITZ signals during input filtering. */ private final NitzSignalInputFilterPredicate mNitzSignalInputFilter; /** Creates {@link PhoneTimeZoneSuggestion} for passing to the time zone detection service. */ /** * Creates a {@link TelephonyTimeZoneSuggestion} for passing to the time zone detection service. */ private final TimeZoneSuggester mTimeZoneSuggester; /** A facade to the time / time zone detection services. */ private final NewTimeServiceHelper mNewTimeServiceHelper; Loading Loading @@ -284,7 +286,7 @@ public final class NewNitzStateMachineImpl implements NitzStateMachine { try { Objects.requireNonNull(reason); PhoneTimeZoneSuggestion suggestion = mTimeZoneSuggester.getTimeZoneSuggestion( TelephonyTimeZoneSuggestion suggestion = mTimeZoneSuggester.getTimeZoneSuggestion( mSlotIndex, countryIsoCode, nitzSignal); suggestion.addDebugInfo("Detection reason=" + reason); Loading Loading @@ -312,7 +314,8 @@ public final class NewNitzStateMachineImpl implements NitzStateMachine { try { Objects.requireNonNull(reason); PhoneTimeSuggestion.Builder builder = new PhoneTimeSuggestion.Builder(mSlotIndex); TelephonyTimeSuggestion.Builder builder = new TelephonyTimeSuggestion.Builder(mSlotIndex); if (nitzSignal == null) { builder.addDebugInfo("Clearing time suggestion" + " reason=" + reason); Loading src/java/com/android/internal/telephony/nitz/NewTimeServiceHelper.java +7 −6 Original line number Diff line number Diff line Loading @@ -17,9 +17,9 @@ package com.android.internal.telephony.nitz; import android.annotation.NonNull; import android.app.timedetector.PhoneTimeSuggestion; import android.app.timedetector.TelephonyTimeSuggestion; import android.app.timedetector.TimeDetector; import android.app.timezonedetector.PhoneTimeZoneSuggestion; import android.app.timezonedetector.TelephonyTimeZoneSuggestion; import com.android.internal.util.IndentingPrintWriter; Loading @@ -36,17 +36,18 @@ public interface NewTimeServiceHelper { * * @param suggestion the time */ void suggestDeviceTime(@NonNull PhoneTimeSuggestion suggestion); void suggestDeviceTime(@NonNull TelephonyTimeSuggestion suggestion); /** * Suggests the time zone to the time zone detector. * * <p>NOTE: The PhoneTimeZoneSuggestion cannot be null. The zoneId it contains can be null to * indicate there is no active suggestion; this can be used to clear a previous suggestion. * <p>NOTE: The {@link TelephonyTimeZoneSuggestion} cannot be null. The zoneId it contains can * be null to indicate there is no active suggestion; this can be used to clear a previous * suggestion. * * @param suggestion the time zone */ void maybeSuggestDeviceTimeZone(@NonNull PhoneTimeZoneSuggestion suggestion); void maybeSuggestDeviceTimeZone(@NonNull TelephonyTimeZoneSuggestion suggestion); /** * Dumps any logs held to the supplied writer. Loading Loading
src/java/com/android/internal/telephony/NitzStateMachineImpl.java +6 −6 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package com.android.internal.telephony; import android.app.timedetector.PhoneTimeSuggestion; import android.app.timedetector.TelephonyTimeSuggestion; import android.content.Context; import android.os.PowerManager; import android.os.TimestampedValue; Loading Loading @@ -402,8 +402,8 @@ public final class NitzStateMachineImpl implements NitzStateMachine { } private void sendEmptyTimeSuggestion(String reason) { PhoneTimeSuggestion timeSuggestion = new PhoneTimeSuggestion.Builder(mPhone.getPhoneId()).build(); TelephonyTimeSuggestion timeSuggestion = new TelephonyTimeSuggestion.Builder(mPhone.getPhoneId()).build(); timeSuggestion.addDebugInfo("Empty suggestion, reason=" + reason); mTimeServiceHelper.suggestDeviceTime(timeSuggestion); } Loading Loading @@ -485,12 +485,12 @@ public final class NitzStateMachineImpl implements NitzStateMachine { Rlog.d(LOG_TAG, logMsg); } mTimeLog.log(logMsg); PhoneTimeSuggestion phoneTimeSuggestion = new PhoneTimeSuggestion.Builder(mPhone.getPhoneId()) TelephonyTimeSuggestion timeSuggestion = new TelephonyTimeSuggestion.Builder(mPhone.getPhoneId()) .setUtcTime(newNitzTime) .addDebugInfo(logMsg) .build(); mTimeServiceHelper.suggestDeviceTime(phoneTimeSuggestion); mTimeServiceHelper.suggestDeviceTime(timeSuggestion); TelephonyMetrics.getInstance().writeNITZEvent( mPhone.getPhoneId(), newNitzTime.getValue()); Loading
src/java/com/android/internal/telephony/TimeServiceHelper.java +3 −3 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package com.android.internal.telephony; import android.app.timedetector.PhoneTimeSuggestion; import android.app.timedetector.TelephonyTimeSuggestion; import android.app.timedetector.TimeDetector; /** Loading Loading @@ -62,8 +62,8 @@ public interface TimeServiceHelper { /** * Suggest the time to the {@link TimeDetector}. * * @param phoneTimeSuggestion the suggested time * @param timeSuggestion the suggested time */ void suggestDeviceTime(PhoneTimeSuggestion phoneTimeSuggestion); void suggestDeviceTime(TelephonyTimeSuggestion timeSuggestion); }
src/java/com/android/internal/telephony/TimeServiceHelperImpl.java +3 −3 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ package com.android.internal.telephony; import android.app.AlarmManager; import android.app.timedetector.PhoneTimeSuggestion; import android.app.timedetector.TelephonyTimeSuggestion; import android.app.timedetector.TimeDetector; import android.content.ContentResolver; import android.content.Context; Loading Loading @@ -96,7 +96,7 @@ public final class TimeServiceHelperImpl implements TimeServiceHelper { } @Override public void suggestDeviceTime(PhoneTimeSuggestion phoneTimeSuggestion) { mTimeDetector.suggestPhoneTime(phoneTimeSuggestion); public void suggestDeviceTime(TelephonyTimeSuggestion timeSuggestion) { mTimeDetector.suggestTelephonyTime(timeSuggestion); } }
src/java/com/android/internal/telephony/nitz/NewNitzStateMachineImpl.java +14 −11 Original line number Diff line number Diff line Loading @@ -18,8 +18,8 @@ package com.android.internal.telephony.nitz; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.timedetector.PhoneTimeSuggestion; import android.app.timezonedetector.PhoneTimeZoneSuggestion; import android.app.timedetector.TelephonyTimeSuggestion; import android.app.timezonedetector.TelephonyTimeZoneSuggestion; import android.content.Context; import android.os.TimestampedValue; Loading Loading @@ -83,14 +83,14 @@ public final class NewNitzStateMachineImpl implements NitzStateMachine { public interface TimeZoneSuggester { /** * Generates a {@link PhoneTimeZoneSuggestion} given the information available. This method * must always return a non-null {@link PhoneTimeZoneSuggestion} but that object does not * have to contain a time zone if the available information is not sufficient to determine * one. {@link PhoneTimeZoneSuggestion#getDebugInfo()} provides debugging / logging * information explaining the choice. * Generates a {@link TelephonyTimeZoneSuggestion} given the information available. This * method must always return a non-null {@link TelephonyTimeZoneSuggestion} but that object * does not have to contain a time zone if the available information is not sufficient to * determine one. {@link TelephonyTimeZoneSuggestion#getDebugInfo()} provides debugging / * logging information explaining the choice. */ @NonNull PhoneTimeZoneSuggestion getTimeZoneSuggestion( TelephonyTimeZoneSuggestion getTimeZoneSuggestion( int slotIndex, @Nullable String countryIsoCode, @Nullable TimestampedValue<NitzData> nitzSignal); } Loading @@ -102,7 +102,9 @@ public final class NewNitzStateMachineImpl implements NitzStateMachine { private final int mSlotIndex; /** Applied to NITZ signals during input filtering. */ private final NitzSignalInputFilterPredicate mNitzSignalInputFilter; /** Creates {@link PhoneTimeZoneSuggestion} for passing to the time zone detection service. */ /** * Creates a {@link TelephonyTimeZoneSuggestion} for passing to the time zone detection service. */ private final TimeZoneSuggester mTimeZoneSuggester; /** A facade to the time / time zone detection services. */ private final NewTimeServiceHelper mNewTimeServiceHelper; Loading Loading @@ -284,7 +286,7 @@ public final class NewNitzStateMachineImpl implements NitzStateMachine { try { Objects.requireNonNull(reason); PhoneTimeZoneSuggestion suggestion = mTimeZoneSuggester.getTimeZoneSuggestion( TelephonyTimeZoneSuggestion suggestion = mTimeZoneSuggester.getTimeZoneSuggestion( mSlotIndex, countryIsoCode, nitzSignal); suggestion.addDebugInfo("Detection reason=" + reason); Loading Loading @@ -312,7 +314,8 @@ public final class NewNitzStateMachineImpl implements NitzStateMachine { try { Objects.requireNonNull(reason); PhoneTimeSuggestion.Builder builder = new PhoneTimeSuggestion.Builder(mSlotIndex); TelephonyTimeSuggestion.Builder builder = new TelephonyTimeSuggestion.Builder(mSlotIndex); if (nitzSignal == null) { builder.addDebugInfo("Clearing time suggestion" + " reason=" + reason); Loading
src/java/com/android/internal/telephony/nitz/NewTimeServiceHelper.java +7 −6 Original line number Diff line number Diff line Loading @@ -17,9 +17,9 @@ package com.android.internal.telephony.nitz; import android.annotation.NonNull; import android.app.timedetector.PhoneTimeSuggestion; import android.app.timedetector.TelephonyTimeSuggestion; import android.app.timedetector.TimeDetector; import android.app.timezonedetector.PhoneTimeZoneSuggestion; import android.app.timezonedetector.TelephonyTimeZoneSuggestion; import com.android.internal.util.IndentingPrintWriter; Loading @@ -36,17 +36,18 @@ public interface NewTimeServiceHelper { * * @param suggestion the time */ void suggestDeviceTime(@NonNull PhoneTimeSuggestion suggestion); void suggestDeviceTime(@NonNull TelephonyTimeSuggestion suggestion); /** * Suggests the time zone to the time zone detector. * * <p>NOTE: The PhoneTimeZoneSuggestion cannot be null. The zoneId it contains can be null to * indicate there is no active suggestion; this can be used to clear a previous suggestion. * <p>NOTE: The {@link TelephonyTimeZoneSuggestion} cannot be null. The zoneId it contains can * be null to indicate there is no active suggestion; this can be used to clear a previous * suggestion. * * @param suggestion the time zone */ void maybeSuggestDeviceTimeZone(@NonNull PhoneTimeZoneSuggestion suggestion); void maybeSuggestDeviceTimeZone(@NonNull TelephonyTimeZoneSuggestion suggestion); /** * Dumps any logs held to the supplied writer. Loading