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

Commit a727a770 authored by Neil Fuller's avatar Neil Fuller
Browse files

Tweak API docs/annotations for API council review

Tweak API docs/annotations after API council review:

1) Add @CurrentTimeMillisLong annotation.
2) Remove mention of "confidence" from the docs. The focus here should
   be on what the UI is expected to do, not why.
3) Remove leading "m" from properties docs. Java POJO properties, in
   proper JavaBeans specification style, are what comes after the "get"
   / "is" / "set" (which also works best with Kotlin).
4) Move @ElapsedRealtimeMillis position: it's a method annotation, not a
   type annotation currently.

Test: treehugger only
Bug: 255592891
Change-Id: Id988f30226b18f1762df164607ba68fb554040e7
parent 3b951831
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -29,11 +29,13 @@ import java.util.Objects;
/**
 * A snapshot of the system time state.
 *
 * <p>{@code mUnixEpochTime} contains a snapshot of the system clock time and elapsed realtime clock
 * <p>{@code unixEpochTime} contains a snapshot of the system clock time and elapsed realtime clock
 * time.
 *
 * <p>{@code mUserShouldConfirmTime} is {@code true} if the system has low confidence in the system
 * clock time.
 * <p>{@code userShouldConfirmTime} is {@code true} if the system automatic time detection logic
 * suggests that the user be asked to confirm the {@code unixEpochTime} value is correct via {@link
 * TimeManager#confirmTime}. If it is not correct, the value can usually be changed via {@link
 * TimeManager#setManualTime}.
 *
 * @hide
 */
+4 −2
Original line number Diff line number Diff line
@@ -32,8 +32,10 @@ import java.util.Objects;
 * <p>{@code id} contains the system's time zone ID setting, e.g. "America/Los_Angeles". This
 * will usually agree with {@code TimeZone.getDefault().getID()} but it can be empty in rare cases.
 *
 * <p>{@code userShouldConfirmId} is {@code true} if the system has low confidence in the current
 * time zone.
 * <p>{@code userShouldConfirmId} is {@code true} if the system automatic time zone detection logic
 * suggests that the user be asked to confirm the {@code id} value is correct via {@link
 * TimeManager#confirmTimeZone}. If it is not correct, the value can usually be changed via {@link
 * TimeManager#setManualTimeZone}.
 *
 * @hide
 */
+5 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.app.time;

import android.annotation.CurrentTimeMillisLong;
import android.annotation.ElapsedRealtimeLong;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -42,7 +43,7 @@ import java.util.Objects;
@SystemApi
public final class UnixEpochTime implements Parcelable {
    @ElapsedRealtimeLong private final long mElapsedRealtimeMillis;
    private final long mUnixEpochTimeMillis;
    @CurrentTimeMillisLong private final long mUnixEpochTimeMillis;

    public UnixEpochTime(@ElapsedRealtimeLong long elapsedRealtimeMillis,
            long unixEpochTimeMillis) {
@@ -91,11 +92,13 @@ public final class UnixEpochTime implements Parcelable {
    }

    /** Returns the elapsed realtime clock value. See {@link UnixEpochTime} for more information. */
    public @ElapsedRealtimeLong long getElapsedRealtimeMillis() {
    @ElapsedRealtimeLong
    public long getElapsedRealtimeMillis() {
        return mElapsedRealtimeMillis;
    }

    /** Returns the unix epoch time value. See {@link UnixEpochTime} for more information. */
    @CurrentTimeMillisLong
    public long getUnixEpochTimeMillis() {
        return mUnixEpochTimeMillis;
    }