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

Commit c42e34d4 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "More renames for API council" am: 1266d40c

Change-Id: I2eac9c678af17f07d799af18855916575df2f9f7
parents a0dc1bd1 1266d40c
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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;
@@ -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);
    }
@@ -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());
+3 −3
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.internal.telephony;

import android.app.timedetector.PhoneTimeSuggestion;
import android.app.timedetector.TelephonyTimeSuggestion;
import android.app.timedetector.TimeDetector;

/**
@@ -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);

}
+3 −3
Original line number Diff line number Diff line
@@ -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;
@@ -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);
    }
}
+14 −11
Original line number Diff line number Diff line
@@ -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;

@@ -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);
    }
@@ -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;
@@ -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);

@@ -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);
+7 −6
Original line number Diff line number Diff line
@@ -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;

@@ -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