Loading core/api/test-current.txt +0 −4 Original line number Diff line number Diff line Loading @@ -3262,10 +3262,6 @@ 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(); } Loading core/java/android/window/OnBackInvokedDispatcher.java +0 −20 Original line number Diff line number Diff line Loading @@ -21,9 +21,6 @@ import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SuppressLint; import android.annotation.TestApi; import android.compat.annotation.ChangeId; import android.compat.annotation.EnabledSince; import android.os.Build; import java.lang.annotation.Retention; Loading @@ -38,23 +35,6 @@ import java.lang.annotation.RetentionPolicy; * target (a.k.a. the callback to be invoked next), or its behavior. */ public interface OnBackInvokedDispatcher { /** * Enables dispatching the "back" action via {@link OnBackInvokedDispatcher}. * * When enabled, the following APIs are no longer invoked: * <ul> * <li> {@link android.app.Activity#onBackPressed} * <li> {@link android.app.Dialog#onBackPressed} * <li> {@link android.view.KeyEvent#KEYCODE_BACK} is no longer dispatched. * </ul> * * @hide */ @TestApi @ChangeId @EnabledSince(targetSdkVersion = Build.VERSION_CODES.TIRAMISU) long DISPATCH_BACK_INVOCATION_AHEAD_OF_TIME = 195946584L; /** @hide */ String TAG = "OnBackInvokedDispatcher"; Loading core/java/android/window/WindowOnBackInvokedDispatcher.java +8 −10 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package android.window; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.compat.CompatChanges; import android.content.Context; import android.os.Debug; import android.os.Handler; Loading Loading @@ -253,21 +252,20 @@ public class WindowOnBackInvokedDispatcher implements OnBackInvokedDispatcher { * {@link OnBackInvokedCallback}. */ public static boolean isOnBackInvokedCallbackEnabled(@Nullable Context context) { // new back is enabled if the app targets T AND the feature flag is enabled AND the app // does not explicitly request legacy back. boolean targetsT = CompatChanges.isChangeEnabled(DISPATCH_BACK_INVOCATION_AHEAD_OF_TIME); // new back is enabled if the feature flag is enabled AND the app does not explicitly // request legacy back. boolean featureFlagEnabled = IS_BACK_PREDICTABILITY_ENABLED; // If the context is null, we assume true and fallback on the two other conditions. boolean appRequestsLegacy = context == null || !context.getApplicationInfo().isOnBackInvokedCallbackEnabled(); boolean appRequestsPredictiveBack = context != null && context.getApplicationInfo().isOnBackInvokedCallbackEnabled(); if (DEBUG) { Log.d(TAG, TextUtils.formatSimple("App: %s isChangeEnabled=%s featureFlagEnabled=%s " + "onBackInvokedEnabled=%s", Log.d(TAG, TextUtils.formatSimple("App: %s featureFlagEnabled=%s " + "appRequestsPredictiveBack=%s", context != null ? context.getApplicationInfo().packageName : "null context", targetsT, featureFlagEnabled, !appRequestsLegacy)); featureFlagEnabled, appRequestsPredictiveBack)); } return targetsT && featureFlagEnabled && !appRequestsLegacy; return featureFlagEnabled && appRequestsPredictiveBack; } } Loading
core/api/test-current.txt +0 −4 Original line number Diff line number Diff line Loading @@ -3262,10 +3262,6 @@ 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(); } Loading
core/java/android/window/OnBackInvokedDispatcher.java +0 −20 Original line number Diff line number Diff line Loading @@ -21,9 +21,6 @@ import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SuppressLint; import android.annotation.TestApi; import android.compat.annotation.ChangeId; import android.compat.annotation.EnabledSince; import android.os.Build; import java.lang.annotation.Retention; Loading @@ -38,23 +35,6 @@ import java.lang.annotation.RetentionPolicy; * target (a.k.a. the callback to be invoked next), or its behavior. */ public interface OnBackInvokedDispatcher { /** * Enables dispatching the "back" action via {@link OnBackInvokedDispatcher}. * * When enabled, the following APIs are no longer invoked: * <ul> * <li> {@link android.app.Activity#onBackPressed} * <li> {@link android.app.Dialog#onBackPressed} * <li> {@link android.view.KeyEvent#KEYCODE_BACK} is no longer dispatched. * </ul> * * @hide */ @TestApi @ChangeId @EnabledSince(targetSdkVersion = Build.VERSION_CODES.TIRAMISU) long DISPATCH_BACK_INVOCATION_AHEAD_OF_TIME = 195946584L; /** @hide */ String TAG = "OnBackInvokedDispatcher"; Loading
core/java/android/window/WindowOnBackInvokedDispatcher.java +8 −10 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package android.window; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.compat.CompatChanges; import android.content.Context; import android.os.Debug; import android.os.Handler; Loading Loading @@ -253,21 +252,20 @@ public class WindowOnBackInvokedDispatcher implements OnBackInvokedDispatcher { * {@link OnBackInvokedCallback}. */ public static boolean isOnBackInvokedCallbackEnabled(@Nullable Context context) { // new back is enabled if the app targets T AND the feature flag is enabled AND the app // does not explicitly request legacy back. boolean targetsT = CompatChanges.isChangeEnabled(DISPATCH_BACK_INVOCATION_AHEAD_OF_TIME); // new back is enabled if the feature flag is enabled AND the app does not explicitly // request legacy back. boolean featureFlagEnabled = IS_BACK_PREDICTABILITY_ENABLED; // If the context is null, we assume true and fallback on the two other conditions. boolean appRequestsLegacy = context == null || !context.getApplicationInfo().isOnBackInvokedCallbackEnabled(); boolean appRequestsPredictiveBack = context != null && context.getApplicationInfo().isOnBackInvokedCallbackEnabled(); if (DEBUG) { Log.d(TAG, TextUtils.formatSimple("App: %s isChangeEnabled=%s featureFlagEnabled=%s " + "onBackInvokedEnabled=%s", Log.d(TAG, TextUtils.formatSimple("App: %s featureFlagEnabled=%s " + "appRequestsPredictiveBack=%s", context != null ? context.getApplicationInfo().packageName : "null context", targetsT, featureFlagEnabled, !appRequestsLegacy)); featureFlagEnabled, appRequestsPredictiveBack)); } return targetsT && featureFlagEnabled && !appRequestsLegacy; return featureFlagEnabled && appRequestsPredictiveBack; } }