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

Commit 02b02810 authored by Shubang Lu's avatar Shubang Lu
Browse files

[CSAI API] Unhide keyevent and media view APIs

Bug: 321108085
Test: CtsTvTestCases
API-Coverage-Bug: 320723228
Change-Id: Ia4ddc70e0c250ecfe66c8ee326734761d74fddbc
parent 6941df70
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -27681,12 +27681,15 @@ package android.media.tv.ad {
  public abstract static class TvAdService.Session implements android.view.KeyEvent.Callback {
    ctor public TvAdService.Session(@NonNull android.content.Context);
    method public boolean isMediaViewEnabled();
    method @CallSuper public void layoutSurface(int, int, int, int);
    method @Nullable public android.view.View onCreateMediaView();
    method public boolean onGenericMotionEvent(@NonNull android.view.MotionEvent);
    method public boolean onKeyDown(int, @Nullable android.view.KeyEvent);
    method public boolean onKeyLongPress(int, @Nullable android.view.KeyEvent);
    method public boolean onKeyMultiple(int, int, @Nullable android.view.KeyEvent);
    method public boolean onKeyUp(int, @Nullable android.view.KeyEvent);
    method public void onMediaViewSizeChanged(@Px int, @Px int);
    method public abstract void onRelease();
    method public void onResetAdService();
    method public abstract boolean onSetSurface(@Nullable android.view.Surface);
@@ -27697,6 +27700,7 @@ package android.media.tv.ad {
    method public boolean onTrackballEvent(@NonNull android.view.MotionEvent);
    method public void onTvInputSessionData(@NonNull String, @NonNull android.os.Bundle);
    method public void sendTvAdSessionData(@NonNull String, @NonNull android.os.Bundle);
    method @CallSuper public void setMediaViewEnabled(boolean);
  }
  @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public final class TvAdServiceInfo implements android.os.Parcelable {
@@ -27713,19 +27717,28 @@ package android.media.tv.ad {
    ctor public TvAdView(@NonNull android.content.Context);
    ctor public TvAdView(@NonNull android.content.Context, @Nullable android.util.AttributeSet);
    ctor public TvAdView(@NonNull android.content.Context, @Nullable android.util.AttributeSet, int);
    method public void clearOnUnhandledInputEventListener();
    method public boolean dispatchUnhandledInputEvent(@NonNull android.view.InputEvent);
    method @Nullable public android.media.tv.ad.TvAdView.OnUnhandledInputEventListener getOnUnhandledInputEventListener();
    method public void onAttachedToWindow();
    method public void onDetachedFromWindow();
    method public void onLayout(boolean, int, int, int, int);
    method public void onMeasure(int, int);
    method public boolean onUnhandledInputEvent(@NonNull android.view.InputEvent);
    method public void onVisibilityChanged(@NonNull android.view.View, int);
    method public void prepareAdService(@NonNull String, @NonNull String);
    method public void reset();
    method public void resetAdService();
    method public void setOnUnhandledInputEventListener(@NonNull java.util.concurrent.Executor, @NonNull android.media.tv.ad.TvAdView.OnUnhandledInputEventListener);
    method public boolean setTvView(@Nullable android.media.tv.TvView);
    method public void startAdService();
    method public void stopAdService();
  }
  public static interface TvAdView.OnUnhandledInputEventListener {
    method public boolean onUnhandledInputEvent(@NonNull android.view.InputEvent);
  }
}
package android.media.tv.interactive {
+0 −4
Original line number Diff line number Diff line
@@ -199,7 +199,6 @@ public abstract class TvAdService extends Service {
         *
         * @param enable {@code true} if you want to enable the media view. {@code false}
         *            otherwise.
         * @hide
         */
        @CallSuper
        public void setMediaViewEnabled(final boolean enable) {
@@ -225,7 +224,6 @@ public abstract class TvAdService extends Service {
         * Returns {@code true} if media view is enabled, {@code false} otherwise.
         *
         * @see #setMediaViewEnabled(boolean)
         * @hide
         */
        public boolean isMediaViewEnabled() {
            return mMediaViewEnabled;
@@ -632,7 +630,6 @@ public abstract class TvAdService extends Service {
         *
         * @param width The width of the media view, in pixels.
         * @param height The height of the media view, in pixels.
         * @hide
         */
        public void onMediaViewSizeChanged(@Px int width, @Px int height) {
        }
@@ -642,7 +639,6 @@ public abstract class TvAdService extends Service {
         * implementation can override this method and return its own view.
         *
         * @return a view attached to the media window. {@code null} if no media view is created.
         * @hide
         */
        @Nullable
        public View onCreateMediaView() {
+0 −6
Original line number Diff line number Diff line
@@ -360,7 +360,6 @@ public class TvAdView extends ViewGroup {
     *
     * @param event The input event.
     * @return {@code true} if the event was handled by the view, {@code false} otherwise.
     * @hide
     */
    public boolean dispatchUnhandledInputEvent(@NonNull InputEvent event) {
        if (mOnUnhandledInputEventListener != null) {
@@ -379,7 +378,6 @@ public class TvAdView extends ViewGroup {
     * @param event The input event.
     * @return If you handled the event, return {@code true}. If you want to allow the event to be
     *         handled by the next receiver, return {@code false}.
     * @hide
     */
    public boolean onUnhandledInputEvent(@NonNull InputEvent event) {
        return false;
@@ -390,7 +388,6 @@ public class TvAdView extends ViewGroup {
     * by the TV AD service.
     *
     * @param listener The callback to be invoked when the unhandled input event is received.
     * @hide
     */
    public void setOnUnhandledInputEventListener(
            @NonNull @CallbackExecutor Executor executor,
@@ -405,7 +402,6 @@ public class TvAdView extends ViewGroup {
     *
     * @see #setOnUnhandledInputEventListener(Executor, OnUnhandledInputEventListener)
     * @see #clearOnUnhandledInputEventListener()
     * @hide
     */
    @Nullable
    public OnUnhandledInputEventListener getOnUnhandledInputEventListener() {
@@ -414,7 +410,6 @@ public class TvAdView extends ViewGroup {

    /**
     * Clears the {@link OnUnhandledInputEventListener}.
     * @hide
     */
    public void clearOnUnhandledInputEventListener() {
        mOnUnhandledInputEventListener = null;
@@ -617,7 +612,6 @@ public class TvAdView extends ViewGroup {

    /**
     * Interface definition for a callback to be invoked when the unhandled input event is received.
     * @hide
     */
    public interface OnUnhandledInputEventListener {
        /**