diff --git a/core/api/current.txt b/core/api/current.txt index 34d3b91fb4802..27aa553a5e12b 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -4073,7 +4073,7 @@ package android.app { method @Deprecated public void onTabUnselected(android.app.ActionBar.Tab, android.app.FragmentTransaction); } - @UiContext public class Activity extends android.view.ContextThemeWrapper implements android.content.ComponentCallbacks2 android.view.KeyEvent.Callback android.view.LayoutInflater.Factory2 android.view.OnBackInvokedDispatcherOwner android.view.View.OnCreateContextMenuListener android.view.Window.Callback { + @UiContext public class Activity extends android.view.ContextThemeWrapper implements android.content.ComponentCallbacks2 android.view.KeyEvent.Callback android.view.LayoutInflater.Factory2 android.window.OnBackInvokedDispatcherOwner android.view.View.OnCreateContextMenuListener android.view.Window.Callback { ctor public Activity(); method public void addContentView(android.view.View, android.view.ViewGroup.LayoutParams); method public void closeContextMenu(); @@ -4116,7 +4116,7 @@ package android.app { method public int getMaxNumPictureInPictureActions(); method public final android.media.session.MediaController getMediaController(); method @NonNull public android.view.MenuInflater getMenuInflater(); - method @NonNull public android.view.OnBackInvokedDispatcher getOnBackInvokedDispatcher(); + method @NonNull public android.window.OnBackInvokedDispatcher getOnBackInvokedDispatcher(); method public final android.app.Activity getParent(); method @Nullable public android.content.Intent getParentActivityIntent(); method public android.content.SharedPreferences getPreferences(int); @@ -5002,7 +5002,7 @@ package android.app { method public void onDateSet(android.widget.DatePicker, int, int, int); } - public class Dialog implements android.content.DialogInterface android.view.KeyEvent.Callback android.view.OnBackInvokedDispatcherOwner android.view.View.OnCreateContextMenuListener android.view.Window.Callback { + public class Dialog implements android.content.DialogInterface android.view.KeyEvent.Callback android.window.OnBackInvokedDispatcherOwner android.view.View.OnCreateContextMenuListener android.view.Window.Callback { ctor public Dialog(@NonNull @UiContext android.content.Context); ctor public Dialog(@NonNull @UiContext android.content.Context, @StyleRes int); ctor protected Dialog(@NonNull @UiContext android.content.Context, boolean, @Nullable android.content.DialogInterface.OnCancelListener); @@ -5022,7 +5022,7 @@ package android.app { method @NonNull @UiContext public final android.content.Context getContext(); method @Nullable public android.view.View getCurrentFocus(); method @NonNull public android.view.LayoutInflater getLayoutInflater(); - method @NonNull public android.view.OnBackInvokedDispatcher getOnBackInvokedDispatcher(); + method @NonNull public android.window.OnBackInvokedDispatcher getOnBackInvokedDispatcher(); method @Nullable public final android.app.Activity getOwnerActivity(); method @Nullable public final android.view.SearchEvent getSearchEvent(); method public final int getVolumeControlStream(); @@ -49032,21 +49032,6 @@ package android.view { field public int toolType; } - public interface OnBackInvokedCallback { - method public default void onBackInvoked(); - } - - public interface OnBackInvokedDispatcher { - method public void registerOnBackInvokedCallback(@NonNull android.view.OnBackInvokedCallback, @IntRange(from=0) int); - method public void unregisterOnBackInvokedCallback(@NonNull android.view.OnBackInvokedCallback); - field public static final int PRIORITY_DEFAULT = 0; // 0x0 - field public static final int PRIORITY_OVERLAY = 1000000; // 0xf4240 - } - - public interface OnBackInvokedDispatcherOwner { - method @NonNull public android.view.OnBackInvokedDispatcher getOnBackInvokedDispatcher(); - } - public interface OnReceiveContentListener { method @Nullable public android.view.ContentInfo onReceiveContent(@NonNull android.view.View, @NonNull android.view.ContentInfo); } @@ -57908,6 +57893,21 @@ package android.widget.inline { package android.window { + public interface OnBackInvokedCallback { + method public default void onBackInvoked(); + } + + public interface OnBackInvokedDispatcher { + method public void registerOnBackInvokedCallback(@NonNull android.window.OnBackInvokedCallback, @IntRange(from=0) int); + method public void unregisterOnBackInvokedCallback(@NonNull android.window.OnBackInvokedCallback); + field public static final int PRIORITY_DEFAULT = 0; // 0x0 + field public static final int PRIORITY_OVERLAY = 1000000; // 0xf4240 + } + + public interface OnBackInvokedDispatcherOwner { + method @NonNull public android.window.OnBackInvokedDispatcher getOnBackInvokedDispatcher(); + } + public interface SplashScreen { method public void clearOnExitAnimationListener(); method public void setOnExitAnimationListener(@NonNull android.window.SplashScreen.OnExitAnimationListener); diff --git a/core/api/module-lib-current.txt b/core/api/module-lib-current.txt index 3241f2d9fb7c8..70a61df221eb1 100644 --- a/core/api/module-lib-current.txt +++ b/core/api/module-lib-current.txt @@ -10,7 +10,7 @@ package android { package android.app { - @UiContext public class Activity extends android.view.ContextThemeWrapper implements android.content.ComponentCallbacks2 android.view.KeyEvent.Callback android.view.LayoutInflater.Factory2 android.view.OnBackInvokedDispatcherOwner android.view.View.OnCreateContextMenuListener android.view.Window.Callback { + @UiContext public class Activity extends android.view.ContextThemeWrapper implements android.content.ComponentCallbacks2 android.view.KeyEvent.Callback android.view.LayoutInflater.Factory2 android.window.OnBackInvokedDispatcherOwner android.view.View.OnCreateContextMenuListener android.view.Window.Callback { method public final boolean addDumpable(@NonNull android.util.Dumpable); } diff --git a/core/api/system-current.txt b/core/api/system-current.txt index a3e455032b9dc..15666017f4319 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -463,7 +463,7 @@ package android.accounts { package android.app { - @UiContext public class Activity extends android.view.ContextThemeWrapper implements android.content.ComponentCallbacks2 android.view.KeyEvent.Callback android.view.LayoutInflater.Factory2 android.view.OnBackInvokedDispatcherOwner android.view.View.OnCreateContextMenuListener android.view.Window.Callback { + @UiContext public class Activity extends android.view.ContextThemeWrapper implements android.content.ComponentCallbacks2 android.view.KeyEvent.Callback android.view.LayoutInflater.Factory2 android.window.OnBackInvokedDispatcherOwner android.view.View.OnCreateContextMenuListener android.view.Window.Callback { method public void convertFromTranslucent(); method public boolean convertToTranslucent(android.app.Activity.TranslucentConversionListener, android.app.ActivityOptions); method @Deprecated public boolean isBackgroundVisibleBehind(); diff --git a/core/api/test-current.txt b/core/api/test-current.txt index eb56e40770dd2..4f319fb20745b 100644 --- a/core/api/test-current.txt +++ b/core/api/test-current.txt @@ -103,7 +103,7 @@ package android.animation { package android.app { - @UiContext public class Activity extends android.view.ContextThemeWrapper implements android.content.ComponentCallbacks2 android.view.KeyEvent.Callback android.view.LayoutInflater.Factory2 android.view.OnBackInvokedDispatcherOwner android.view.View.OnCreateContextMenuListener android.view.Window.Callback { + @UiContext public class Activity extends android.view.ContextThemeWrapper implements android.content.ComponentCallbacks2 android.view.KeyEvent.Callback android.view.LayoutInflater.Factory2 android.window.OnBackInvokedDispatcherOwner android.view.View.OnCreateContextMenuListener android.view.Window.Callback { method public final boolean addDumpable(@NonNull android.util.Dumpable); method public void dumpInternal(@NonNull String, @Nullable java.io.FileDescriptor, @NonNull java.io.PrintWriter, @Nullable String[]); method public void onMovedToDisplay(int, android.content.res.Configuration); @@ -2833,10 +2833,6 @@ package android.view { field public static final int FLAG_IS_ACCESSIBILITY_EVENT = 2048; // 0x800 } - public interface OnBackInvokedDispatcher { - field public static final long DISPATCH_BACK_INVOCATION_AHEAD_OF_TIME = 195946584L; // 0xbade858L - } - @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) public @interface RemotableViewMethod { method public abstract String asyncImpl() default ""; } @@ -3250,6 +3246,10 @@ package android.window { field public static final int FEATURE_WINDOW_TOKENS = 2; // 0x2 } + public interface OnBackInvokedDispatcher { + field public static final long DISPATCH_BACK_INVOCATION_AHEAD_OF_TIME = 195946584L; // 0xbade858L + } + public final class SplashScreenView extends android.widget.FrameLayout { method @Nullable public android.view.View getBrandingView(); } diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index bc979fc4af84b..8f348a4e81d69 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -120,9 +120,6 @@ import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.MotionEvent; -import android.view.OnBackInvokedCallback; -import android.view.OnBackInvokedDispatcher; -import android.view.OnBackInvokedDispatcherOwner; import android.view.RemoteAnimationDefinition; import android.view.SearchEvent; import android.view.View; @@ -149,6 +146,9 @@ import android.view.translation.UiTranslationSpec; import android.widget.AdapterView; import android.widget.Toast; import android.widget.Toolbar; +import android.window.OnBackInvokedCallback; +import android.window.OnBackInvokedDispatcher; +import android.window.OnBackInvokedDispatcherOwner; import android.window.SplashScreen; import android.window.WindowOnBackInvokedDispatcher; diff --git a/core/java/android/app/Dialog.java b/core/java/android/app/Dialog.java index 569fda961a4c6..82ff42b417994 100644 --- a/core/java/android/app/Dialog.java +++ b/core/java/android/app/Dialog.java @@ -52,9 +52,6 @@ import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.MotionEvent; -import android.view.OnBackInvokedCallback; -import android.view.OnBackInvokedDispatcher; -import android.view.OnBackInvokedDispatcherOwner; import android.view.SearchEvent; import android.view.View; import android.view.View.OnCreateContextMenuListener; @@ -63,6 +60,9 @@ import android.view.ViewGroup.LayoutParams; import android.view.Window; import android.view.WindowManager; import android.view.accessibility.AccessibilityEvent; +import android.window.OnBackInvokedCallback; +import android.window.OnBackInvokedDispatcher; +import android.window.OnBackInvokedDispatcherOwner; import android.window.WindowOnBackInvokedDispatcher; import com.android.internal.R; diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java index fbb03cab8ae7b..673127e9f808b 100644 --- a/core/java/android/content/pm/ApplicationInfo.java +++ b/core/java/android/content/pm/ApplicationInfo.java @@ -40,7 +40,7 @@ import android.util.ArraySet; import android.util.Printer; import android.util.SparseArray; import android.util.proto.ProtoOutputStream; -import android.view.OnBackInvokedCallback; +import android.window.OnBackInvokedCallback; import com.android.internal.util.ArrayUtils; import com.android.internal.util.Parcelling; @@ -2582,7 +2582,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { } /** - * Returns whether the application will use the {@link android.view.OnBackInvokedCallback} + * Returns whether the application will use the {@link android.window.OnBackInvokedCallback} * navigation system instead of the {@link android.view.KeyEvent#KEYCODE_BACK} and related * callbacks. * diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 2685e0aada8c9..760e021bd4abe 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -196,6 +196,9 @@ import android.view.contentcapture.MainContentCaptureSession; import android.view.inputmethod.InputMethodManager; import android.widget.Scroller; import android.window.ClientWindowFrames; +import android.window.OnBackInvokedCallback; +import android.window.OnBackInvokedDispatcher; +import android.window.OnBackInvokedDispatcherOwner; import android.window.SurfaceSyncer; import android.window.WindowOnBackInvokedDispatcher; @@ -223,7 +226,6 @@ import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; -import java.util.LinkedList; import java.util.List; import java.util.Objects; import java.util.Queue; diff --git a/core/java/android/window/BackNavigationInfo.java b/core/java/android/window/BackNavigationInfo.java index 1e922d91e7b51..6653758e6c50d 100644 --- a/core/java/android/window/BackNavigationInfo.java +++ b/core/java/android/window/BackNavigationInfo.java @@ -61,7 +61,7 @@ public final class BackNavigationInfo implements Parcelable { public static final int TYPE_CROSS_TASK = 3; /** - * A {@link android.view.OnBackInvokedCallback} is available and needs to be called. + * A {@link OnBackInvokedCallback} is available and needs to be called. *

*/ public static final int TYPE_CALLBACK = 4; @@ -206,13 +206,13 @@ public final class BackNavigationInfo implements Parcelable { } /** - * Returns the {@link android.view.OnBackInvokedCallback} of the top level window or null if + * Returns the {@link OnBackInvokedCallback} of the top level window or null if * the client didn't register a callback. *

* This is never null when {@link #getType} returns {@link #TYPE_CALLBACK}. * - * @see android.view.OnBackInvokedCallback - * @see android.view.OnBackInvokedDispatcher + * @see OnBackInvokedCallback + * @see OnBackInvokedDispatcher */ @Nullable public IOnBackInvokedCallback getOnBackInvokedCallback() { diff --git a/core/java/android/view/OnBackInvokedCallback.java b/core/java/android/window/OnBackInvokedCallback.java similarity index 97% rename from core/java/android/view/OnBackInvokedCallback.java rename to core/java/android/window/OnBackInvokedCallback.java index 37f858abf8184..dcd80fd76e09a 100644 --- a/core/java/android/view/OnBackInvokedCallback.java +++ b/core/java/android/window/OnBackInvokedCallback.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package android.view; +package android.window; import android.app.Activity; import android.app.Dialog; -import android.window.BackEvent; +import android.view.View; /** * Interface for applications to register back invocation callbacks. This allows the client diff --git a/core/java/android/view/OnBackInvokedDispatcher.java b/core/java/android/window/OnBackInvokedDispatcher.java similarity index 96% rename from core/java/android/view/OnBackInvokedDispatcher.java rename to core/java/android/window/OnBackInvokedDispatcher.java index 5c4ee89bfbd3e..63e6d30c8c0b5 100644 --- a/core/java/android/view/OnBackInvokedDispatcher.java +++ b/core/java/android/window/OnBackInvokedDispatcher.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.view; +package android.window; import android.annotation.IntDef; import android.annotation.IntRange; @@ -39,7 +39,7 @@ import java.lang.annotation.RetentionPolicy; */ public interface OnBackInvokedDispatcher { /** - * Enables dispatching the "back" action via {@link android.view.OnBackInvokedDispatcher}. + * Enables dispatching the "back" action via {@link OnBackInvokedDispatcher}. * * When enabled, the following APIs are no longer invoked: *