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

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

Add shouldDockBigOverlays API

This CLs provides the getter API for DockBigOverlays. To better follow
API guidelines, it changes the naming from "*preferDockBigOverlays" to
"*shouldDockBigOverlays"

Bug: 220739302
Test: atest PinnedStackTests#testShouldDockBigOverlaysWithExpandedPip
Change-Id: I25c18531bc1f386b208ab7dde81a8b11a22d03a1
parent f5ff7aa9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -4275,7 +4275,6 @@ 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);
@@ -4285,6 +4284,7 @@ package android.app {
    method public final void setResult(int);
    method public final void setResult(int, android.content.Intent);
    method @Deprecated public final void setSecondaryProgress(int);
    method public void setShouldDockBigOverlays(boolean);
    method public void setShowWhenLocked(boolean);
    method public void setTaskDescription(android.app.ActivityManager.TaskDescription);
    method public void setTitle(CharSequence);
@@ -4295,6 +4295,7 @@ package android.app {
    method public void setVisible(boolean);
    method public final void setVolumeControlStream(int);
    method public void setVrModeEnabled(boolean, @NonNull android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException;
    method public boolean shouldDockBigOverlays();
    method public boolean shouldShowRequestPermissionRationale(@NonNull String);
    method public boolean shouldUpRecreateTask(android.content.Intent);
    method public boolean showAssist(android.os.Bundle);
+1 −1
Original line number Diff line number Diff line
@@ -422,9 +422,9 @@ 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();
    method public boolean shouldDockBigOverlays();
  }

  public class TimePickerDialog extends android.app.AlertDialog implements android.content.DialogInterface.OnClickListener android.widget.TimePicker.OnTimeChangedListener {
+22 −4
Original line number Diff line number Diff line
@@ -984,6 +984,8 @@ public class Activity extends ContextThemeWrapper
    private boolean mIsInMultiWindowMode;
    private boolean mIsInPictureInPictureMode;

    private boolean mShouldDockBigOverlays;

    private UiTranslationController mUiTranslationController;

    private SplashScreen mSplashScreen;
@@ -2977,13 +2979,28 @@ public class Activity extends ContextThemeWrapper
     * <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
     * @param shouldDockBigOverlays indicates that big overlays should be docked next to the
     *                              activity instead of overlay its content
     *
     * @see PictureInPictureParams.Builder#setExpandedAspectRatio
     * @see #shouldDockBigOverlays
     */
    public void setShouldDockBigOverlays(boolean shouldDockBigOverlays) {
        ActivityClient.getInstance().setShouldDockBigOverlays(mToken, shouldDockBigOverlays);
        mShouldDockBigOverlays = shouldDockBigOverlays;
    }

    /**
     * Returns whether big overlays should be docked next to the activity as set by
     * {@link #setShouldDockBigOverlays}.
     *
     * @return {@code true} if big overlays should be docked next to the activity instead
     *         of overlay its content
     *
     * @see #setShouldDockBigOverlays
     */
    public void setPreferDockBigOverlays(boolean preferDockBigOverlays) {
        ActivityClient.getInstance().setPreferDockBigOverlays(mToken, preferDockBigOverlays);
    public boolean shouldDockBigOverlays() {
        return mShouldDockBigOverlays;
    }

    void dispatchMovedToDisplay(int displayId, Configuration config) {
@@ -8249,6 +8266,7 @@ public class Activity extends ContextThemeWrapper
                .getWindowingMode();
        mIsInMultiWindowMode = inMultiWindowMode(windowingMode);
        mIsInPictureInPictureMode = windowingMode == WINDOWING_MODE_PINNED;
        mShouldDockBigOverlays = getResources().getBoolean(R.bool.config_dockBigOverlayWindows);
        restoreHasCurrentPermissionRequest(icicle);
        if (persistentState != null) {
            onCreate(icicle, persistentState);
+2 −2
Original line number Diff line number Diff line
@@ -324,9 +324,9 @@ public class ActivityClient {
        }
    }

    void setPreferDockBigOverlays(IBinder token, boolean preferDockBigOverlays) {
    void setShouldDockBigOverlays(IBinder token, boolean shouldDockBigOverlays) {
        try {
            getActivityClientController().setPreferDockBigOverlays(token, preferDockBigOverlays);
            getActivityClientController().setShouldDockBigOverlays(token, shouldDockBigOverlays);
        } catch (RemoteException e) {
            e.rethrowFromSystemServer();
        }
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +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);
    oneway void setShouldDockBigOverlays(in IBinder token, in boolean shouldDockBigOverlays);
    void toggleFreeformWindowingMode(in IBinder token);

    oneway void startLockTaskModeByToken(in IBinder token);
Loading