diff --git a/core/api/current.txt b/core/api/current.txt index 53273bf1cea70..022e29f8d8a67 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -26559,7 +26559,11 @@ package android.media.tv { public final class TableResponse extends android.media.tv.BroadcastInfoResponse implements android.os.Parcelable { ctor public TableResponse(int, int, int, @Nullable android.net.Uri, int, int); + ctor public TableResponse(int, int, int, @NonNull byte[], int, int); + ctor public TableResponse(int, int, int, @NonNull android.os.SharedMemory, int, int); method public int getSize(); + method @Nullable public byte[] getTableByteArray(); + method @Nullable public android.os.SharedMemory getTableSharedMemory(); method @Nullable public android.net.Uri getTableUri(); method public int getVersion(); field @NonNull public static final android.os.Parcelable.Creator CREATOR; @@ -26567,7 +26571,9 @@ package android.media.tv { public final class TimelineRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable { ctor public TimelineRequest(int, int, int); + ctor public TimelineRequest(int, int, int, @NonNull String); method public int getIntervalMillis(); + method @Nullable public String getSelector(); field @NonNull public static final android.os.Parcelable.Creator CREATOR; } diff --git a/media/java/android/media/tv/TableResponse.java b/media/java/android/media/tv/TableResponse.java index 1c314b09db9a2..fb4e99cb1098f 100644 --- a/media/java/android/media/tv/TableResponse.java +++ b/media/java/android/media/tv/TableResponse.java @@ -54,6 +54,17 @@ public final class TableResponse extends BroadcastInfoResponse implements Parcel return new TableResponse(in); } + /** + * Constructs a TableResponse with a table URI. + * + * @param requestId The ID is used to associate the response with the request. + * @param sequence The sequence number which indicates the order of related responses. + * @param responseResult The result for the response. It's one of {@link #RESPONSE_RESULT_OK}, + * {@link #RESPONSE_RESULT_CANCEL}, {@link #RESPONSE_RESULT_ERROR}. + * @param tableUri The URI of the table in the database. + * @param version The version number of requested table. + * @param size The Size number of table in bytes. + */ public TableResponse(int requestId, int sequence, @ResponseResult int responseResult, @Nullable Uri tableUri, int version, int size) { super(RESPONSE_TYPE, requestId, sequence, responseResult); @@ -64,7 +75,19 @@ public final class TableResponse extends BroadcastInfoResponse implements Parcel mTableSharedMemory = null; } - /** @hide */ + /** + * Constructs a TableResponse with a table URI. + * + * @param requestId The ID is used to associate the response with the request. + * @param sequence The sequence number which indicates the order of related responses. + * @param responseResult The result for the response. It's one of {@link #RESPONSE_RESULT_OK}, + * {@link #RESPONSE_RESULT_CANCEL}, {@link #RESPONSE_RESULT_ERROR}. + * @param tableByteArray The byte array which stores the table in bytes. The structure and + * syntax of the table depends on the table name in + * {@link TableRequest#getTableName()} and the corresponding standard. + * @param version The version number of requested table. + * @param size The Size number of table in bytes. + */ public TableResponse(int requestId, int sequence, @ResponseResult int responseResult, @NonNull byte[] tableByteArray, int version, int size) { super(RESPONSE_TYPE, requestId, sequence, responseResult); @@ -75,7 +98,21 @@ public final class TableResponse extends BroadcastInfoResponse implements Parcel mTableSharedMemory = null; } - /** @hide */ + /** + * Constructs a TableResponse with a table URI. + * + * @param requestId The ID is used to associate the response with the request. + * @param sequence The sequence number which indicates the order of related responses. + * @param responseResult The result for the response. It's one of {@link #RESPONSE_RESULT_OK}, + * {@link #RESPONSE_RESULT_CANCEL}, {@link #RESPONSE_RESULT_ERROR}. + * @param tableSharedMemory The shared memory which stores the table. The table size can be + * large so using a shared memory optimizes the data + * communication between the table data source and the receiver. The + * structure syntax of the table depends on the table name in + * {@link TableRequest#getTableName()} and the corresponding standard. + * @param version The version number of requested table. + * @param size The Size number of table in bytes. + */ public TableResponse(int requestId, int sequence, @ResponseResult int responseResult, @NonNull SharedMemory tableSharedMemory, int version, int size) { super(RESPONSE_TYPE, requestId, sequence, responseResult); @@ -115,7 +152,6 @@ public final class TableResponse extends BroadcastInfoResponse implements Parcel * * @return the table data as a byte array, or {@code null} if the data is not stored as a byte * array. - * @hide */ @Nullable public byte[] getTableByteArray() { @@ -125,9 +161,14 @@ public final class TableResponse extends BroadcastInfoResponse implements Parcel /** * Gets the data of the table as a {@link SharedMemory} object. * + *

This data lives in a {@link SharedMemory} instance because of the potentially large + * amount of data needed to store the table. This optimizes the data communication between the + * table data source and the receiver. + * * @return the table data as a {@link SharedMemory} object, or {@code null} if the data is not * stored in shared memory. - * @hide + * + * @see SharedMemory#map(int, int, int) */ @Nullable public SharedMemory getTableSharedMemory() { diff --git a/media/java/android/media/tv/TimelineRequest.java b/media/java/android/media/tv/TimelineRequest.java index d04c58a9b869e..77613dc6e65c3 100644 --- a/media/java/android/media/tv/TimelineRequest.java +++ b/media/java/android/media/tv/TimelineRequest.java @@ -17,6 +17,7 @@ package android.media.tv; import android.annotation.NonNull; +import android.annotation.Nullable; import android.os.Parcel; import android.os.Parcelable; @@ -54,7 +55,6 @@ public final class TimelineRequest extends BroadcastInfoRequest implements Parce mSelector = null; } - /** @hide */ public TimelineRequest(int requestId, @RequestOption int option, int intervalMillis, @NonNull String selector) { super(REQUEST_TYPE, requestId, option); @@ -81,8 +81,8 @@ public final class TimelineRequest extends BroadcastInfoRequest implements Parce * {@code urn:dvb:css:timeline:pts} is a selector in DVB standard. * * @return the selector if it's set; {@code null} otherwise. - * @hide */ + @Nullable public String getSelector() { return mSelector; }