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

Commit 9522f9ff authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "More renames for API council" am: b03661f5 am: 02e64e35

Change-Id: I83a0a98b18cffd92a8f2eed727b5fa277d89a5be
parents 8262f117 02e64e35
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ package android.app.timedetector;

import android.app.timedetector.ManualTimeSuggestion;
import android.app.timedetector.NetworkTimeSuggestion;
import android.app.timedetector.PhoneTimeSuggestion;
import android.app.timedetector.TelephonyTimeSuggestion;

/**
 * System private API to communicate with time detector service.
@@ -34,7 +34,7 @@ import android.app.timedetector.PhoneTimeSuggestion;
 * {@hide}
 */
interface ITimeDetectorService {
  void suggestPhoneTime(in PhoneTimeSuggestion timeSuggestion);
  void suggestManualTime(in ManualTimeSuggestion timeSuggestion);
  void suggestNetworkTime(in NetworkTimeSuggestion timeSuggestion);
  void suggestTelephonyTime(in TelephonyTimeSuggestion timeSuggestion);
}
+1 −1
Original line number Diff line number Diff line
@@ -16,4 +16,4 @@

package android.app.timedetector;

parcelable PhoneTimeSuggestion;
parcelable TelephonyTimeSuggestion;
+24 −24
Original line number Diff line number Diff line
@@ -50,17 +50,17 @@ import java.util.Objects;
 *
 * @hide
 */
public final class PhoneTimeSuggestion implements Parcelable {
public final class TelephonyTimeSuggestion implements Parcelable {

