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

Commit 27674aed authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Add auto-doc support for @StringDef."

parents e5634eeb 5db9a911
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -52,7 +52,9 @@ import static java.lang.annotation.RetentionPolicy.SOURCE;
@Target({ANNOTATION_TYPE})
public @interface IntDef {
    /** Defines the constant prefix for this element */
    String[] prefix() default "";
    String[] prefix() default {};
    /** Defines the constant suffix for this element */
    String[] suffix() default {};

    /** Defines the allowed constants for this element */
    int[] value() default {};
+5 −0
Original line number Diff line number Diff line
@@ -46,6 +46,11 @@ import static java.lang.annotation.RetentionPolicy.SOURCE;
@Retention(SOURCE)
@Target({ANNOTATION_TYPE})
public @interface StringDef {
    /** Defines the constant prefix for this element */
    String[] prefix() default {};
    /** Defines the constant suffix for this element */
    String[] suffix() default {};

    /** Defines the allowed constants for this element */
    String[] value() default {};
}
+17 −3
Original line number Diff line number Diff line
@@ -37,6 +37,8 @@ import android.os.RemoteException;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.Preconditions;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -53,8 +55,20 @@ public final class Slice implements Parcelable {
    /**
     * @hide
     */
    @StringDef({HINT_TITLE, HINT_LIST, HINT_LIST_ITEM, HINT_LARGE, HINT_ACTIONS, HINT_SELECTED,
            HINT_NO_TINT, HINT_PARTIAL})
    @StringDef(prefix = { "HINT_" }, value = {
            HINT_TITLE,
            HINT_LIST,
            HINT_LIST_ITEM,
            HINT_LARGE,
            HINT_ACTIONS,
            HINT_SELECTED,
            HINT_NO_TINT,
            HINT_HIDDEN,
            HINT_TOGGLE,
            HINT_HORIZONTAL,
            HINT_PARTIAL,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface SliceHint {}

    /**
+12 −2
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@ import android.widget.RemoteViews;

import com.android.internal.util.ArrayUtils;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Arrays;
import java.util.List;

@@ -55,8 +57,16 @@ public final class SliceItem implements Parcelable {
    /**
     * @hide
     */
    @StringDef({FORMAT_SLICE, FORMAT_TEXT, FORMAT_IMAGE, FORMAT_ACTION, FORMAT_COLOR,
            FORMAT_TIMESTAMP, FORMAT_REMOTE_INPUT})
    @StringDef(prefix = { "FORMAT_" }, value = {
            FORMAT_SLICE,
            FORMAT_TEXT,
            FORMAT_IMAGE,
            FORMAT_ACTION,
            FORMAT_COLOR,
            FORMAT_TIMESTAMP,
            FORMAT_REMOTE_INPUT,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface SliceType {}

    /**
+1 −1
Original line number Diff line number Diff line
@@ -2913,7 +2913,7 @@ public abstract class Context {
            @Nullable String profileFile, @Nullable Bundle arguments);

    /** @hide */
    @StringDef({
    @StringDef(suffix = { "_SERVICE" }, value = {
            POWER_SERVICE,
            WINDOW_SERVICE,
            LAYOUT_INFLATER_SERVICE,
Loading