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

Commit 5b44dd8b authored by Shan Huang's avatar Shan Huang Committed by Android (Google) Code Review
Browse files

Merge changes from topic "shanh-back-api"

* changes:
  Provide OnBackInvokedDispatcher from Activity, View and Dialog
  Introduce IOnBackInvokedCallback and OnBackInvokedDispatcher
parents b0595af5 c0999600
Loading
Loading
Loading
Loading
+22 −3
Original line number Original line Diff line number Diff line
@@ -3995,7 +3995,7 @@ package android.app {
    method @Deprecated public void onTabUnselected(android.app.ActionBar.Tab, android.app.FragmentTransaction);
    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.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.view.OnBackInvokedDispatcherOwner android.view.View.OnCreateContextMenuListener android.view.Window.Callback {
    ctor public Activity();
    ctor public Activity();
    method public void addContentView(android.view.View, android.view.ViewGroup.LayoutParams);
    method public void addContentView(android.view.View, android.view.ViewGroup.LayoutParams);
    method public void closeContextMenu();
    method public void closeContextMenu();
@@ -4038,6 +4038,7 @@ package android.app {
    method public int getMaxNumPictureInPictureActions();
    method public int getMaxNumPictureInPictureActions();
    method public final android.media.session.MediaController getMediaController();
    method public final android.media.session.MediaController getMediaController();
    method @NonNull public android.view.MenuInflater getMenuInflater();
    method @NonNull public android.view.MenuInflater getMenuInflater();
    method @Nullable public android.view.OnBackInvokedDispatcher getOnBackInvokedDispatcher();
    method public final android.app.Activity getParent();
    method public final android.app.Activity getParent();
    method @Nullable public android.content.Intent getParentActivityIntent();
    method @Nullable public android.content.Intent getParentActivityIntent();
    method public android.content.SharedPreferences getPreferences(int);
    method public android.content.SharedPreferences getPreferences(int);
@@ -4916,7 +4917,7 @@ package android.app {
    method public void onDateSet(android.widget.DatePicker, int, int, int);
    method public void onDateSet(android.widget.DatePicker, int, int, int);
  }
  }
  public class Dialog implements android.content.DialogInterface android.view.KeyEvent.Callback android.view.View.OnCreateContextMenuListener android.view.Window.Callback {
  public class Dialog implements android.content.DialogInterface android.view.KeyEvent.Callback android.view.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);
    ctor public Dialog(@NonNull @UiContext android.content.Context, @StyleRes int);
    ctor public Dialog(@NonNull @UiContext android.content.Context, @StyleRes int);
    ctor protected Dialog(@NonNull @UiContext android.content.Context, boolean, @Nullable android.content.DialogInterface.OnCancelListener);
    ctor protected Dialog(@NonNull @UiContext android.content.Context, boolean, @Nullable android.content.DialogInterface.OnCancelListener);
@@ -4936,6 +4937,7 @@ package android.app {
    method @NonNull @UiContext public final android.content.Context getContext();
    method @NonNull @UiContext public final android.content.Context getContext();
    method @Nullable public android.view.View getCurrentFocus();
    method @Nullable public android.view.View getCurrentFocus();
    method @NonNull public android.view.LayoutInflater getLayoutInflater();
    method @NonNull public android.view.LayoutInflater getLayoutInflater();
    method @Nullable public android.view.OnBackInvokedDispatcher getOnBackInvokedDispatcher();
    method @Nullable public final android.app.Activity getOwnerActivity();
    method @Nullable public final android.app.Activity getOwnerActivity();
    method @Nullable public final android.view.SearchEvent getSearchEvent();
    method @Nullable public final android.view.SearchEvent getSearchEvent();
    method public final int getVolumeControlStream();
    method public final int getVolumeControlStream();
@@ -49478,6 +49480,22 @@ package android.view {
    field public int toolType;
    field public int toolType;
  }
  }
  public interface OnBackInvokedCallback {
    method public default void onBackInvoked();
  }
  public abstract class OnBackInvokedDispatcher {
    ctor public OnBackInvokedDispatcher();
    method public abstract void registerOnBackInvokedCallback(@NonNull android.view.OnBackInvokedCallback, int);
    method public abstract 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 @Nullable public android.view.OnBackInvokedDispatcher getOnBackInvokedDispatcher();
  }
  public interface OnReceiveContentListener {
  public interface OnReceiveContentListener {
    method @Nullable public android.view.ContentInfo onReceiveContent(@NonNull android.view.View, @NonNull android.view.ContentInfo);
    method @Nullable public android.view.ContentInfo onReceiveContent(@NonNull android.view.View, @NonNull android.view.ContentInfo);
  }
  }
@@ -49901,7 +49919,7 @@ package android.view {
    field @NonNull public static final android.os.Parcelable.Creator<android.view.VerifiedMotionEvent> CREATOR;
    field @NonNull public static final android.os.Parcelable.Creator<android.view.VerifiedMotionEvent> CREATOR;
  }
  }
  @UiThread public class View implements android.view.accessibility.AccessibilityEventSource android.graphics.drawable.Drawable.Callback android.view.KeyEvent.Callback {
  @UiThread public class View implements android.view.accessibility.AccessibilityEventSource android.graphics.drawable.Drawable.Callback android.view.KeyEvent.Callback android.view.OnBackInvokedDispatcherOwner {
    ctor public View(android.content.Context);
    ctor public View(android.content.Context);
    ctor public View(android.content.Context, @Nullable android.util.AttributeSet);
    ctor public View(android.content.Context, @Nullable android.util.AttributeSet);
    ctor public View(android.content.Context, @Nullable android.util.AttributeSet, int);
    ctor public View(android.content.Context, @Nullable android.util.AttributeSet, int);
@@ -50105,6 +50123,7 @@ package android.view {
    method @IdRes public int getNextFocusLeftId();
    method @IdRes public int getNextFocusLeftId();
    method @IdRes public int getNextFocusRightId();
    method @IdRes public int getNextFocusRightId();
    method @IdRes public int getNextFocusUpId();
    method @IdRes public int getNextFocusUpId();
    method @Nullable public android.view.OnBackInvokedDispatcher getOnBackInvokedDispatcher();
    method public android.view.View.OnFocusChangeListener getOnFocusChangeListener();
    method public android.view.View.OnFocusChangeListener getOnFocusChangeListener();
    method @ColorInt public int getOutlineAmbientShadowColor();
    method @ColorInt public int getOutlineAmbientShadowColor();
    method public android.view.ViewOutlineProvider getOutlineProvider();
    method public android.view.ViewOutlineProvider getOutlineProvider();
+1 −1
Original line number Original line Diff line number Diff line
@@ -9,7 +9,7 @@ package android {


package android.app {
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.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.view.OnBackInvokedDispatcherOwner android.view.View.OnCreateContextMenuListener android.view.Window.Callback {
    method public final boolean addDumpable(@NonNull android.util.Dumpable);
    method public final boolean addDumpable(@NonNull android.util.Dumpable);
  }
  }


+1 −1
Original line number Original line Diff line number Diff line
@@ -513,7 +513,7 @@ package android.util {


package android.view {
package android.view {


  @UiThread public class View implements android.view.accessibility.AccessibilityEventSource android.graphics.drawable.Drawable.Callback android.view.KeyEvent.Callback {
  @UiThread public class View implements android.view.accessibility.AccessibilityEventSource android.graphics.drawable.Drawable.Callback android.view.KeyEvent.Callback android.view.OnBackInvokedDispatcherOwner {
    method protected void initializeFadingEdge(android.content.res.TypedArray);
    method protected void initializeFadingEdge(android.content.res.TypedArray);
    method protected void initializeScrollbars(android.content.res.TypedArray);
    method protected void initializeScrollbars(android.content.res.TypedArray);
  }
  }
+1 −1
Original line number Original line Diff line number Diff line
@@ -444,7 +444,7 @@ package android.accounts {
package android.app {
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.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.view.OnBackInvokedDispatcherOwner android.view.View.OnCreateContextMenuListener android.view.Window.Callback {
    method public void convertFromTranslucent();
    method public void convertFromTranslucent();
    method public boolean convertToTranslucent(android.app.Activity.TranslucentConversionListener, android.app.ActivityOptions);
    method public boolean convertToTranslucent(android.app.Activity.TranslucentConversionListener, android.app.ActivityOptions);
    method @Deprecated public boolean isBackgroundVisibleBehind();
    method @Deprecated public boolean isBackgroundVisibleBehind();
+2 −2
Original line number Original line Diff line number Diff line
@@ -101,7 +101,7 @@ package android.animation {


package android.app {
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.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.view.OnBackInvokedDispatcherOwner android.view.View.OnCreateContextMenuListener android.view.Window.Callback {
    method public void onMovedToDisplay(int, android.content.res.Configuration);
    method public void onMovedToDisplay(int, android.content.res.Configuration);
  }
  }


@@ -2779,7 +2779,7 @@ package android.view {
    method public void setView(@NonNull android.view.View, @NonNull android.view.WindowManager.LayoutParams);
    method public void setView(@NonNull android.view.View, @NonNull android.view.WindowManager.LayoutParams);
  }
  }


  @UiThread public class View implements android.view.accessibility.AccessibilityEventSource android.graphics.drawable.Drawable.Callback android.view.KeyEvent.Callback {
  @UiThread public class View implements android.view.accessibility.AccessibilityEventSource android.graphics.drawable.Drawable.Callback android.view.KeyEvent.Callback android.view.OnBackInvokedDispatcherOwner {
    method public android.view.View getTooltipView();
    method public android.view.View getTooltipView();
    method public boolean isAutofilled();
    method public boolean isAutofilled();
    method public static boolean isDefaultFocusHighlightEnabled();
    method public static boolean isDefaultFocusHighlightEnabled();
Loading