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

Commit 2ec7deca authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add TvProvider methods to block or unblock package, get blocked packages" into oc-dev

parents 819740cc 0b8df1de
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -26497,6 +26497,7 @@ package android.media.tv {
    field public static final java.lang.String ACTION_REQUEST_CHANNEL_BROWSABLE = "android.media.tv.action.REQUEST_CHANNEL_BROWSABLE";
    field public static final java.lang.String ACTION_WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED = "android.media.tv.action.WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED";
    field public static final java.lang.String AUTHORITY = "android.media.tv";
    field public static final java.lang.String EXTRA_BLOCKED_PACKAGES = "android.media.tv.extra.BLOCKED_PACKAGES";
    field public static final java.lang.String EXTRA_CHANNEL_ID = "android.media.tv.extra.CHANNEL_ID";
    field public static final java.lang.String EXTRA_COLUMN_NAME = "android.media.tv.extra.COLUMN_NAME";
    field public static final java.lang.String EXTRA_DATA_TYPE = "android.media.tv.extra.DATA_TYPE";
@@ -26504,9 +26505,16 @@ package android.media.tv {
    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_PACKAGE_NAME = "android.media.tv.extra.PACKAGE_NAME";
    field public static final java.lang.String EXTRA_PREVIEW_PROGRAM_ID = "android.media.tv.extra.PREVIEW_PROGRAM_ID";
    field public static final java.lang.String EXTRA_RESULT_CODE = "android.media.tv.extra.RESULT_CODE";
    field public static final java.lang.String EXTRA_WATCH_NEXT_PROGRAM_ID = "android.media.tv.extra.WATCH_NEXT_PROGRAM_ID";
    field public static final java.lang.String METHOD_ADD_COLUMN = "add_column";
    field public static final java.lang.String METHOD_BLOCK_PACKAGE = "block_package";
    field public static final java.lang.String METHOD_GET_BLOCKED_PACKAGES = "get_blocked_packages";
    field public static final java.lang.String METHOD_GET_COLUMNS = "get_columns";
    field public static final java.lang.String METHOD_UNBLOCK_PACKAGE = "unblock_package";
    field public static final int RESULT_ERROR_INVALID_ARGUMENT = 2; // 0x2
    field public static final int RESULT_ERROR_IO = 1; // 0x1
    field public static final int RESULT_OK = 0; // 0x0
  }
  public static abstract interface TvContract.BaseTvColumns implements android.provider.BaseColumns {
@@ -26537,7 +26545,6 @@ package android.media.tv {
    field public static final java.lang.String COLUMN_SEARCHABLE = "searchable";
    field public static final java.lang.String COLUMN_SERVICE_ID = "service_id";
    field public static final java.lang.String COLUMN_SERVICE_TYPE = "service_type";
    field public static final java.lang.String COLUMN_SYSTEM_APPROVED = "system_approved";
    field public static final java.lang.String COLUMN_TRANSIENT = "transient";
    field public static final java.lang.String COLUMN_TRANSPORT_STREAM_ID = "transport_stream_id";
    field public static final java.lang.String COLUMN_TYPE = "type";
+114 −13
Original line number Diff line number Diff line
@@ -186,6 +186,38 @@ public final class TvContract {
    public static final String EXTRA_WATCH_NEXT_PROGRAM_ID =
            "android.media.tv.extra.WATCH_NEXT_PROGRAM_ID";

    /**
     * The key for a bundle parameter containing the result code of a method call as an integer.
     *
     * @see #RESULT_OK
     * @see #RESULT_ERROR_IO
     * @see #RESULT_ERROR_INVALID_ARGUMENT
     * @hide
     */
    @SystemApi
    public static final String EXTRA_RESULT_CODE = "android.media.tv.extra.RESULT_CODE";

    /**
     * The result code for a successful execution without error.
     * @hide
     */
    @SystemApi
    public static final int RESULT_OK = 0;

    /**
     * The result code for a failure from I/O operation.
     * @hide
     */
    @SystemApi
    public static final int RESULT_ERROR_IO = 1;

    /**
     * The result code for a failure from invalid argument.
     * @hide
     */
    @SystemApi
    public static final int RESULT_ERROR_INVALID_ARGUMENT = 2;

    /**
     * The method name to get existing columns in the given table of the specified content provider.
     *
@@ -234,6 +266,78 @@ public final class TvContract {
    @SystemApi
    public static final String METHOD_ADD_COLUMN = "add_column";

    /**
     * The method name to get all the blocked packages. When a package is blocked, all the data for
     * preview programs/channels and watch next programs belonging to this package in the content
     * provider will be cleared. Once a package is blocked, {@link SecurityException} will be thrown
     * for all the requests to preview programs/channels and watch next programs via
     * {@link android.content.ContentProvider} from it.
     *
     * <p>The returned {@link android.os.Bundle} will include all the blocked package names with the
     * key {@link #EXTRA_BLOCKED_PACKAGES}.
     *
     * @see ContentResolver#call(Uri, String, String, Bundle)
     * @see #EXTRA_BLOCKED_PACKAGES
     * @see #METHOD_BLOCK_PACKAGE
     * @see #METHOD_UNBLOCK_PACKAGE
     * @hide
     */
    @SystemApi
    public static final String METHOD_GET_BLOCKED_PACKAGES = "get_blocked_packages";

    /**
     * The method name to block the access from the given package. When a package is blocked, all
     * the data for preview programs/channels and watch next programs belonging to this package in
     * the content provider will be cleared. Once a package is blocked, {@link SecurityException}
     * will be thrown for all the requests to preview programs/channels and watch next programs via
     * {@link android.content.ContentProvider} from it.
     *
     * <p>The method caller must provide the following parameter:
     * <ul>
     *     <li>{@code arg}: The package name to be added as blocked package {@link String}.</li>
     * </ul>
     *
     * <p>The returned {@link android.os.Bundle} will include an integer code denoting whether the
     * execution is successful or not with the key {@link #EXTRA_RESULT_CODE}. If {@code arg} is
     * empty, the result code will be {@link #RESULT_ERROR_INVALID_ARGUMENT}. If success, the result
     * code will be {@link #RESULT_OK}. Otherwise, the result code will be {@link #RESULT_ERROR_IO}.
     *
     * @see ContentResolver#call(Uri, String, String, Bundle)
     * @see #EXTRA_RESULT_CODE
     * @see #METHOD_GET_BLOCKED_PACKAGES
     * @see #METHOD_UNBLOCK_PACKAGE
     * @hide
     */
    @SystemApi
    public static final String METHOD_BLOCK_PACKAGE = "block_package";

    /**
     * The method name to unblock the access from the given package. When a package is blocked, all
     * the data for preview programs/channels and watch next programs belonging to this package in
     * the content provider will be cleared. Once a package is blocked, {@link SecurityException}
     * will be thrown for all the requests to preview programs/channels and watch next programs via
     * {@link android.content.ContentProvider} from it.
     *
     * <p>The method caller must provide the following parameter:
     * <ul>
     *     <li>{@code arg}: The package name to be removed from blocked list as a {@link String}.
     *     </li>
     * </ul>
     *
     * <p>The returned {@link android.os.Bundle} will include an integer code denoting whether the
     * execution is successful or not with the key {@link #EXTRA_RESULT_CODE}. If {@code arg} is
     * empty, the result code will be {@link #RESULT_ERROR_INVALID_ARGUMENT}. If success, the result
     * code will be {@link #RESULT_OK}. Otherwise, the result code will be {@link #RESULT_ERROR_IO}.
     *
     * @see ContentResolver#call(Uri, String, String, Bundle)
     * @see #EXTRA_RESULT_CODE
     * @see #METHOD_GET_BLOCKED_PACKAGES
     * @see #METHOD_BLOCK_PACKAGE
     * @hide
     */
    @SystemApi
    public static final String METHOD_UNBLOCK_PACKAGE = "unblock_package";

    /**
     * The key for a returned {@link Bundle} value containing existing column names in the given
     * table as an {@link ArrayList} of {@link String}.
@@ -278,6 +382,16 @@ public final class TvContract {
    @SystemApi
    public static final String EXTRA_DEFAULT_VALUE = "android.media.tv.extra.DEFAULT_VALUE";

    /**
     * The key for a returned {@link Bundle} value containing all the blocked package names as an
     * {@link ArrayList} of {@link String}.
     *
     * @see #METHOD_GET_BLOCKED_PACKAGES
     * @hide
     */
    @SystemApi
    public static final String EXTRA_BLOCKED_PACKAGES = "android.media.tv.extra.BLOCKED_PACKAGES";

    /**
     * An optional query, update or delete URI parameter that allows the caller to specify TV input
     * ID to filter channels.
@@ -2228,19 +2342,6 @@ public final class TvContract {
         */
        public static final String COLUMN_TRANSIENT = "transient";

        /**
         * The flag indicating whether this TV channel is approved to be shown by the system.
         *
         * <p>A value of 1 indicates that the channel is approved to be shown by the system, and a
         * value of 0 indicates that the channel is blocked by system. If not specified, this value
         * is set to 0 (not approved) by default.
         *
         * <p>Type: INTEGER (boolean)
         * @hide
         */
        @SystemApi
        public static final String COLUMN_SYSTEM_APPROVED = "system_approved";

        private Channels() {}

        /**