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

Commit 492885f3 authored by Sally Kovacs's avatar Sally Kovacs Committed by Android (Google) Code Review
Browse files

Merge "Add IntRange to TtsSpan TimeBuilder APIs" into main

parents d3b6644b 8525faea
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -50320,9 +50320,9 @@ package android.text.style {
  public static class TtsSpan.TimeBuilder extends android.text.style.TtsSpan.SemioticClassBuilder<android.text.style.TtsSpan.TimeBuilder> {
    ctor public TtsSpan.TimeBuilder();
    ctor public TtsSpan.TimeBuilder(int, int);
    method public android.text.style.TtsSpan.TimeBuilder setHours(int);
    method public android.text.style.TtsSpan.TimeBuilder setMinutes(int);
    method @FlaggedApi("com.android.text.flags.tts_span_duration") @NonNull public android.text.style.TtsSpan.TimeBuilder setSeconds(int);
    method public android.text.style.TtsSpan.TimeBuilder setHours(@IntRange(from=0, to=24) int);
    method public android.text.style.TtsSpan.TimeBuilder setMinutes(@IntRange(from=0, to=59) int);
    method @FlaggedApi("com.android.text.flags.tts_span_duration") @NonNull public android.text.style.TtsSpan.TimeBuilder setSeconds(@IntRange(from=0, to=59) int);
  }
  public static class TtsSpan.VerbatimBuilder extends android.text.style.TtsSpan.SemioticClassBuilder<android.text.style.TtsSpan.VerbatimBuilder> {
+6 −4
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.text.style;
import static com.android.text.flags.Flags.FLAG_TTS_SPAN_DURATION;

import android.annotation.FlaggedApi;
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.os.Parcel;
import android.os.PersistableBundle;
@@ -328,7 +329,8 @@ public class TtsSpan implements ParcelableSpan {

    /**
     * Argument used to specify the seconds of a time or duration. The seconds should be
     * provided as an integer in the range from 0 up to and including 59.
     * provided as an integer in the range from 0 up to and including 59 for
     * {@link #TYPE_TIME}.
     * Can be used with {@link #TYPE_TIME} or {@link #TYPE_DURATION}.
     */
    @FlaggedApi(FLAG_TTS_SPAN_DURATION)
@@ -1144,7 +1146,7 @@ public class TtsSpan implements ParcelableSpan {
         * @return This instance.
         * @see #ARG_HOURS
         */
        public TimeBuilder setHours(int hours) {
        public TimeBuilder setHours(@IntRange(from = 0, to = 24) int hours) {
            return setIntArgument(TtsSpan.ARG_HOURS, hours);
        }

@@ -1155,7 +1157,7 @@ public class TtsSpan implements ParcelableSpan {
         * @return This instance.
         * @see #ARG_MINUTES
         */
        public TimeBuilder setMinutes(int minutes) {
        public TimeBuilder setMinutes(@IntRange(from = 0, to = 59) int minutes) {
            return setIntArgument(TtsSpan.ARG_MINUTES, minutes);
        }

@@ -1166,7 +1168,7 @@ public class TtsSpan implements ParcelableSpan {
         */
        @FlaggedApi(FLAG_TTS_SPAN_DURATION)
        @NonNull
        public TimeBuilder setSeconds(int seconds) {
        public TimeBuilder setSeconds(@IntRange(from = 0, to = 59) int seconds) {
            return setIntArgument(TtsSpan.ARG_SECONDS, seconds);
        }
    }