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

Commit bee3ff15 authored by Galia Peycheva's avatar Galia Peycheva Committed by Android (Google) Code Review
Browse files

Merge "Add API to prefer docking big overlays"

parents 8a5e698a d6ee3e2d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4275,6 +4275,7 @@ package android.app {
    method public void setLocusContext(@Nullable android.content.LocusId, @Nullable android.os.Bundle);
    method public final void setMediaController(android.media.session.MediaController);
    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 setProgressBarIndeterminate(boolean);
    method @Deprecated public final void setProgressBarIndeterminateVisibility(boolean);
+1 −0
Original line number Diff line number Diff line
@@ -418,6 +418,7 @@ package android.app {
    method @NonNull public android.content.res.Configuration getConfiguration();
    method public int getParentTaskId();
    method @Nullable public android.app.PictureInPictureParams getPictureInPictureParams();
    method public boolean getPreferDockBigOverlays();
    method @NonNull public android.window.WindowContainerToken getToken();
    method public boolean hasParentTask();
  }
+21 −0
Original line number Diff line number Diff line
@@ -2965,6 +2965,27 @@ public class Activity extends ContextThemeWrapper
        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) {
        updateDisplay(displayId);
        onMovedToDisplay(displayId, config);
+8 −0
Original line number 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) {
        try {
            getActivityClientController().toggleFreeformWindowingMode(token);
+1 −0
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ interface IActivityClientController {

    boolean enterPictureInPictureMode(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);

    oneway void startLockTaskModeByToken(in IBinder token);
Loading