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

Commit 6c1e46dd authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add APIs for Z-order in TV views" into main

parents df224cac 4691ed38
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -28561,6 +28561,8 @@ package android.media.tv.ad {
    method public void setCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.tv.ad.TvAdView.TvAdCallback);
    method public void setOnUnhandledInputEventListener(@NonNull android.media.tv.ad.TvAdView.OnUnhandledInputEventListener);
    method public boolean setTvView(@Nullable android.media.tv.TvView);
    method @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public void setZOrderMediaOverlay(boolean);
    method @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public void setZOrderOnTop(boolean);
    method public void startAdService();
    method public void stopAdService();
    field public static final String ERROR_KEY_ERROR_CODE = "error_code";
@@ -28833,6 +28835,8 @@ package android.media.tv.interactive {
    method public void setOnUnhandledInputEventListener(@NonNull java.util.concurrent.Executor, @NonNull android.media.tv.interactive.TvInteractiveAppView.OnUnhandledInputEventListener);
    method public void setTeletextAppEnabled(boolean);
    method public int setTvView(@Nullable android.media.tv.TvView);
    method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void setZOrderMediaOverlay(boolean);
    method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void setZOrderOnTop(boolean);
    method public void startInteractiveApp();
    method public void stopInteractiveApp();
    field public static final String BI_INTERACTIVE_APP_KEY_ALIAS = "alias";
+32 −0
Original line number Diff line number Diff line
@@ -240,6 +240,38 @@ public class TvAdView extends ViewGroup {
        }
    }

    /**
     * Controls whether the TvAdView's surface is placed on top of other regular surface views in
     * the window (but still behind the window itself).
     *
     * <p>Calling this overrides any previous call to {@link #setZOrderOnTop}.
     *
     * @param isMediaOverlay {@code true} to be on top of another regular surface, {@code false}
     *            otherwise.
     */
    @FlaggedApi(Flags.FLAG_ENABLE_AD_SERVICE_FW)
    public void setZOrderMediaOverlay(boolean isMediaOverlay) {
        if (mSurfaceView != null) {
            mSurfaceView.setZOrderOnTop(false);
            mSurfaceView.setZOrderMediaOverlay(isMediaOverlay);
        }
    }

    /**
     * Controls whether the TvAdView's surface is placed on top of its window.
     *
     * <p>Calling this overrides any previous call to {@link #setZOrderMediaOverlay}.
     *
     * @param onTop {@code true} to be on top of its window, {@code false} otherwise.
     */
    @FlaggedApi(Flags.FLAG_ENABLE_AD_SERVICE_FW)
    public void setZOrderOnTop(boolean onTop) {
        if (mSurfaceView != null) {
            mSurfaceView.setZOrderMediaOverlay(false);
            mSurfaceView.setZOrderOnTop(onTop);
        }
    }

    private void resetSurfaceView() {
        if (mSurfaceView != null) {
            mSurfaceView.getHolder().removeCallback(mSurfaceHolderCallback);
+32 −0
Original line number Diff line number Diff line
@@ -271,6 +271,38 @@ public class TvInteractiveAppView extends ViewGroup {
        }
    }

    /**
     * Controls whether the TvInteractiveAppView's surface is placed on top of other regular surface
     * views in the window (but still behind the window itself).
     *
     * <p>Calling this overrides any previous call to {@link #setZOrderOnTop}.
     *
     * @param isMediaOverlay {@code true} to be on top of another regular surface, {@code false}
     *            otherwise.
     */
    @FlaggedApi(Flags.FLAG_TIAF_V_APIS)
    public void setZOrderMediaOverlay(boolean isMediaOverlay) {
        if (mSurfaceView != null) {
            mSurfaceView.setZOrderOnTop(false);
            mSurfaceView.setZOrderMediaOverlay(isMediaOverlay);
        }
    }

    /**
     * Controls whether the TvInterActiveAppView's surface is placed on top of its window.
     *
     * <p>Calling this overrides any previous call to {@link #setZOrderMediaOverlay}.
     *
     * @param onTop {@code true} to be on top of its window, {@code false} otherwise.
     */
    @FlaggedApi(Flags.FLAG_TIAF_V_APIS)
    public void setZOrderOnTop(boolean onTop) {
        if (mSurfaceView != null) {
            mSurfaceView.setZOrderMediaOverlay(false);
            mSurfaceView.setZOrderOnTop(onTop);
        }
    }

    private void resetSurfaceView() {
        if (mSurfaceView != null) {
            mSurfaceView.getHolder().removeCallback(mSurfaceHolderCallback);