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

Commit d6ee3e2d authored by Galia Peycheva's avatar Galia Peycheva
Browse files

Add API to prefer docking big overlays

Bug: 216749913
Bug: 203647003
Test: atest PinnedStackTests#testPreferDockBigOverlaysWithExpandedPip
Change-Id: I6add690d54b8fb1061a1b5c9e5fe2f856f8019d0
parent e0b7d646
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -4274,6 +4274,7 @@ package android.app {
    method public void setLocusContext(@Nullable android.content.LocusId, @Nullable android.os.Bundle);
    method public void setLocusContext(@Nullable android.content.LocusId, @Nullable android.os.Bundle);
    method public final void setMediaController(android.media.session.MediaController);
    method public final void setMediaController(android.media.session.MediaController);
    method public void setPictureInPictureParams(@NonNull android.app.PictureInPictureParams);
    method public void setPictureInPictureParams(@NonNull android.app.PictureInPictureParams);
    method public void setPreferDockBigOverlays(boolean);
    method @Deprecated public final void setProgress(int);
    method @Deprecated public final void setProgress(int);
    method @Deprecated public final void setProgressBarIndeterminate(boolean);
    method @Deprecated public final void setProgressBarIndeterminate(boolean);
    method @Deprecated public final void setProgressBarIndeterminateVisibility(boolean);
    method @Deprecated public final void setProgressBarIndeterminateVisibility(boolean);
+1 −0
Original line number Original line Diff line number Diff line
@@ -411,6 +411,7 @@ package android.app {
    method @NonNull public android.content.res.Configuration getConfiguration();
    method @NonNull public android.content.res.Configuration getConfiguration();
    method public int getParentTaskId();
    method public int getParentTaskId();
    method @Nullable public android.app.PictureInPictureParams getPictureInPictureParams();
    method @Nullable public android.app.PictureInPictureParams getPictureInPictureParams();
    method public boolean getPreferDockBigOverlays();
    method @NonNull public android.window.WindowContainerToken getToken();
    method @NonNull public android.window.WindowContainerToken getToken();
    method public boolean hasParentTask();
    method public boolean hasParentTask();
  }
  }
+21 −0
Original line number Original line Diff line number Diff line
@@ -2955,6 +2955,27 @@ public class Activity extends ContextThemeWrapper
        return false;
        return false;
    }
    }


    /**
     * Specifies a preference to dock big overlays like the expanded picture-in-picture on TV
     * (see {@link PictureInPictureParams.Builder#setExpandedAspectRatio}). Docking puts the
     * big overlay side-by-side next to this activity, so that both windows are fully visible to
     * the user.
     *
     * <p> If unspecified, whether the overlay window will be docked or not, will be defined
     * by the system.
     *
     * <p> If specified, the system will try to respect the preference, but it may be
     * overridden by a user preference.
     *
     * @param preferDockBigOverlays indicates that the activity prefers big overlays to be
     *                              docked next to it instead of overlaying its content
     *
     * @see PictureInPictureParams.Builder#setExpandedAspectRatio
     */
    public void setPreferDockBigOverlays(boolean preferDockBigOverlays) {
        ActivityClient.getInstance().setPreferDockBigOverlays(mToken, preferDockBigOverlays);
    }

    void dispatchMovedToDisplay(int displayId, Configuration config) {
    void dispatchMovedToDisplay(int displayId, Configuration config) {
        updateDisplay(displayId);
        updateDisplay(displayId);
        onMovedToDisplay(displayId, config);
        onMovedToDisplay(displayId, config);
+8 −0
Original line number Original line Diff line number Diff line
@@ -324,6 +324,14 @@ public class ActivityClient {
        }
        }
    }
    }


    void setPreferDockBigOverlays(IBinder token, boolean preferDockBigOverlays) {
        try {
            getActivityClientController().setPreferDockBigOverlays(token, preferDockBigOverlays);
        } catch (RemoteException e) {
            e.rethrowFromSystemServer();
        }
    }

    void toggleFreeformWindowingMode(IBinder token) {
    void toggleFreeformWindowingMode(IBinder token) {
        try {
        try {
            getActivityClientController().toggleFreeformWindowingMode(token);
            getActivityClientController().toggleFreeformWindowingMode(token);
+1 −0
Original line number Original line Diff line number Diff line
@@ -88,6 +88,7 @@ interface IActivityClientController {


    boolean enterPictureInPictureMode(in IBinder token, in PictureInPictureParams params);
    boolean enterPictureInPictureMode(in IBinder token, in PictureInPictureParams params);
    void setPictureInPictureParams(in IBinder token, in PictureInPictureParams params);
    void setPictureInPictureParams(in IBinder token, in PictureInPictureParams params);
    oneway void setPreferDockBigOverlays(in IBinder token, in boolean preferDockBigOverlays);
    void toggleFreeformWindowingMode(in IBinder token);
    void toggleFreeformWindowingMode(in IBinder token);


    oneway void startLockTaskModeByToken(in IBinder token);
    oneway void startLockTaskModeByToken(in IBinder token);
Loading