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

Commit b399c842 authored by Zak Cohen's avatar Zak Cohen
Browse files

Add documentation for ContentSuggestionsManager classes.

Bug: 122545621
Change-Id: I449cd71a438410c4cd4796f99af0653750329654
Test: compile, documentation only change
parent a0f377fb
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -883,8 +883,8 @@ package android.app.contentsuggestions {
  public final class ClassificationsRequest implements android.os.Parcelable {
    method public int describeContents();
    method public android.os.Bundle getExtras();
    method public java.util.List<android.app.contentsuggestions.ContentSelection> getSelections();
    method @Nullable public android.os.Bundle getExtras();
    method @NonNull public java.util.List<android.app.contentsuggestions.ContentSelection> getSelections();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.contentsuggestions.ClassificationsRequest> CREATOR;
  }
@@ -898,8 +898,8 @@ package android.app.contentsuggestions {
  public final class ContentClassification implements android.os.Parcelable {
    ctor public ContentClassification(@NonNull String, @NonNull android.os.Bundle);
    method public int describeContents();
    method public android.os.Bundle getExtras();
    method public String getId();
    method @NonNull public android.os.Bundle getExtras();
    method @NonNull public String getId();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.contentsuggestions.ContentClassification> CREATOR;
  }
@@ -907,8 +907,8 @@ package android.app.contentsuggestions {
  public final class ContentSelection implements android.os.Parcelable {
    ctor public ContentSelection(@NonNull String, @NonNull android.os.Bundle);
    method public int describeContents();
    method public android.os.Bundle getExtras();
    method public String getId();
    method @NonNull public android.os.Bundle getExtras();
    method @NonNull public String getId();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.contentsuggestions.ContentSelection> CREATOR;
  }
@@ -930,8 +930,8 @@ package android.app.contentsuggestions {
  public final class SelectionsRequest implements android.os.Parcelable {
    method public int describeContents();
    method public android.os.Bundle getExtras();
    method public android.graphics.Point getInterestPoint();
    method @Nullable public android.os.Bundle getExtras();
    method @Nullable public android.graphics.Point getInterestPoint();
    method public int getTaskId();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.contentsuggestions.SelectionsRequest> CREATOR;
+8 −3
Original line number Diff line number Diff line
@@ -26,6 +26,11 @@ import android.os.Parcelable;
import java.util.List;

/**
 * Request object used when asking {@link ContentSuggestionsManager} to classify content selections.
 *
 * <p>The request contains a list of {@link ContentSelection} objects to be classified along with
 * implementation specific extras.
 *
 * @hide
 */
@SystemApi
@@ -44,14 +49,14 @@ public final class ClassificationsRequest implements Parcelable {
    /**
     * Return request selections.
     */
    public List<ContentSelection> getSelections() {
    public @NonNull List<ContentSelection> getSelections() {
        return mSelections;
    }

    /**
     * Return the request extras.
     * Return the request extras or {@code null} if there are none.
     */
    public Bundle getExtras() {
    public @Nullable Bundle getExtras() {
        return mExtras;
    }

+11 −2
Original line number Diff line number Diff line
@@ -23,6 +23,9 @@ import android.os.Parcel;
import android.os.Parcelable;

/**
 * Represents the classification of a content suggestion. The result of a
 * {@link ClassificationsRequest} to {@link ContentSuggestionsManager}.
 *
 * @hide
 */
@SystemApi
@@ -32,6 +35,12 @@ public final class ContentClassification implements Parcelable {
    @NonNull
    private final Bundle mExtras;

    /**
     * Default constructor.
     *
     * @param classificationId implementation specific id for the selection /  classification.
     * @param extras containing the classification data.
     */
    public ContentClassification(@NonNull String classificationId, @NonNull Bundle extras) {
        mClassificationId = classificationId;
        mExtras = extras;
@@ -40,14 +49,14 @@ public final class ContentClassification implements Parcelable {
    /**
     * Return the classification id.
     */
    public String getId() {
    public @NonNull String getId() {
        return mClassificationId;
    }

    /**
     * Return the classification extras.
     */
    public Bundle getExtras() {
    public @NonNull Bundle getExtras() {
        return mExtras;
    }

+11 −2
Original line number Diff line number Diff line
@@ -23,6 +23,9 @@ import android.os.Parcel;
import android.os.Parcelable;

/**
 * Represents a suggested selection within a set of on screen content. The result of a
 * {@link SelectionsRequest} to {@link ContentSuggestionsManager}.
 *
 * @hide
 */
@SystemApi
@@ -32,6 +35,12 @@ public final class ContentSelection implements Parcelable {
    @NonNull
    private final Bundle mExtras;

    /**
     * Default constructor.
     *
     * @param selectionId implementation specific id for the selection.
     * @param extras containing the data that represents the selection.
     */
    public ContentSelection(@NonNull String selectionId, @NonNull Bundle extras) {
        mSelectionId = selectionId;
        mExtras = extras;
@@ -40,14 +49,14 @@ public final class ContentSelection implements Parcelable {
    /**
     * Return the selection id.
     */
    public String getId() {
    public @NonNull String getId() {
        return mSelectionId;
    }

    /**
     * Return the selection extras.
     */
    public Bundle getExtras() {
    public @NonNull Bundle getExtras() {
        return mExtras;
    }

+16 −4
Original line number Diff line number Diff line
@@ -25,6 +25,12 @@ import android.os.Parcel;
import android.os.Parcelable;

/**
 * The request object used to request content selections from {@link ContentSuggestionsManager}.
 *
 * <p>Selections are requested for a given taskId as specified by
 * {@link android.app.ActivityManager} and optionally take an interest point that specifies the
 * point on the screen that should be considered as the most important.
 *
 * @hide
 */
@SystemApi
@@ -49,16 +55,17 @@ public final class SelectionsRequest implements Parcelable {
    }

    /**
     * Return the request point of interest.
     * Return the request point of interest or {@code null} if there is no point of interest for
     * this request.
     */
    public Point getInterestPoint() {
    public @Nullable Point getInterestPoint() {
        return mInterestPoint;
    }

    /**
     * Return the request extras.
     * Return the request extras or {@code null} if there aren't any.
     */
    public Bundle getExtras() {
    public @Nullable Bundle getExtras() {
        return mExtras;
    }

@@ -99,6 +106,11 @@ public final class SelectionsRequest implements Parcelable {
        private Point mInterestPoint;
        private Bundle mExtras;

        /**
         * Default constructor.
         *
         * @param taskId of the type used by {@link android.app.ActivityManager}
         */
        public Builder(int taskId) {
            mTaskId = taskId;
        }