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

Commit d59629e9 authored by Bryce Lee's avatar Bryce Lee
Browse files

Deprecate Activity#requestVisibleBehind

The scenario in which this method was intended for is no longer in
use.

Test: documentation
Bug: 37433505
Change-Id: I9927e9a1c4a8cecc920d78abe406b77969854290
parent 031cf145
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -3723,7 +3723,7 @@ package android.app {
    method public void onTrimMemory(int);
    method public void onTrimMemory(int);
    method public void onUserInteraction();
    method public void onUserInteraction();
    method protected void onUserLeaveHint();
    method protected void onUserLeaveHint();
    method public void onVisibleBehindCanceled();
    method public deprecated void onVisibleBehindCanceled();
    method public void onWindowAttributesChanged(android.view.WindowManager.LayoutParams);
    method public void onWindowAttributesChanged(android.view.WindowManager.LayoutParams);
    method public void onWindowFocusChanged(boolean);
    method public void onWindowFocusChanged(boolean);
    method public android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback);
    method public android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback);
@@ -3740,7 +3740,7 @@ package android.app {
    method public android.view.DragAndDropPermissions requestDragAndDropPermissions(android.view.DragEvent);
    method public android.view.DragAndDropPermissions requestDragAndDropPermissions(android.view.DragEvent);
    method public final void requestPermissions(java.lang.String[], int);
    method public final void requestPermissions(java.lang.String[], int);
    method public final void requestShowKeyboardShortcuts();
    method public final void requestShowKeyboardShortcuts();
    method public boolean requestVisibleBehind(boolean);
    method public deprecated boolean requestVisibleBehind(boolean);
    method public final boolean requestWindowFeature(int);
    method public final boolean requestWindowFeature(int);
    method public final void runOnUiThread(java.lang.Runnable);
    method public final void runOnUiThread(java.lang.Runnable);
    method public void setActionBar(android.widget.Toolbar);
    method public void setActionBar(android.widget.Toolbar);
+4 −4
Original line number Original line Diff line number Diff line
@@ -3756,7 +3756,7 @@ package android.app {
    method public boolean hasWindowFocus();
    method public boolean hasWindowFocus();
    method public void invalidateOptionsMenu();
    method public void invalidateOptionsMenu();
    method public boolean isActivityTransitionRunning();
    method public boolean isActivityTransitionRunning();
    method public boolean isBackgroundVisibleBehind();
    method public deprecated boolean isBackgroundVisibleBehind();
    method public boolean isChangingConfigurations();
    method public boolean isChangingConfigurations();
    method public final boolean isChild();
    method public final boolean isChild();
    method public boolean isDestroyed();
    method public boolean isDestroyed();
@@ -3780,7 +3780,7 @@ package android.app {
    method public void onAttachFragment(android.app.Fragment);
    method public void onAttachFragment(android.app.Fragment);
    method public void onAttachedToWindow();
    method public void onAttachedToWindow();
    method public void onBackPressed();
    method public void onBackPressed();
    method public void onBackgroundVisibleBehindChanged(boolean);
    method public deprecated void onBackgroundVisibleBehindChanged(boolean);
    method protected void onChildTitleChanged(android.app.Activity, java.lang.CharSequence);
    method protected void onChildTitleChanged(android.app.Activity, java.lang.CharSequence);
    method public void onConfigurationChanged(android.content.res.Configuration);
    method public void onConfigurationChanged(android.content.res.Configuration);
    method public void onContentChanged();
    method public void onContentChanged();
@@ -3855,7 +3855,7 @@ package android.app {
    method public void onTrimMemory(int);
    method public void onTrimMemory(int);
    method public void onUserInteraction();
    method public void onUserInteraction();
    method protected void onUserLeaveHint();
    method protected void onUserLeaveHint();
    method public void onVisibleBehindCanceled();
    method public deprecated void onVisibleBehindCanceled();
    method public void onWindowAttributesChanged(android.view.WindowManager.LayoutParams);
    method public void onWindowAttributesChanged(android.view.WindowManager.LayoutParams);
    method public void onWindowFocusChanged(boolean);
    method public void onWindowFocusChanged(boolean);
    method public android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback);
    method public android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback);
@@ -3872,7 +3872,7 @@ package android.app {
    method public android.view.DragAndDropPermissions requestDragAndDropPermissions(android.view.DragEvent);
    method public android.view.DragAndDropPermissions requestDragAndDropPermissions(android.view.DragEvent);
    method public final void requestPermissions(java.lang.String[], int);
    method public final void requestPermissions(java.lang.String[], int);
    method public final void requestShowKeyboardShortcuts();
    method public final void requestShowKeyboardShortcuts();
    method public boolean requestVisibleBehind(boolean);
    method public deprecated boolean requestVisibleBehind(boolean);
    method public final boolean requestWindowFeature(int);
    method public final boolean requestWindowFeature(int);
    method public final void runOnUiThread(java.lang.Runnable);
    method public final void runOnUiThread(java.lang.Runnable);
    method public void setActionBar(android.widget.Toolbar);
    method public void setActionBar(android.widget.Toolbar);
+2 −2
Original line number Original line Diff line number Diff line
@@ -3725,7 +3725,7 @@ package android.app {
    method public void onTrimMemory(int);
    method public void onTrimMemory(int);
    method public void onUserInteraction();
    method public void onUserInteraction();
    method protected void onUserLeaveHint();
    method protected void onUserLeaveHint();
    method public void onVisibleBehindCanceled();
    method public deprecated void onVisibleBehindCanceled();
    method public void onWindowAttributesChanged(android.view.WindowManager.LayoutParams);
    method public void onWindowAttributesChanged(android.view.WindowManager.LayoutParams);
    method public void onWindowFocusChanged(boolean);
    method public void onWindowFocusChanged(boolean);
    method public android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback);
    method public android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback);
@@ -3742,7 +3742,7 @@ package android.app {
    method public android.view.DragAndDropPermissions requestDragAndDropPermissions(android.view.DragEvent);
    method public android.view.DragAndDropPermissions requestDragAndDropPermissions(android.view.DragEvent);
    method public final void requestPermissions(java.lang.String[], int);
    method public final void requestPermissions(java.lang.String[], int);
    method public final void requestShowKeyboardShortcuts();
    method public final void requestShowKeyboardShortcuts();
    method public boolean requestVisibleBehind(boolean);
    method public deprecated boolean requestVisibleBehind(boolean);
    method public final boolean requestWindowFeature(int);
    method public final boolean requestWindowFeature(int);
    method public final void runOnUiThread(java.lang.Runnable);
    method public final void runOnUiThread(java.lang.Runnable);
    method public void setActionBar(android.widget.Toolbar);
    method public void setActionBar(android.widget.Toolbar);
+18 −0
Original line number Original line Diff line number Diff line
@@ -803,6 +803,7 @@ public class Activity extends ContextThemeWrapper
    final FragmentController mFragments = FragmentController.createController(new HostCallbacks());
    final FragmentController mFragments = FragmentController.createController(new HostCallbacks());


    // Most recent call to requestVisibleBehind().
    // Most recent call to requestVisibleBehind().
    @Deprecated
    boolean mVisibleBehind;
    boolean mVisibleBehind;


    private static final class ManagedCursor {
    private static final class ManagedCursor {
@@ -6384,9 +6385,13 @@ public class Activity extends ContextThemeWrapper
     * <p>False will be returned any time this method is called between the return of onPause and
     * <p>False will be returned any time this method is called between the return of onPause and
     *      the next call to onResume.
     *      the next call to onResume.
     *
     *
     * @deprecated This method's functionality is no longer supported as of
     *             {@link android.os.Build.VERSION_CODES#O} and will be removed in a future release.
     *
     * @param visible true to notify the system that the activity wishes to be visible behind other
     * @param visible true to notify the system that the activity wishes to be visible behind other
     *                translucent activities, false to indicate otherwise. Resources must be
     *                translucent activities, false to indicate otherwise. Resources must be
     *                released when passing false to this method.
     *                released when passing false to this method.
     *
     * @return the resulting visibiity state. If true the activity will remain visible beyond
     * @return the resulting visibiity state. If true the activity will remain visible beyond
     *      {@link #onPause()} if the next activity is translucent or not fullscreen. If false
     *      {@link #onPause()} if the next activity is translucent or not fullscreen. If false
     *      then the activity may not count on being visible behind other translucent activities,
     *      then the activity may not count on being visible behind other translucent activities,
@@ -6396,6 +6401,7 @@ public class Activity extends ContextThemeWrapper
     *
     *
     * @see #onVisibleBehindCanceled()
     * @see #onVisibleBehindCanceled()
     */
     */
    @Deprecated
    public boolean requestVisibleBehind(boolean visible) {
    public boolean requestVisibleBehind(boolean visible) {
        if (!mResumed) {
        if (!mResumed) {
            // Do not permit paused or stopped activities to do this.
            // Do not permit paused or stopped activities to do this.
@@ -6422,7 +6428,11 @@ public class Activity extends ContextThemeWrapper
     * process. Otherwise {@link #onStop()} will be called following return.
     * process. Otherwise {@link #onStop()} will be called following return.
     *
     *
     * @see #requestVisibleBehind(boolean)
     * @see #requestVisibleBehind(boolean)
     *
     * @deprecated This method's functionality is no longer supported as of
     * {@link android.os.Build.VERSION_CODES#O} and will be removed in a future release.
     */
     */
    @Deprecated
    @CallSuper
    @CallSuper
    public void onVisibleBehindCanceled() {
    public void onVisibleBehindCanceled() {
        mCalled = true;
        mCalled = true;
@@ -6432,6 +6442,9 @@ public class Activity extends ContextThemeWrapper
     * Translucent activities may call this to determine if there is an activity below them that
     * Translucent activities may call this to determine if there is an activity below them that
     * is currently set to be visible in the background.
     * is currently set to be visible in the background.
     *
     *
     * @deprecated This method's functionality is no longer supported as of
     * {@link android.os.Build.VERSION_CODES#O} and will be removed in a future release.
     *
     * @return true if an activity below is set to visible according to the most recent call to
     * @return true if an activity below is set to visible according to the most recent call to
     * {@link #requestVisibleBehind(boolean)}, false otherwise.
     * {@link #requestVisibleBehind(boolean)}, false otherwise.
     *
     *
@@ -6440,6 +6453,7 @@ public class Activity extends ContextThemeWrapper
     * @see #onBackgroundVisibleBehindChanged(boolean)
     * @see #onBackgroundVisibleBehindChanged(boolean)
     * @hide
     * @hide
     */
     */
    @Deprecated
    @SystemApi
    @SystemApi
    public boolean isBackgroundVisibleBehind() {
    public boolean isBackgroundVisibleBehind() {
        try {
        try {
@@ -6456,12 +6470,16 @@ public class Activity extends ContextThemeWrapper
     * This call may be a consequence of {@link #requestVisibleBehind(boolean)} or might be
     * This call may be a consequence of {@link #requestVisibleBehind(boolean)} or might be
     * due to a background activity finishing itself.
     * due to a background activity finishing itself.
     *
     *
     * @deprecated This method's functionality is no longer supported as of
     * {@link android.os.Build.VERSION_CODES#O} and will be removed in a future release.
     *
     * @param visible true if a background activity is visible, false otherwise.
     * @param visible true if a background activity is visible, false otherwise.
     *
     *
     * @see #requestVisibleBehind(boolean)
     * @see #requestVisibleBehind(boolean)
     * @see #onVisibleBehindCanceled()
     * @see #onVisibleBehindCanceled()
     * @hide
     * @hide
     */
     */
    @Deprecated
    @SystemApi
    @SystemApi
    public void onBackgroundVisibleBehindChanged(boolean visible) {
    public void onBackgroundVisibleBehindChanged(boolean visible) {
    }
    }
+4 −0
Original line number Original line Diff line number Diff line
@@ -852,7 +852,11 @@ public class ActivityManager {
        /**
        /**
         * Returns true if activities contained in this stack can request visible behind by
         * Returns true if activities contained in this stack can request visible behind by
         * calling {@link Activity#requestVisibleBehind}.
         * calling {@link Activity#requestVisibleBehind}.
         *
         * @deprecated This method's functionality is no longer supported as of
         * {@link android.os.Build.VERSION_CODES#O} and will be removed in a future release.
         */
         */
        @Deprecated
        public static boolean activitiesCanRequestVisibleBehind(int stackId) {
        public static boolean activitiesCanRequestVisibleBehind(int stackId) {
            return stackId == FULLSCREEN_WORKSPACE_STACK_ID ||
            return stackId == FULLSCREEN_WORKSPACE_STACK_ID ||
                    stackId == ASSISTANT_STACK_ID;
                    stackId == ASSISTANT_STACK_ID;