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

Commit 93b2e233 authored by Shubang Lu's avatar Shubang Lu Committed by Android (Google) Code Review
Browse files

Merge changes from topic "tiaf_cts_broadcastInfo"

* changes:
  TIAF: unhide broadcastInfo related classes and functions 2
  TIAF: unhide broadcastInfo related classes and functions
parents bf9a16b7 abeee53e
Loading
Loading
Loading
Loading
+164 −0
Original line number Diff line number Diff line
@@ -24946,6 +24946,156 @@ package android.media.tv {
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.AitInfo> CREATOR;
  }
  public abstract class BroadcastInfoRequest implements android.os.Parcelable {
    method public int describeContents();
    method public int getOption();
    method public int getRequestId();
    method public int getType();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.BroadcastInfoRequest> CREATOR;
    field public static final int REQUEST_OPTION_AUTO_UPDATE = 1; // 0x1
    field public static final int REQUEST_OPTION_REPEAT = 0; // 0x0
  }
  public abstract class BroadcastInfoResponse implements android.os.Parcelable {
    method public int describeContents();
    method public int getRequestId();
    method public int getResponseResult();
    method public int getSequence();
    method public int getType();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.BroadcastInfoResponse> CREATOR;
    field public static final int RESPONSE_RESULT_CANCEL = 3; // 0x3
    field public static final int RESPONSE_RESULT_ERROR = 1; // 0x1
    field public static final int RESPONSE_RESULT_OK = 2; // 0x2
  }
  public final class CommandRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable {
    ctor public CommandRequest(int, int, @NonNull String, @NonNull String, @NonNull String);
    method @NonNull public String getArguments();
    method @NonNull public String getName();
    method @NonNull public String getNameSpace();
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.CommandRequest> CREATOR;
  }
  public final class CommandResponse extends android.media.tv.BroadcastInfoResponse implements android.os.Parcelable {
    ctor public CommandResponse(int, int, int, @Nullable String);
    method @Nullable public String getResponse();
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.CommandResponse> CREATOR;
  }
  public final class DsmccRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable {
    ctor public DsmccRequest(int, int, @NonNull android.net.Uri);
    method @NonNull public android.net.Uri getUri();
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.DsmccRequest> CREATOR;
  }
  public final class DsmccResponse extends android.media.tv.BroadcastInfoResponse implements android.os.Parcelable {
    ctor public DsmccResponse(int, int, int, @Nullable android.os.ParcelFileDescriptor);
    ctor public DsmccResponse(int, int, int, boolean, @Nullable java.util.List<java.lang.String>);
    ctor public DsmccResponse(int, int, int, @Nullable int[], @Nullable String[]);
    method @NonNull public String getBiopMessageType();
    method @NonNull public java.util.List<java.lang.String> getChildList();
    method @NonNull public android.os.ParcelFileDescriptor getFile();
    method @NonNull public int[] getStreamEventIds();
    method @NonNull public String[] getStreamEventNames();
    field public static final String BIOP_MESSAGE_TYPE_DIRECTORY = "directory";
    field public static final String BIOP_MESSAGE_TYPE_FILE = "file";
    field public static final String BIOP_MESSAGE_TYPE_SERVICE_GATEWAY = "service_gateway";
    field public static final String BIOP_MESSAGE_TYPE_STREAM = "stream";
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.DsmccResponse> CREATOR;
  }
  public final class PesRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable {
    ctor public PesRequest(int, int, int, int);
    method public int getStreamId();
    method public int getTsPid();
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.PesRequest> CREATOR;
  }
  public final class PesResponse extends android.media.tv.BroadcastInfoResponse implements android.os.Parcelable {
    ctor public PesResponse(int, int, int, @Nullable String);
    method @Nullable public String getSharedFilterToken();
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.PesResponse> CREATOR;
  }
  public final class SectionRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable {
    ctor public SectionRequest(int, int, int, int, int);
    method public int getTableId();
    method public int getTsPid();
    method public int getVersion();
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.SectionRequest> CREATOR;
  }
  public final class SectionResponse extends android.media.tv.BroadcastInfoResponse implements android.os.Parcelable {
    ctor public SectionResponse(int, int, int, int, int, @Nullable android.os.Bundle);
    method @NonNull public android.os.Bundle getSessionData();
    method public int getSessionId();
    method public int getVersion();
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.SectionResponse> CREATOR;
  }
  public final class StreamEventRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable {
    ctor public StreamEventRequest(int, int, @NonNull android.net.Uri, @NonNull String);
    method @NonNull public String getEventName();
    method @NonNull public android.net.Uri getTargetUri();
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.StreamEventRequest> CREATOR;
  }
  public final class StreamEventResponse extends android.media.tv.BroadcastInfoResponse implements android.os.Parcelable {
    ctor public StreamEventResponse(int, int, int, int, long, @Nullable byte[]);
    method @Nullable public byte[] getData();
    method public int getEventId();
    method public long getNpt();
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.StreamEventResponse> CREATOR;
  }
  public final class TableRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable {
    ctor public TableRequest(int, int, int, int, int);
    method public int getTableId();
    method public int getTableName();
    method public int getVersion();
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.TableRequest> CREATOR;
    field public static final int TABLE_NAME_PAT = 0; // 0x0
    field public static final int TABLE_NAME_PMT = 1; // 0x1
  }
  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);
    method public int getSize();
    method @Nullable public android.net.Uri getTableUri();
    method public int getVersion();
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.TableResponse> CREATOR;
  }
  public final class TimelineRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable {
    ctor public TimelineRequest(int, int, int);
    method public int getIntervalMillis();
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.TimelineRequest> CREATOR;
  }
  public final class TimelineResponse extends android.media.tv.BroadcastInfoResponse implements android.os.Parcelable {
    ctor public TimelineResponse(int, int, int, @Nullable String, int, int, long, long);
    method @Nullable public String getSelector();
    method public long getTicks();
    method public int getUnitsPerSecond();
    method public int getUnitsPerTick();
    method public long getWallClock();
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.TimelineResponse> CREATOR;
  }
  public final class TsRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable {
    ctor public TsRequest(int, int, int);
    method public int getTsPid();
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.TsRequest> CREATOR;
  }
  public final class TsResponse extends android.media.tv.BroadcastInfoResponse implements android.os.Parcelable {
    ctor public TsResponse(int, int, int, @Nullable String);
    method @Nullable public String getSharedFilterToken();
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.TsResponse> CREATOR;
  }
  public final class TvContentRating {
    method public boolean contains(@NonNull android.media.tv.TvContentRating);
    method public static android.media.tv.TvContentRating createRating(String, String, String, java.lang.String...);
@@ -25432,6 +25582,14 @@ package android.media.tv {
    field public static final String ACTION_QUERY_CONTENT_RATING_SYSTEMS = "android.media.tv.action.QUERY_CONTENT_RATING_SYSTEMS";
    field public static final String ACTION_SETUP_INPUTS = "android.media.tv.action.SETUP_INPUTS";
    field public static final String ACTION_VIEW_RECORDING_SCHEDULES = "android.media.tv.action.VIEW_RECORDING_SCHEDULES";
    field public static final int BROADCAST_INFO_STREAM_EVENT = 5; // 0x5
    field public static final int BROADCAST_INFO_TYPE_COMMAND = 7; // 0x7
    field public static final int BROADCAST_INFO_TYPE_DSMCC = 6; // 0x6
    field public static final int BROADCAST_INFO_TYPE_PES = 4; // 0x4
    field public static final int BROADCAST_INFO_TYPE_SECTION = 3; // 0x3
    field public static final int BROADCAST_INFO_TYPE_TABLE = 2; // 0x2
    field public static final int BROADCAST_INFO_TYPE_TIMELINE = 8; // 0x8
    field public static final int BROADCAST_INFO_TYPE_TS = 1; // 0x1
    field public static final int INPUT_STATE_CONNECTED = 0; // 0x0
    field public static final int INPUT_STATE_CONNECTED_STANDBY = 1; // 0x1
    field public static final int INPUT_STATE_DISCONNECTED = 2; // 0x2
@@ -25521,6 +25679,7 @@ package android.media.tv {
    method public void layoutSurface(int, int, int, int);
    method public void notifyAdResponse(@NonNull android.media.tv.AdResponse);
    method public void notifyAitInfoUpdated(@NonNull android.media.tv.AitInfo);
    method public void notifyBroadcastInfoResponse(@NonNull android.media.tv.BroadcastInfoResponse);
    method public void notifyChannelRetuned(android.net.Uri);
    method public void notifyContentAllowed();
    method public void notifyContentBlocked(@NonNull android.media.tv.TvContentRating);
@@ -25540,7 +25699,9 @@ package android.media.tv {
    method public boolean onKeyUp(int, android.view.KeyEvent);
    method public void onOverlayViewSizeChanged(int, int);
    method public abstract void onRelease();
    method public void onRemoveBroadcastInfo(int);
    method public void onRequestAd(@NonNull android.media.tv.AdRequest);
    method public void onRequestBroadcastInfo(@NonNull android.media.tv.BroadcastInfoRequest);
    method public boolean onSelectTrack(int, @Nullable String);
    method public abstract void onSetCaptionEnabled(boolean);
    method public void onSetInteractiveAppNotificationEnabled(boolean);
@@ -25805,6 +25966,7 @@ package android.media.tv.interactive {
    method public void notifySessionStateChanged(int, int);
    method public final void notifyTeletextAppStateChanged(int);
    method public void onAdResponse(@NonNull android.media.tv.AdResponse);
    method public void onBroadcastInfoResponse(@NonNull android.media.tv.BroadcastInfoResponse);
    method public void onContentAllowed();
    method public void onContentBlocked(@NonNull android.media.tv.TvContentRating);
    method public void onCreateBiInteractiveApp(@NonNull android.net.Uri, @Nullable android.os.Bundle);
@@ -25836,7 +25998,9 @@ package android.media.tv.interactive {
    method public void onTuned(@NonNull android.net.Uri);
    method public void onVideoAvailable();
    method public void onVideoUnavailable(int);
    method public void removeBroadcastInfo(int);
    method public void requestAd(@NonNull android.media.tv.AdRequest);
    method public void requestBroadcastInfo(@NonNull android.media.tv.BroadcastInfoRequest);
    method public void requestCurrentChannelLcn();
    method public void requestCurrentChannelUri();
    method public void requestCurrentTvInputId();
+45 −8
Original line number Diff line number Diff line
@@ -18,19 +18,34 @@ package android.media.tv;

import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.SuppressLint;
import android.os.Parcel;
import android.os.Parcelable;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/** @hide */
/**
 * A request for the information retrieved from broadcast signal.
 */
@SuppressLint("ParcelNotFinal")
public abstract class BroadcastInfoRequest implements Parcelable {
    /** @hide */
    @Retention(RetentionPolicy.SOURCE)
    @IntDef({REQUEST_OPTION_REPEAT, REQUEST_OPTION_AUTO_UPDATE})
    public @interface RequestOption {}

    /**
     * Request option: repeat.
     * <p>With this option, a response is sent when related broadcast information is detected,
     * even if the same information has been sent previously.
     */
    public static final int REQUEST_OPTION_REPEAT = 0;
    /**
     * Request option: auto update.
     * <p>With this option, a response is sent only when broadcast information is detected for the
     * first time, new values are detected.
     */
    public static final int REQUEST_OPTION_AUTO_UPDATE = 1;

    public static final @NonNull Parcelable.Creator<BroadcastInfoRequest> CREATOR =
@@ -66,32 +81,54 @@ public abstract class BroadcastInfoRequest implements Parcelable {
                }
            };

    protected final @TvInputManager.BroadcastInfoType int mType;
    protected final int mRequestId;
    protected final @RequestOption int mOption;
    private final @TvInputManager.BroadcastInfoType int mType;
    private final int mRequestId;
    private final @RequestOption int mOption;

    protected BroadcastInfoRequest(@TvInputManager.BroadcastInfoType int type,
    BroadcastInfoRequest(@TvInputManager.BroadcastInfoType int type,
            int requestId, @RequestOption int option) {
        mType = type;
        mRequestId = requestId;
        mOption = option;
    }

    protected BroadcastInfoRequest(@TvInputManager.BroadcastInfoType int type, Parcel source) {
    BroadcastInfoRequest(@TvInputManager.BroadcastInfoType int type, Parcel source) {
        mType = type;
        mRequestId = source.readInt();
        mOption = source.readInt();
    }

    public @TvInputManager.BroadcastInfoType int getType() {
    /**
     * Gets the broadcast info type.
     *
     * <p>The type indicates what broadcast information is requested, such as broadcast table,
     * PES (packetized Elementary Stream), TS (transport stream), etc. The type of the
     * request and the related responses should be the same.
     */
    @TvInputManager.BroadcastInfoType
    public int getType() {
        return mType;
    }

    /**
     * Gets the ID of the request.
     *
     * <p>The ID is used to associate the response with the request.
     *
     * @see android.media.tv.BroadcastInfoResponse#getRequestId()
     */
    public int getRequestId() {
        return mRequestId;
    }

    public @RequestOption int getOption() {
    /**
     * Gets the request option of the request.
     *
     * @see #REQUEST_OPTION_REPEAT
     * @see #REQUEST_OPTION_AUTO_UPDATE
     */
    @RequestOption
    public int getOption() {
        return mOption;
    }

+50 −9
Original line number Diff line number Diff line
@@ -18,20 +18,35 @@ package android.media.tv;

import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.SuppressLint;
import android.os.Parcel;
import android.os.Parcelable;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/** @hide */
/**
 * A response of {@link BroadcastInfoRequest} for information retrieved from broadcast signal.
 */
@SuppressLint("ParcelNotFinal")
public abstract class BroadcastInfoResponse implements Parcelable {
    /** @hide */
    @Retention(RetentionPolicy.SOURCE)
    @IntDef({RESPONSE_RESULT_ERROR, RESPONSE_RESULT_OK, RESPONSE_RESULT_CANCEL})
    public @interface ResponseResult {}

    /**
     * Response result: error. This means the request can not be set up successfully.
     */
    public static final int RESPONSE_RESULT_ERROR = 1;
    /**
     * Response result: OK. This means the request is set up successfully and the related responses
     * are normal responses.
     */
    public static final int RESPONSE_RESULT_OK = 2;
    /**
     * Response result: cancel. This means the request has been cancelled.
     */
    public static final int RESPONSE_RESULT_CANCEL = 3;

    public static final @NonNull Parcelable.Creator<BroadcastInfoResponse> CREATOR =
@@ -67,12 +82,12 @@ public abstract class BroadcastInfoResponse implements Parcelable {
                }
            };

    protected final @TvInputManager.BroadcastInfoType int mType;
    protected final int mRequestId;
    protected final int mSequence;
    protected final @ResponseResult int mResponseResult;
    private final @TvInputManager.BroadcastInfoType int mType;
    private final int mRequestId;
    private final int mSequence;
    private final @ResponseResult int mResponseResult;

    protected BroadcastInfoResponse(@TvInputManager.BroadcastInfoType int type, int requestId,
    BroadcastInfoResponse(@TvInputManager.BroadcastInfoType int type, int requestId,
            int sequence, @ResponseResult int responseResult) {
        mType = type;
        mRequestId = requestId;
@@ -80,26 +95,52 @@ public abstract class BroadcastInfoResponse implements Parcelable {
        mResponseResult = responseResult;
    }

    protected BroadcastInfoResponse(@TvInputManager.BroadcastInfoType int type, Parcel source) {
    BroadcastInfoResponse(@TvInputManager.BroadcastInfoType int type, Parcel source) {
        mType = type;
        mRequestId = source.readInt();
        mSequence = source.readInt();
        mResponseResult = source.readInt();
    }

    public @TvInputManager.BroadcastInfoType int getType() {
    /**
     * Gets the broadcast info type.
     *
     * <p>The type indicates what broadcast information is requested, such as broadcast table,
     * PES (packetized Elementary Stream), TS (transport stream), etc. The type of the
     * request and the related responses should be the same.
     */
    @TvInputManager.BroadcastInfoType
    public int getType() {
        return mType;
    }

    /**
     * Gets the ID of the request.
     *
     * <p>The ID is used to associate the response with the request.
     *
     * @see android.media.tv.BroadcastInfoRequest#getRequestId()
     */
    public int getRequestId() {
        return mRequestId;
    }

    /**
     * Gets the sequence number which indicates the order of related responses.
     */
    public int getSequence() {
        return mSequence;
    }

    public @ResponseResult int getResponseResult() {
    /**
     * Gets the result for the response.
     *
     * @see #RESPONSE_RESULT_OK
     * @see #RESPONSE_RESULT_ERROR
     * @see #RESPONSE_RESULT_CANCEL
     */
    @ResponseResult
    public int getResponseResult() {
        return mResponseResult;
    }

+28 −8
Original line number Diff line number Diff line
@@ -20,9 +20,11 @@ import android.annotation.NonNull;
import android.os.Parcel;
import android.os.Parcelable;

/** @hide */
/**
 * A request for command from broadcast signal.
 */
public final class CommandRequest extends BroadcastInfoRequest implements Parcelable {
    public static final @TvInputManager.BroadcastInfoType int requestType =
    private static final @TvInputManager.BroadcastInfoType int REQUEST_TYPE =
            TvInputManager.BROADCAST_INFO_TYPE_COMMAND;

    public static final @NonNull Parcelable.Creator<CommandRequest> CREATOR =
@@ -43,37 +45,55 @@ public final class CommandRequest extends BroadcastInfoRequest implements Parcel
    private final String mName;
    private final String mArguments;

    public static CommandRequest createFromParcelBody(Parcel in) {
    static CommandRequest createFromParcelBody(Parcel in) {
        return new CommandRequest(in);
    }

    public CommandRequest(int requestId, @RequestOption int option, String nameSpace,
            String name, String arguments) {
        super(requestType, requestId, option);
    public CommandRequest(int requestId, @RequestOption int option, @NonNull String nameSpace,
            @NonNull String name, @NonNull String arguments) {
        super(REQUEST_TYPE, requestId, option);
        mNameSpace = nameSpace;
        mName = name;
        mArguments = arguments;
    }

    protected CommandRequest(Parcel source) {
        super(requestType, source);
    CommandRequest(Parcel source) {
        super(REQUEST_TYPE, source);
        mNameSpace = source.readString();
        mName = source.readString();
        mArguments = source.readString();
    }

    /**
     * Gets the namespace of the command.
     */
    @NonNull
    public String getNameSpace() {
        return mNameSpace;
    }

    /**
     * Gets the name of the command.
     */
    @NonNull
    public String getName() {
        return mName;
    }

    /**
     * Gets the arguments of the command.
     * It could be serialized from some formats, such as JSON, XML, etc.
     */
    @NonNull
    public String getArguments() {
        return mArguments;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(@NonNull Parcel dest, int flags) {
        super.writeToParcel(dest, flags);
+20 −7
Original line number Diff line number Diff line
@@ -17,12 +17,15 @@
package android.media.tv;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.os.Parcel;
import android.os.Parcelable;

/** @hide */
/**
 * A response for command from broadcast signal.
 */
public final class CommandResponse extends BroadcastInfoResponse implements Parcelable {
    public static final @TvInputManager.BroadcastInfoType int responseType =
    private static final @TvInputManager.BroadcastInfoType int RESPONSE_TYPE =
            TvInputManager.BROADCAST_INFO_TYPE_COMMAND;

    public static final @NonNull Parcelable.Creator<CommandResponse> CREATOR =
@@ -41,25 +44,35 @@ public final class CommandResponse extends BroadcastInfoResponse implements Parc

    private final String mResponse;

    public static CommandResponse createFromParcelBody(Parcel in) {
    static CommandResponse createFromParcelBody(Parcel in) {
        return new CommandResponse(in);
    }

    public CommandResponse(int requestId, int sequence,
            @ResponseResult int responseResult, String response) {
        super(responseType, requestId, sequence, responseResult);
            @ResponseResult int responseResult, @Nullable String response) {
        super(RESPONSE_TYPE, requestId, sequence, responseResult);
        mResponse = response;
    }

    protected CommandResponse(Parcel source) {
        super(responseType, source);
    CommandResponse(Parcel source) {
        super(RESPONSE_TYPE, source);
        mResponse = source.readString();
    }

    /**
     * Gets the response of the command.
     * It could be serialized from some formats, such as JSON, XML, etc.
     */
    @Nullable
    public String getResponse() {
        return mResponse;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(@NonNull Parcel dest, int flags) {
        super.writeToParcel(dest, flags);
Loading