    /** @hide */
    public static final @NonNull Parcelable.Creator<PhoneTimeSuggestion> CREATOR =
            new Parcelable.Creator<PhoneTimeSuggestion>() {
                public PhoneTimeSuggestion createFromParcel(Parcel in) {
                    return PhoneTimeSuggestion.createFromParcel(in);
    public static final @NonNull Parcelable.Creator<TelephonyTimeSuggestion> CREATOR =
            new Parcelable.Creator<TelephonyTimeSuggestion>() {
                public TelephonyTimeSuggestion createFromParcel(Parcel in) {
                    return TelephonyTimeSuggestion.createFromParcel(in);
                }

                public PhoneTimeSuggestion[] newArray(int size) {
                    return new PhoneTimeSuggestion[size];
                public TelephonyTimeSuggestion[] newArray(int size) {
                    return new TelephonyTimeSuggestion[size];
                }
            };

@@ -68,15 +68,15 @@ public final class PhoneTimeSuggestion implements Parcelable {
    @Nullable private final TimestampedValue<Long> mUtcTime;
    @Nullable private ArrayList<String> mDebugInfo;

    private PhoneTimeSuggestion(Builder builder) {
    private TelephonyTimeSuggestion(Builder builder) {
        mSlotIndex = builder.mSlotIndex;
        mUtcTime = builder.mUtcTime;
        mDebugInfo = builder.mDebugInfo != null ? new ArrayList<>(builder.mDebugInfo) : null;
    }

    private static PhoneTimeSuggestion createFromParcel(Parcel in) {
    private static TelephonyTimeSuggestion createFromParcel(Parcel in) {
        int slotIndex = in.readInt();
        PhoneTimeSuggestion suggestion = new PhoneTimeSuggestion.Builder(slotIndex)
        TelephonyTimeSuggestion suggestion = new TelephonyTimeSuggestion.Builder(slotIndex)
                .setUtcTime(in.readParcelable(null /* classLoader */))
                .build();
        @SuppressWarnings("unchecked")
@@ -102,7 +102,7 @@ public final class PhoneTimeSuggestion implements Parcelable {
    /**
     * Returns an identifier for the source of this suggestion.
     *
     * <p>See {@link PhoneTimeSuggestion} for more information about {@code slotIndex}.
     * <p>See {@link TelephonyTimeSuggestion} for more information about {@code slotIndex}.
     */
    public int getSlotIndex() {
        return mSlotIndex;
@@ -111,7 +111,7 @@ public final class PhoneTimeSuggestion implements Parcelable {
    /**
     * Returns the suggested time or {@code null} if there isn't one.
     *
     * <p>See {@link PhoneTimeSuggestion} for more information about {@code utcTime}.
     * <p>See {@link TelephonyTimeSuggestion} for more information about {@code utcTime}.
     */
    @Nullable
    public TimestampedValue<Long> getUtcTime() {
@@ -121,7 +121,7 @@ public final class PhoneTimeSuggestion implements Parcelable {
    /**
     * Returns debug metadata for the suggestion.
     *
     * <p>See {@link PhoneTimeSuggestion} for more information about {@code debugInfo}.
     * <p>See {@link TelephonyTimeSuggestion} for more information about {@code debugInfo}.
     */
    @NonNull
    public List<String> getDebugInfo() {
@@ -132,7 +132,7 @@ public final class PhoneTimeSuggestion implements Parcelable {
    /**
     * Associates information with the instance that can be useful for debugging / logging.
     *
     * <p>See {@link PhoneTimeSuggestion} for more information about {@code debugInfo}.
     * <p>See {@link TelephonyTimeSuggestion} for more information about {@code debugInfo}.
     */
    public void addDebugInfo(@NonNull String debugInfo) {
        if (mDebugInfo == null) {
@@ -144,7 +144,7 @@ public final class PhoneTimeSuggestion implements Parcelable {
    /**
     * Associates information with the instance that can be useful for debugging / logging.
     *
     * <p>See {@link PhoneTimeSuggestion} for more information about {@code debugInfo}.
     * <p>See {@link TelephonyTimeSuggestion} for more information about {@code debugInfo}.
     */
    public void addDebugInfo(@NonNull List<String> debugInfo) {
        if (mDebugInfo == null) {
@@ -161,7 +161,7 @@ public final class PhoneTimeSuggestion implements Parcelable {
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        PhoneTimeSuggestion that = (PhoneTimeSuggestion) o;
        TelephonyTimeSuggestion that = (TelephonyTimeSuggestion) o;
        return mSlotIndex == that.mSlotIndex
                && Objects.equals(mUtcTime, that.mUtcTime);
    }
@@ -173,7 +173,7 @@ public final class PhoneTimeSuggestion implements Parcelable {

    @Override
    public String toString() {
        return "PhoneTimeSuggestion{"
        return "TelephonyTimeSuggestion{"
                + "mSlotIndex='" + mSlotIndex + '\''
                + ", mUtcTime=" + mUtcTime
                + ", mDebugInfo=" + mDebugInfo
@@ -181,7 +181,7 @@ public final class PhoneTimeSuggestion implements Parcelable {
    }

    /**
     * Builds {@link PhoneTimeSuggestion} instances.
     * Builds {@link TelephonyTimeSuggestion} instances.
     *
     * @hide
     */
@@ -193,7 +193,7 @@ public final class PhoneTimeSuggestion implements Parcelable {
        /**
         * Creates a builder with the specified {@code slotIndex}.
         *
         * <p>See {@link PhoneTimeSuggestion} for more information about {@code slotIndex}.
         * <p>See {@link TelephonyTimeSuggestion} for more information about {@code slotIndex}.
         */
        public Builder(int slotIndex) {
            mSlotIndex = slotIndex;
@@ -202,7 +202,7 @@ public final class PhoneTimeSuggestion implements Parcelable {
        /**
         * Returns the builder for call chaining.
         *
         * <p>See {@link PhoneTimeSuggestion} for more information about {@code utcTime}.
         * <p>See {@link TelephonyTimeSuggestion} for more information about {@code utcTime}.
         */
        @NonNull
        public Builder setUtcTime(@Nullable TimestampedValue<Long> utcTime) {
@@ -218,7 +218,7 @@ public final class PhoneTimeSuggestion implements Parcelable {
        /**
         * Returns the builder for call chaining.
         *
         * <p>See {@link PhoneTimeSuggestion} for more information about {@code debugInfo}.
         * <p>See {@link TelephonyTimeSuggestion} for more information about {@code debugInfo}.
         */
        @NonNull
        public Builder addDebugInfo(@NonNull String debugInfo) {
@@ -229,10 +229,10 @@ public final class PhoneTimeSuggestion implements Parcelable {
            return this;
        }

        /** Returns the {@link PhoneTimeSuggestion}. */
        /** Returns the {@link TelephonyTimeSuggestion}. */
        @NonNull
        public PhoneTimeSuggestion build() {
            return new PhoneTimeSuggestion(this);
        public TelephonyTimeSuggestion build() {
            return new TelephonyTimeSuggestion(this);
        }
    }
}
+5 −5
Original line number Diff line number Diff line
@@ -45,12 +45,12 @@ public interface TimeDetector {
    }

    /**
     * Suggests the current phone-signal derived time to the detector. The detector may ignore the
     * signal if better signals are available such as those that come from more reliable sources or
     * were determined more recently.
     * Suggests a telephony-signal derived time to the detector. The detector may ignore the signal
     * if better signals are available such as those that come from more reliable sources or were
     * determined more recently.
     */
    @RequiresPermission(android.Manifest.permission.SUGGEST_PHONE_TIME_AND_ZONE)
    void suggestPhoneTime(@NonNull PhoneTimeSuggestion timeSuggestion);
    @RequiresPermission(android.Manifest.permission.SUGGEST_TELEPHONY_TIME_AND_ZONE)
    void suggestTelephonyTime(@NonNull TelephonyTimeSuggestion timeSuggestion);

    /**
     * Suggests the user's manually entered current time to the detector.
+3 −3
Original line number Diff line number Diff line
@@ -40,12 +40,12 @@ public final class TimeDetectorImpl implements TimeDetector {
    }

    @Override
    public void suggestPhoneTime(@NonNull PhoneTimeSuggestion timeSuggestion) {
    public void suggestTelephonyTime(@NonNull TelephonyTimeSuggestion timeSuggestion) {
        if (DEBUG) {
            Log.d(TAG, "suggestPhoneTime called: " + timeSuggestion);
            Log.d(TAG, "suggestTelephonyTime called: " + timeSuggestion);
        }
        try {
            mITimeDetectorService.suggestPhoneTime(timeSuggestion);
            mITimeDetectorService.suggestTelephonyTime(timeSuggestion);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
Loading