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

Commit 0f18453c authored by Yixiao Luo's avatar Yixiao Luo
Browse files

TIAF: Change on API Review: First round API council questions

Bug: 217555265
Test: atest android.media.tv.interactive.cts.TvInteractiveAppServiceTest
Change-Id: I84ae13de14fd4336b958dd2e35179cd560317006
parent 3e2a850f
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -25169,17 +25169,23 @@ package android.media.tv {
  }
  public final class CommandRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable {
    ctor public CommandRequest(int, int, @NonNull String, @NonNull String, @NonNull String);
    ctor public CommandRequest(int, int, @NonNull String, @NonNull String, @NonNull String, @NonNull String);
    method @NonNull public String getArgumentType();
    method @NonNull public String getArguments();
    method @NonNull public String getName();
    method @NonNull public String getNameSpace();
    method @NonNull public String getNamespace();
    field public static final String ARGUMENT_TYPE_JSON = "json";
    field public static final String ARGUMENT_TYPE_XML = "xml";
    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);
    ctor public CommandResponse(int, int, int, @Nullable String, @NonNull String);
    method @Nullable public String getResponse();
    method @NonNull public String getResponseType();
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.CommandResponse> CREATOR;
    field public static final String RESPONSE_TYPE_JSON = "json";
    field public static final String RESPONSE_TYPE_XML = "xml";
  }
  public final class DsmccRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable {
@@ -25244,7 +25250,7 @@ package android.media.tv {
    ctor public StreamEventResponse(int, int, int, int, long, @Nullable byte[]);
    method @Nullable public byte[] getData();
    method public int getEventId();
    method public long getNpt();
    method public long getNptMillis();
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.StreamEventResponse> CREATOR;
  }
@@ -25274,7 +25280,7 @@ package android.media.tv {
  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 @Nullable public android.net.Uri getSelector();
    method public long getTicks();
    method public int getUnitsPerSecond();
    method public int getUnitsPerTick();
+23 −8
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ import android.os.Parcelable;
 * A request for command from broadcast signal.
 */
public final class CommandRequest extends BroadcastInfoRequest implements Parcelable {
    public static final String ARGUMENT_TYPE_XML = "xml";
    public static final String ARGUMENT_TYPE_JSON = "json";
    private static final @TvInputManager.BroadcastInfoType int REQUEST_TYPE =
            TvInputManager.BROADCAST_INFO_TYPE_COMMAND;

@@ -41,35 +43,38 @@ public final class CommandRequest extends BroadcastInfoRequest implements Parcel
                }
            };

    private final String mNameSpace;
    private final String mNamespace;
    private final String mName;
    private final String mArguments;
    private final String mArgumentType;

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

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

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

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

    /**
@@ -89,6 +94,15 @@ public final class CommandRequest extends BroadcastInfoRequest implements Parcel
        return mArguments;
    }

    /**
     * Gets the argument type of the command.
     * It could be either JSON or XML.
     */
    @NonNull
    public String getArgumentType() {
        return mArgumentType;
    }

    @Override
    public int describeContents() {
        return 0;
@@ -97,8 +111,9 @@ public final class CommandRequest extends BroadcastInfoRequest implements Parcel
    @Override
    public void writeToParcel(@NonNull Parcel dest, int flags) {
        super.writeToParcel(dest, flags);
        dest.writeString(mNameSpace);
        dest.writeString(mNamespace);
        dest.writeString(mName);
        dest.writeString(mArguments);
        dest.writeString(mArgumentType);
    }
}
+17 −2
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@ import android.os.Parcelable;
 * A response for command from broadcast signal.
 */
public final class CommandResponse extends BroadcastInfoResponse implements Parcelable {
    public static final String RESPONSE_TYPE_XML = "xml";
    public static final String RESPONSE_TYPE_JSON = "json";
    private static final @TvInputManager.BroadcastInfoType int RESPONSE_TYPE =
            TvInputManager.BROADCAST_INFO_TYPE_COMMAND;

@@ -43,20 +45,23 @@ public final class CommandResponse extends BroadcastInfoResponse implements Parc
            };

    private final String mResponse;
    private final String mResponseType;

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

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

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

    /**
@@ -68,6 +73,15 @@ public final class CommandResponse extends BroadcastInfoResponse implements Parc
        return mResponse;
    }

    /**
     * Gets the type of the command response.
     * It could be either JSON or XML.
     */
    @NonNull
    public String getResponseType() {
        return mResponseType;
    }

    @Override
    public int describeContents() {
        return 0;
@@ -77,5 +91,6 @@ public final class CommandResponse extends BroadcastInfoResponse implements Parc
    public void writeToParcel(@NonNull Parcel dest, int flags) {
        super.writeToParcel(dest, flags);
        dest.writeString(mResponse);
        dest.writeString(mResponseType);
    }
}
+5 −0
Original line number Diff line number Diff line
@@ -80,6 +80,11 @@ public final class SectionRequest extends BroadcastInfoRequest implements Parcel

    /**
     * Gets the version number of requested session. If it is null, value will be -1.
     * <p>The consistency of version numbers between request and response depends on
     * {@link BroadcastInfoRequest.RequestOption}. If the request has RequestOption value
     * REQUEST_OPTION_AUTO_UPDATE, then the response may be set to the latest version which may be
     * different from the version of the request. Otherwise, response with a different version from
     * its request will be considered invalid.
     */
    public int getVersion() {
        return mVersion;
+8 −2
Original line number Diff line number Diff line
@@ -74,14 +74,20 @@ public final class SectionResponse extends BroadcastInfoResponse implements Parc
    }

    /**
     * Gets the Version number of requested session.
     * Gets the Version number of requested session. If it is null, value will be -1.
     * <p>The consistency of version numbers between request and response depends on
     * {@link BroadcastInfoRequest.RequestOption}. If the request has RequestOption value
     * REQUEST_OPTION_AUTO_UPDATE, then the response may be set to the latest version which may be
     * different from the version of the request. Otherwise, response with a different version from
     * its request will be considered invalid.
     */
    public int getVersion() {
        return mVersion;
    }

    /**
     * Gets the raw data of session.
     * Gets the raw data of session. The sessionData field represents payload data of the session
     * after session header, which includes version and sessionId.
     */
    @NonNull
    public Bundle getSessionData() {
Loading