From d59629e9faa770ad9c5cd1b8a45c9df781ee9741 Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Tue, 18 Apr 2017 14:35:29 -0700 Subject: [PATCH] Deprecate Activity#requestVisibleBehind The scenario in which this method was intended for is no longer in use. Test: documentation Bug: 37433505 Change-Id: I9927e9a1c4a8cecc920d78abe406b77969854290 --- api/current.txt | 4 ++-- api/system-current.txt | 8 ++++---- api/test-current.txt | 4 ++-- core/java/android/app/Activity.java | 18 ++++++++++++++++++ core/java/android/app/ActivityManager.java | 4 ++++ 5 files changed, 30 insertions(+), 8 deletions(-) diff --git a/api/current.txt b/api/current.txt index 5b55fdc4b9666..8111123acc465 100644 --- a/api/current.txt +++ b/api/current.txt @@ -3723,7 +3723,7 @@ package android.app { method public void onTrimMemory(int); method public void onUserInteraction(); method protected void onUserLeaveHint(); - method public void onVisibleBehindCanceled(); + method public deprecated void onVisibleBehindCanceled(); method public void onWindowAttributesChanged(android.view.WindowManager.LayoutParams); method public void onWindowFocusChanged(boolean); 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 final void requestPermissions(java.lang.String[], int); 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 void runOnUiThread(java.lang.Runnable); method public void setActionBar(android.widget.Toolbar); diff --git a/api/system-current.txt b/api/system-current.txt index 23a8cad152daf..71f757db7be65 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -3756,7 +3756,7 @@ package android.app { method public boolean hasWindowFocus(); method public void invalidateOptionsMenu(); method public boolean isActivityTransitionRunning(); - method public boolean isBackgroundVisibleBehind(); + method public deprecated boolean isBackgroundVisibleBehind(); method public boolean isChangingConfigurations(); method public final boolean isChild(); method public boolean isDestroyed(); @@ -3780,7 +3780,7 @@ package android.app { method public void onAttachFragment(android.app.Fragment); method public void onAttachedToWindow(); 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 public void onConfigurationChanged(android.content.res.Configuration); method public void onContentChanged(); @@ -3855,7 +3855,7 @@ package android.app { method public void onTrimMemory(int); method public void onUserInteraction(); method protected void onUserLeaveHint(); - method public void onVisibleBehindCanceled(); + method public deprecated void onVisibleBehindCanceled(); method public void onWindowAttributesChanged(android.view.WindowManager.LayoutParams); method public void onWindowFocusChanged(boolean); 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 final void requestPermissions(java.lang.String[], int); 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 void runOnUiThread(java.lang.Runnable); method public void setActionBar(android.widget.Toolbar); diff --git a/api/test-current.txt b/api/test-current.txt index 3373ab735a364..6c81178d58258 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -3725,7 +3725,7 @@ package android.app { method public void onTrimMemory(int); method public void onUserInteraction(); method protected void onUserLeaveHint(); - method public void onVisibleBehindCanceled(); + method public deprecated void onVisibleBehindCanceled(); method public void onWindowAttributesChanged(android.view.WindowManager.LayoutParams); method public void onWindowFocusChanged(boolean); 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 final void requestPermissions(java.lang.String[], int); 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 void runOnUiThread(java.lang.Runnable); method public void setActionBar(android.widget.Toolbar); diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index c4b7ed771b704..710cc79ab3f76 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -803,6 +803,7 @@ public class Activity extends ContextThemeWrapper final FragmentController mFragments = FragmentController.createController(new HostCallbacks()); // Most recent call to requestVisibleBehind(). + @Deprecated boolean mVisibleBehind; private static final class ManagedCursor { @@ -6384,9 +6385,13 @@ public class Activity extends ContextThemeWrapper *

False will be returned any time this method is called between the return of onPause and * 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 * translucent activities, false to indicate otherwise. Resources must be * released when passing false to this method. + * * @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 * then the activity may not count on being visible behind other translucent activities, @@ -6396,6 +6401,7 @@ public class Activity extends ContextThemeWrapper * * @see #onVisibleBehindCanceled() */ + @Deprecated public boolean requestVisibleBehind(boolean visible) { if (!mResumed) { // 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. * * @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 public void onVisibleBehindCanceled() { 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 * 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 * {@link #requestVisibleBehind(boolean)}, false otherwise. * @@ -6440,6 +6453,7 @@ public class Activity extends ContextThemeWrapper * @see #onBackgroundVisibleBehindChanged(boolean) * @hide */ + @Deprecated @SystemApi public boolean isBackgroundVisibleBehind() { try { @@ -6456,12 +6470,16 @@ public class Activity extends ContextThemeWrapper * This call may be a consequence of {@link #requestVisibleBehind(boolean)} or might be * 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. * * @see #requestVisibleBehind(boolean) * @see #onVisibleBehindCanceled() * @hide */ + @Deprecated @SystemApi public void onBackgroundVisibleBehindChanged(boolean visible) { } diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java index a4dcf630bc3e2..44c275f421612 100644 --- a/core/java/android/app/ActivityManager.java +++ b/core/java/android/app/ActivityManager.java @@ -852,7 +852,11 @@ public class ActivityManager { /** * Returns true if activities contained in this stack can request visible behind by * 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) { return stackId == FULLSCREEN_WORKSPACE_STACK_ID || stackId == ASSISTANT_STACK_ID;