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

Commit b842f444 authored by Conrad Chen's avatar Conrad Chen
Browse files

Add TvProvider methods to get and add columns

Test: gts-tradefed run gts -m GtsTvTestCases
Bug: 34684896
Change-Id: If284879a96199d26063312e2af7401c9a9066cea
parent 54eb1d49
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -25820,6 +25820,12 @@ package android.media.tv {
    method public static final boolean isChannelUriForTunerInput(android.net.Uri);
    method public static final boolean isProgramUri(android.net.Uri);
    field public static final java.lang.String AUTHORITY = "android.media.tv";
    field public static final java.lang.String EXTRA_COLUMN_NAME = "android.media.tv.extra.COLUMN_NAME";
    field public static final java.lang.String EXTRA_EXISTING_COLUMN_NAMES = "android.media.tv.extra.EXISTING_COLUMN_NAMES";
    field public static final java.lang.String EXTRA_DATA_TYPE = "android.media.tv.extra.DATA_TYPE";
    field public static final java.lang.String EXTRA_DEFAULT_VALUE = "android.media.tv.extra.DEFAULT_VALUE";
    field public static final java.lang.String METHOD_ADD_COLUMN = "add_column";
    field public static final java.lang.String METHOD_GET_COLUMNS = "get_columns";
  }
  public static abstract interface TvContract.BaseProgramColumns implements android.media.tv.TvContract.BaseTvColumns {
+93 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.IBinder;
import android.provider.BaseColumns;
import android.text.TextUtils;
@@ -71,6 +72,98 @@ public final class TvContract {
    private static final String PATH_PREVIEW_PROGRAM = "preview_program";
    private static final String PATH_PASSTHROUGH = "passthrough";

    /**
     * The method name to get existing columns in the given table of the specified content provider.
     *
     * <p>The method caller must provide the following parameter:
     * <ul>
     *     <li>{@code arg}: The content URI of the target table as a {@link String}.</li>
     * </ul>

     * <p>On success, the returned {@link android.os.Bundle} will include existing column names
     * with the key {@link #EXTRA_EXISTING_COLUMN_NAMES}. Otherwise, the return value will be {@code null}.
     *
     * @see ContentResolver#call(Uri, String, String, Bundle)
     * @see #EXTRA_EXISTING_COLUMN_NAMES
     * @hide
     */
    @SystemApi
    public static final String METHOD_GET_COLUMNS = "get_columns";

    /**
     * The method name to add a new column in the given table of the specified content provider.
     *
     * <p>The method caller must provide the following parameter:
     * <ul>
     *     <li>{@code arg}: The content URI of the target table as a {@link String}.</li>
     *     <li>{@code extra}: Name, data type, and default value of the new column in a Bundle:
     *         <ul>
     *             <li>{@link #EXTRA_COLUMN_NAME} the column name as a {@link String}.</li>
     *             <li>{@link #EXTRA_DATA_TYPE} the data type as a {@link String}.</li>
     *             <li>{@link #EXTRA_DEFAULT_VALUE} the default value as a {@link String}.
     *                 (optional)</li>
     *         </ul>
     *     </li>
     * </ul>
     *
     * <p>On success, the returned {@link android.os.Bundle} will include current colum names after
     * the addition operation with the key {@link #EXTRA_EXISTING_COLUMN_NAMES}. Otherwise, the
     * return value will be {@code null}.
     *
     * @see ContentResolver#call(Uri, String, String, Bundle)
     * @see #EXTRA_COLUMN_NAME
     * @see #EXTRA_DATA_TYPE
     * @see #EXTRA_DEFAULT_VALUE
     * @see #EXTRA_EXISTING_COLUMN_NAMES
     * @hide
     */
    @SystemApi
    public static final String METHOD_ADD_COLUMN = "add_column";

    /**
     * The key for a returned {@link Bundle} value containing existing column names in the given
     * table as an {@link ArrayList} of {@link String}.
     *
     * @see #METHOD_GET_COLUMNS
     * @see #METHOD_ADD_COLUMN
     * @hide
     */
    @SystemApi
    public static final String EXTRA_EXISTING_COLUMN_NAMES =
            "android.media.tv.extra.EXISTING_COLUMN_NAMES";

    /**
     * The key for a {@link Bundle} parameter containing the new column name to be added in the
     * given table as a non-empty {@link CharSequence}.
     *
     * @see #METHOD_ADD_COLUMN
     * @hide
     */
    @SystemApi
    public static final String EXTRA_COLUMN_NAME = "android.media.tv.extra.COLUMN_NAME";

    /**
     * The key for a {@link Bundle} parameter containing the data type of the new column to be added
     * in the given table as a non-empty {@link CharSequence}, which should be one of the following
     * values: {@code "TEXT"}, {@code "INTEGER"}, {@code "REAL"}, or {@code "BLOB"}.
     *
     * @see #METHOD_ADD_COLUMN
     * @hide
     */
    @SystemApi
    public static final String EXTRA_DATA_TYPE = "android.media.tv.extra.DATA_TYPE";

    /**
     * The key for a {@link Bundle} parameter containing the default value of the new column to be
     * added in the given table as a {@link CharSequence}, which represents a valid default value
     * according to the data type provided with {@link #EXTRA_DATA_TYPE}.
     *
     * @see #METHOD_ADD_COLUMN
     * @hide
     */
    @SystemApi
    public static final String EXTRA_DEFAULT_VALUE = "android.media.tv.extra.DEFAULT_VALUE";

    /**
     * An optional query, update or delete URI parameter that allows the caller to specify TV input
     * ID to filter channels.