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

Commit b03661f5 authored by Neil Fuller's avatar Neil Fuller Committed by Gerrit Code Review
Browse files

Merge "More renames for API council"

parents cd768aec c0d59e39
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -18,7 +18,7 @@ package android.app.timedetector;


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


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


package android.app.timedetector;
package android.app.timedetector;


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


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


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


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


    private PhoneTimeSuggestion(Builder builder) {
    private TelephonyTimeSuggestion(Builder builder) {
        mSlotIndex = builder.mSlotIndex;
        mSlotIndex = builder.mSlotIndex;
        mUtcTime = builder.mUtcTime;
        mUtcTime = builder.mUtcTime;
        mDebugInfo = builder.mDebugInfo != null ? new ArrayList<>(builder.mDebugInfo) : null;
        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();
        int slotIndex = in.readInt();
        PhoneTimeSuggestion suggestion = new PhoneTimeSuggestion.Builder(slotIndex)
        TelephonyTimeSuggestion suggestion = new TelephonyTimeSuggestion.Builder(slotIndex)
                .setUtcTime(in.readParcelable(null /* classLoader */))
                .setUtcTime(in.readParcelable(null /* classLoader */))
                .build();
                .build();
        @SuppressWarnings("unchecked")
        @SuppressWarnings("unchecked")
@@ -102,7 +102,7 @@ public final class PhoneTimeSuggestion implements Parcelable {
    /**
    /**
     * Returns an identifier for the source of this suggestion.
     * 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() {
    public int getSlotIndex() {
        return mSlotIndex;
        return mSlotIndex;
@@ -111,7 +111,7 @@ public final class PhoneTimeSuggestion implements Parcelable {
    /**
    /**
     * Returns the suggested time or {@code null} if there isn't one.
     * 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
    @Nullable
    public TimestampedValue<Long> getUtcTime() {
    public TimestampedValue<Long> getUtcTime() {
@@ -121,7 +121,7 @@ public final class PhoneTimeSuggestion implements Parcelable {
    /**
    /**
     * Returns debug metadata for the suggestion.
     * 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
    @NonNull
    public List<String> getDebugInfo() {
    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.
     * 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) {
    public void addDebugInfo(@NonNull String debugInfo) {
        if (mDebugInfo == null) {
        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.
     * 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) {
    public void addDebugInfo(@NonNull List<String> debugInfo) {
        if (mDebugInfo == null) {
        if (mDebugInfo == null) {
@@ -161,7 +161,7 @@ public final class PhoneTimeSuggestion implements Parcelable {
        if (o == null || getClass() != o.getClass()) {
        if (o == null || getClass() != o.getClass()) {
            return false;
            return false;
        }
        }
        PhoneTimeSuggestion that = (PhoneTimeSuggestion) o;
        TelephonyTimeSuggestion that = (TelephonyTimeSuggestion) o;
        return mSlotIndex == that.mSlotIndex
        return mSlotIndex == that.mSlotIndex
                && Objects.equals(mUtcTime, that.mUtcTime);
                && Objects.equals(mUtcTime, that.mUtcTime);
    }
    }
@@ -173,7 +173,7 @@ public final class PhoneTimeSuggestion implements Parcelable {


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


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


        /** Returns the {@link PhoneTimeSuggestion}. */
        /** Returns the {@link TelephonyTimeSuggestion}. */
        @NonNull
        @NonNull
        public PhoneTimeSuggestion build() {
        public TelephonyTimeSuggestion build() {
            return new PhoneTimeSuggestion(this);
            return new TelephonyTimeSuggestion(this);
        }
        }
    }
    }
}
}
+5 −5
Original line number Original line 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
     * Suggests a telephony-signal derived time to the detector. The detector may ignore the signal
     * signal if better signals are available such as those that come from more reliable sources or
     * if better signals are available such as those that come from more reliable sources or were
     * were determined more recently.
     * determined more recently.
     */
     */
    @RequiresPermission(android.Manifest.permission.SUGGEST_PHONE_TIME_AND_ZONE)
    @RequiresPermission(android.Manifest.permission.SUGGEST_TELEPHONY_TIME_AND_ZONE)
    void suggestPhoneTime(@NonNull PhoneTimeSuggestion timeSuggestion);
    void suggestTelephonyTime(@NonNull TelephonyTimeSuggestion timeSuggestion);


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


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