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

Commit 86eabbb3 authored by shubang's avatar shubang
Browse files

TIAF: cleanup APIs of setup session use case

Sequence diagram of the use case:
https://screenshot.googleplex.com/4qAsMgdCD6itwWj.png

Bug: 208651889
Test: mmm
Change-Id: Idcf30b15f6321181117e7c1ef83eed2870140c0b
parent 07ab2f52
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -17,11 +17,12 @@
package android.media.tv;

import android.annotation.NonNull;
import android.media.tv.interactive.TvInteractiveAppInfo;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * AIT info.
 * AIT (Application Information Table) info.
 * @hide
 */
public final class AitInfo implements Parcelable {
@@ -50,14 +51,15 @@ public final class AitInfo implements Parcelable {
    /**
     * Constructs AIT info.
     */
    public AitInfo(int type, int version) {
    public AitInfo(@TvInteractiveAppInfo.InteractiveAppType int type, int version) {
        mType = type;
        mVersion = version;
    }

    /**
     * Gets type.
     * Gets interactive app type.
     */
    @TvInteractiveAppInfo.InteractiveAppType
    public int getType() {
        return mType;
    }
+1 −1
Original line number Diff line number Diff line
@@ -2593,9 +2593,9 @@ public final class TvInputManager {

        /**
         * Enables interactive app notification.
         *
         * @param enabled {@code true} if you want to enable interactive app notifications.
         *                {@code false} otherwise.
         * @hide
         */
        public void setInteractiveAppNotificationEnabled(boolean enabled) {
            if (mToken == null) {
+16 −1
Original line number Diff line number Diff line
@@ -945,7 +945,13 @@ public abstract class TvInputService extends Service {
        }

        /**
         * Notifies AIT info updated.
         * Informs the app that the AIT (Application Information Table) is updated.
         *
         * <p>This method should also be call when
         * {@link #onSetInteractiveAppNotificationEnabled(boolean)} is called to send the first AIT
         * info.
         *
         * @see #onSetInteractiveAppNotificationEnabled(boolean)
         * @hide
         */
        public void notifyAitInfoUpdated(@NonNull final AitInfo aitInfo) {
@@ -1198,7 +1204,16 @@ public abstract class TvInputService extends Service {

        /**
         * Enables or disables interactive app notification.
         *
         * <p>This method enables or disables the event detection from the corresponding TV input.
         * When it's enabled, the TV input service detects events related to interactive app, such
         * as AIT (Application Information Table) and sends to TvView or the linked TV interactive
         * app service.
         *
         * @param enabled {@code true} to enable, {@code false} to disable.
         *
         * @see TvView#setInteractiveAppNotificationEnabled(boolean)
         * @see Session#notifyAitInfoUpdated(android.media.tv.AitInfo)
         * @hide
         */
        public void onSetInteractiveAppNotificationEnabled(boolean enabled) {
+12 −3
Original line number Diff line number Diff line
@@ -481,9 +481,18 @@ public class TvView extends ViewGroup {
    }

    /**
     * Enables interactive app notification.
     * Enables or disables interactive app notification.
     *
     * <p>This method enables or disables the event detection from the corresponding TV input. When
     * it's enabled, the TV input service detects events related to interactive app, such as
     * AIT (Application Information Table) and sends to TvView or the linked TV interactive app
     * service.
     *
     * @param enabled {@code true} if you want to enable interactive app notifications.
     *                {@code false} otherwise.
     *
     * @see TvInputService.Session#notifyAitInfoUpdated(android.media.tv.AitInfo)
     * @see android.media.tv.interactive.TvInteractiveAppView#setTvView(TvView)
     * @hide
     */
    public void setInteractiveAppNotificationEnabled(boolean enabled) {
@@ -1062,12 +1071,12 @@ public class TvView extends ViewGroup {
        }

        /**
         * This is called when the AIT info has been updated.
         * This is called when the AIT (Application Information Table) info has been updated.
         *
         * @param aitInfo The current AIT info.
         * @hide
         */
        public void onAitInfoUpdated(String inputId, AitInfo aitInfo) {
        public void onAitInfoUpdated(@NonNull String inputId, @NonNull AitInfo aitInfo) {
        }

        /**
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ oneway interface ITvInteractiveAppClient {
    void onLayoutSurface(int left, int top, int right, int bottom, int seq);
    void onBroadcastInfoRequest(in BroadcastInfoRequest request, int seq);
    void onRemoveBroadcastInfo(int id, int seq);
    void onSessionStateChanged(int state, int seq);
    void onSessionStateChanged(int state, int err, int seq);
    void onBiInteractiveAppCreated(in Uri biIAppUri, in String biIAppId, int seq);
    void onTeletextAppStateChanged(int state, int seq);
    void onCommandRequest(in String cmdType, in Bundle parameters, int seq);
Loading