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

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

Merge "TIAF: unhide APIs of setup session use case"

parents 0f78ba1e 18359310
Loading
Loading
Loading
Loading
+56 −0
Original line number Diff line number Diff line
@@ -26177,6 +26177,15 @@ package android.media.session {
package android.media.tv {
  public final class AitInfo implements android.os.Parcelable {
    ctor public AitInfo(int, int);
    method public int describeContents();
    method public int getType();
    method public int getVersion();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.AitInfo> 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...);
@@ -26747,6 +26756,7 @@ package android.media.tv {
  public abstract static class TvInputService.Session implements android.view.KeyEvent.Callback {
    ctor public TvInputService.Session(android.content.Context);
    method public void layoutSurface(int, int, int, int);
    method public void notifyAitInfoUpdated(@NonNull android.media.tv.AitInfo);
    method public void notifyChannelRetuned(android.net.Uri);
    method public void notifyContentAllowed();
    method public void notifyContentBlocked(@NonNull android.media.tv.TvContentRating);
@@ -26766,6 +26776,7 @@ package android.media.tv {
    method public abstract void onRelease();
    method public boolean onSelectTrack(int, @Nullable String);
    method public abstract void onSetCaptionEnabled(boolean);
    method public void onSetInteractiveAppNotificationEnabled(boolean);
    method public abstract void onSetStreamVolume(@FloatRange(from=0.0, to=1.0) float);
    method public abstract boolean onSetSurface(@Nullable android.view.Surface);
    method public void onSurfaceChanged(int, int, int);
@@ -26867,6 +26878,7 @@ package android.media.tv {
    method public void sendAppPrivateCommand(@NonNull String, android.os.Bundle);
    method public void setCallback(@Nullable android.media.tv.TvView.TvInputCallback);
    method public void setCaptionEnabled(boolean);
    method public void setInteractiveAppNotificationEnabled(boolean);
    method public void setOnUnhandledInputEventListener(android.media.tv.TvView.OnUnhandledInputEventListener);
    method public void setStreamVolume(@FloatRange(from=0.0, to=1.0) float);
    method public void setTimeShiftPositionCallback(@Nullable android.media.tv.TvView.TimeShiftPositionCallback);
@@ -26893,6 +26905,7 @@ package android.media.tv {
  public abstract static class TvView.TvInputCallback {
    ctor public TvView.TvInputCallback();
    method public void onAitInfoUpdated(@NonNull String, @NonNull android.media.tv.AitInfo);
    method public void onChannelRetuned(String, android.net.Uri);
    method public void onConnectionFailed(String);
    method public void onContentAllowed(String);
@@ -26925,26 +26938,69 @@ package android.media.tv.interactive {
  public final class TvInteractiveAppManager {
    method @NonNull public java.util.List<android.media.tv.interactive.TvInteractiveAppInfo> getTvInteractiveAppServiceList();
    method public void registerCallback(@NonNull android.media.tv.interactive.TvInteractiveAppManager.TvInteractiveAppCallback, @NonNull java.util.concurrent.Executor);
    method public void unregisterCallback(@NonNull android.media.tv.interactive.TvInteractiveAppManager.TvInteractiveAppCallback);
    field public static final int ERROR_BLOCKED = 5; // 0x5
    field public static final int ERROR_ENCRYPTED = 6; // 0x6
    field public static final int ERROR_NONE = 0; // 0x0
    field public static final int ERROR_NOT_SUPPORTED = 2; // 0x2
    field public static final int ERROR_RESOURCE_UNAVAILABLE = 4; // 0x4
    field public static final int ERROR_UNKNOWN = 1; // 0x1
    field public static final int ERROR_UNKNOWN_CHANNEL = 7; // 0x7
    field public static final int ERROR_WEAK_SIGNAL = 3; // 0x3
    field public static final int INTERACTIVE_APP_STATE_ERROR = 3; // 0x3
    field public static final int INTERACTIVE_APP_STATE_RUNNING = 2; // 0x2
    field public static final int INTERACTIVE_APP_STATE_STOPPED = 1; // 0x1
    field public static final int SERVICE_STATE_ERROR = 4; // 0x4
    field public static final int SERVICE_STATE_PREPARING = 2; // 0x2
    field public static final int SERVICE_STATE_READY = 3; // 0x3
    field public static final int SERVICE_STATE_UNREALIZED = 1; // 0x1
  }
  public abstract static class TvInteractiveAppManager.TvInteractiveAppCallback {
    ctor public TvInteractiveAppManager.TvInteractiveAppCallback();
    method public void onTvInteractiveAppServiceStateChanged(@NonNull String, int, int, int);
  }
  public abstract class TvInteractiveAppService extends android.app.Service {
    ctor public TvInteractiveAppService();
    method public final void notifyStateChanged(int, int, int);
    method public final android.os.IBinder onBind(android.content.Intent);
    method @Nullable public abstract android.media.tv.interactive.TvInteractiveAppService.Session onCreateSession(@NonNull String, int);
    method public abstract void onPrepare(int);
    field public static final String SERVICE_INTERFACE = "android.media.tv.interactive.TvInteractiveAppService";
    field public static final String SERVICE_META_DATA = "android.media.tv.interactive.app";
  }
  public abstract static class TvInteractiveAppService.Session implements android.view.KeyEvent.Callback {
    ctor public TvInteractiveAppService.Session(@NonNull android.content.Context);
    method public void layoutSurface(int, int, int, int);
    method public void notifySessionStateChanged(int, int);
    method public boolean onKeyDown(int, @NonNull android.view.KeyEvent);
    method public boolean onKeyLongPress(int, @NonNull android.view.KeyEvent);
    method public boolean onKeyMultiple(int, int, @NonNull android.view.KeyEvent);
    method public boolean onKeyUp(int, @NonNull android.view.KeyEvent);
    method public abstract boolean onSetSurface(@Nullable android.view.Surface);
    method public void onStartInteractiveApp();
    method public void onStopInteractiveApp();
    method public void onSurfaceChanged(int, int, int);
  }
  public class TvInteractiveAppView extends android.view.ViewGroup {
    ctor public TvInteractiveAppView(@NonNull android.content.Context);
    ctor public TvInteractiveAppView(@NonNull android.content.Context, @Nullable android.util.AttributeSet);
    ctor public TvInteractiveAppView(@NonNull android.content.Context, @Nullable android.util.AttributeSet, int);
    method public void clearCallback();
    method public void prepareInteractiveApp(@NonNull String, int);
    method public void setCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.tv.interactive.TvInteractiveAppView.TvInteractiveAppCallback);
    method public int setTvView(@Nullable android.media.tv.TvView);
    method public void startInteractiveApp();
    method public void stopInteractiveApp();
  }
  public abstract static class TvInteractiveAppView.TvInteractiveAppCallback {
    ctor public TvInteractiveAppView.TvInteractiveAppCallback();
    method public void onStateChanged(@NonNull String, int, int);
  }
}
+0 −1
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import android.os.Parcelable;

/**
 * AIT (Application Information Table) info.
 * @hide
 */
public final class AitInfo implements Parcelable {
    static final String TAG = "AitInfo";
+1 −3
Original line number Diff line number Diff line
@@ -947,12 +947,11 @@ public abstract class TvInputService extends Service {
        /**
         * Informs the app that the AIT (Application Information Table) is updated.
         *
         * <p>This method should also be call when
         * <p>This method should also be called when
         * {@link #onSetInteractiveAppNotificationEnabled(boolean)} is called to send the first AIT
         * info.
         *
         * @see #onSetInteractiveAppNotificationEnabled(boolean)
         * @hide
         */
        public void notifyAitInfoUpdated(@NonNull final AitInfo aitInfo) {
            executeOrPostRunnableOnMainThread(new Runnable() {
@@ -1214,7 +1213,6 @@ public abstract class TvInputService extends Service {
         *
         * @see TvView#setInteractiveAppNotificationEnabled(boolean)
         * @see Session#notifyAitInfoUpdated(android.media.tv.AitInfo)
         * @hide
         */
        public void onSetInteractiveAppNotificationEnabled(boolean enabled) {
        }
+0 −2
Original line number Diff line number Diff line
@@ -493,7 +493,6 @@ public class TvView extends ViewGroup {
     *
     * @see TvInputService.Session#notifyAitInfoUpdated(android.media.tv.AitInfo)
     * @see android.media.tv.interactive.TvInteractiveAppView#setTvView(TvView)
     * @hide
     */
    public void setInteractiveAppNotificationEnabled(boolean enabled) {
        if (mSession != null) {
@@ -1074,7 +1073,6 @@ public class TvView extends ViewGroup {
         * This is called when the AIT (Application Information Table) info has been updated.
         *
         * @param aitInfo The current AIT info.
         * @hide
         */
        public void onAitInfoUpdated(@NonNull String inputId, @NonNull AitInfo aitInfo) {
        }
+5 −20
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ import java.util.concurrent.Executor;

/**
 * Central system API to the overall TV interactive application framework (TIAF) architecture, which
 * arbitrates interaction between applications and interactive apps.
 * arbitrates interaction between Android applications and TV interactive apps.
 */
@SystemService(Context.TV_INTERACTIVE_APP_SERVICE)
public final class TvInteractiveAppManager {
@@ -75,22 +75,22 @@ public final class TvInteractiveAppManager {

    /**
     * Unrealized state of interactive app service.
     * @hide
     */
    public static final int SERVICE_STATE_UNREALIZED = 1;
    /**
     * Preparing state of interactive app service.
     * @hide
     */
    public static final int SERVICE_STATE_PREPARING = 2;
    /**
     * Ready state of interactive app service.
     * @hide
     *
     * <p>In this state, the interactive app service is ready, and interactive apps can be started.
     *
     * @see TvInteractiveAppView#startInteractiveApp()
     */
    public static final int SERVICE_STATE_READY = 3;
    /**
     * Error state of interactive app service.
     * @hide
     */
    public static final int SERVICE_STATE_ERROR = 4;

@@ -105,17 +105,14 @@ public final class TvInteractiveAppManager {

    /**
     * Stopped (or not started) state of interactive application.
     * @hide
     */
    public static final int INTERACTIVE_APP_STATE_STOPPED = 1;
    /**
     * Running state of interactive application.
     * @hide
     */
    public static final int INTERACTIVE_APP_STATE_RUNNING = 2;
    /**
     * Error state of interactive application.
     * @hide
     */
    public static final int INTERACTIVE_APP_STATE_ERROR = 3;

@@ -136,46 +133,37 @@ public final class TvInteractiveAppManager {

    /**
     * No error.
     * @hide
     */
    public static final int ERROR_NONE = 0;
    /**
     * Unknown error code.
     * @hide
     */
    public static final int ERROR_UNKNOWN = 1;
    /**
     * Error code for an unsupported channel.
     * @hide
     */
    public static final int ERROR_NOT_SUPPORTED = 2;
    /**
     * Error code for weak signal.
     * @hide
     */
    public static final int ERROR_WEAK_SIGNAL = 3;
    /**
     * Error code when resource (e.g. tuner) is unavailable.
     * @hide
     */
    public static final int ERROR_RESOURCE_UNAVAILABLE = 4;
    /**
     * Error code for blocked contents.
     * @hide
     */
    public static final int ERROR_BLOCKED = 5;
    /**
     * Error code when the key or module is missing for the encrypted channel.
     * @hide
     */
    public static final int ERROR_ENCRYPTED = 6;
    /**
     * Error code when the current channel is an unknown channel.
     * @hide
     */
    public static final int ERROR_UNKNOWN_CHANNEL = 7;


    /** @hide */
    @Retention(RetentionPolicy.SOURCE)
    @IntDef(flag = false, prefix = "TELETEXT_APP_STATE_", value = {
@@ -561,7 +549,6 @@ public final class TvInteractiveAppManager {

    /**
     * Callback used to monitor status of the TV Interactive App.
     * @hide
     */
    public abstract static class TvInteractiveAppCallback {
        /**
@@ -796,7 +783,6 @@ public final class TvInteractiveAppManager {
     *
     * @param callback A callback used to monitor status of the TV Interactive App services.
     * @param executor A {@link Executor} that the status change will be delivered to.
     * @hide
     */
    public void registerCallback(
            @NonNull TvInteractiveAppCallback callback,
@@ -812,7 +798,6 @@ public final class TvInteractiveAppManager {
     * Unregisters the existing {@link TvInteractiveAppCallback}.
     *
     * @param callback The existing callback to remove.
     * @hide
     */
    public void unregisterCallback(@NonNull final TvInteractiveAppCallback callback) {
        Preconditions.checkNotNull(callback);
Loading