Loading core/java/android/app/Dialog.java +0 −2 Original line number Diff line number Diff line Loading @@ -1482,8 +1482,6 @@ public class Dialog implements DialogInterface, Window.Callback, /** * Returns the {@link OnBackInvokedDispatcher} instance associated with the window that this * dialog is attached to. * * Returns null if the dialog is not attached to a window with a decor. */ @NonNull public OnBackInvokedDispatcher getOnBackInvokedDispatcher() { Loading core/java/android/app/admin/DevicePolicyManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -770,6 +770,10 @@ public class DevicePolicyManager { * <p>If this extra is set to {@code true}, the provisioning flow will still try to connect to * the internet, but if it fails it will start the offline provisioning flow. * * <p>For T if this extra is set to {@code true}, the provisioning flow will be forced through * the platform and there will be no attempt to download and install the device policy * management role holder. * * <p>The default value is {@code false}. * * <p>This extra is respected when provided via the provisioning intent actions such as {@link Loading core/java/android/inputmethodservice/InputMethodService.java +2 −1 Original line number Diff line number Diff line Loading @@ -135,6 +135,7 @@ import android.widget.FrameLayout; import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.TextView; import android.window.CompatOnBackInvokedCallback; import android.window.ImeOnBackInvokedDispatcher; import android.window.OnBackInvokedCallback; import android.window.OnBackInvokedDispatcher; Loading Loading @@ -350,7 +351,7 @@ public class InputMethodService extends AbstractInputMethodService { private RingBuffer<MotionEvent> mPendingEvents; private ImeOnBackInvokedDispatcher mImeDispatcher; private Boolean mBackCallbackRegistered = false; private final OnBackInvokedCallback mCompatBackCallback = this::compatHandleBack; private final CompatOnBackInvokedCallback mCompatBackCallback = this::compatHandleBack; /** * Returns whether {@link InputMethodService} is responsible for rendering the back button and Loading core/java/android/view/ViewRootImpl.java +5 −10 Original line number Diff line number Diff line Loading @@ -196,6 +196,7 @@ import android.view.contentcapture.MainContentCaptureSession; import android.view.inputmethod.InputMethodManager; import android.widget.Scroller; import android.window.ClientWindowFrames; import android.window.CompatOnBackInvokedCallback; import android.window.OnBackInvokedCallback; import android.window.OnBackInvokedDispatcher; import android.window.SurfaceSyncer; Loading Loading @@ -339,13 +340,12 @@ public final class ViewRootImpl implements ViewParent, /** * The top level {@link OnBackInvokedDispatcher}. */ private final WindowOnBackInvokedDispatcher mOnBackInvokedDispatcher = new WindowOnBackInvokedDispatcher(); private final WindowOnBackInvokedDispatcher mOnBackInvokedDispatcher; /** * Compatibility {@link OnBackInvokedCallback} that dispatches KEYCODE_BACK events * to view root for apps using legacy back behavior. */ private OnBackInvokedCallback mCompatOnBackInvokedCallback; private CompatOnBackInvokedCallback mCompatOnBackInvokedCallback; /** * Callback for notifying about global configuration changes. Loading Loading @@ -959,6 +959,8 @@ public final class ViewRootImpl implements ViewParent, mFastScrollSoundEffectsEnabled = audioManager.areNavigationRepeatSoundEffectsEnabled(); mScrollCaptureRequestTimeout = SCROLL_CAPTURE_REQUEST_TIMEOUT_MILLIS; mOnBackInvokedDispatcher = new WindowOnBackInvokedDispatcher( context.getApplicationInfo().isOnBackInvokedCallbackEnabled()); } public static void addFirstDrawHandler(Runnable callback) { Loading Loading @@ -10836,13 +10838,6 @@ public final class ViewRootImpl implements ViewParent, OnBackInvokedDispatcher.PRIORITY_DEFAULT, mCompatOnBackInvokedCallback); } private void unregisterCompatOnBackInvokedCallback() { if (mCompatOnBackInvokedCallback != null) { mOnBackInvokedDispatcher.unregisterOnBackInvokedCallback(mCompatOnBackInvokedCallback); mCompatOnBackInvokedCallback = null; } } @Override public void setTouchableRegion(Region r) { if (r != null) { Loading core/java/android/window/CompatOnBackInvokedCallback.java 0 → 100644 +30 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.window; /** * Marker interface for {@link OnBackInvokedCallback} used for backward compatibility between the * new system back and the old back event dispatching. Callbacks implementing this interface are * allowed to be registered even if <code>enableOnbackInvoked</code> is set to false in the * application manifest. * @hide */ public interface CompatOnBackInvokedCallback extends OnBackInvokedCallback{ @Override void onBackInvoked(); } Loading
core/java/android/app/Dialog.java +0 −2 Original line number Diff line number Diff line Loading @@ -1482,8 +1482,6 @@ public class Dialog implements DialogInterface, Window.Callback, /** * Returns the {@link OnBackInvokedDispatcher} instance associated with the window that this * dialog is attached to. * * Returns null if the dialog is not attached to a window with a decor. */ @NonNull public OnBackInvokedDispatcher getOnBackInvokedDispatcher() { Loading
core/java/android/app/admin/DevicePolicyManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -770,6 +770,10 @@ public class DevicePolicyManager { * <p>If this extra is set to {@code true}, the provisioning flow will still try to connect to * the internet, but if it fails it will start the offline provisioning flow. * * <p>For T if this extra is set to {@code true}, the provisioning flow will be forced through * the platform and there will be no attempt to download and install the device policy * management role holder. * * <p>The default value is {@code false}. * * <p>This extra is respected when provided via the provisioning intent actions such as {@link Loading
core/java/android/inputmethodservice/InputMethodService.java +2 −1 Original line number Diff line number Diff line Loading @@ -135,6 +135,7 @@ import android.widget.FrameLayout; import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.TextView; import android.window.CompatOnBackInvokedCallback; import android.window.ImeOnBackInvokedDispatcher; import android.window.OnBackInvokedCallback; import android.window.OnBackInvokedDispatcher; Loading Loading @@ -350,7 +351,7 @@ public class InputMethodService extends AbstractInputMethodService { private RingBuffer<MotionEvent> mPendingEvents; private ImeOnBackInvokedDispatcher mImeDispatcher; private Boolean mBackCallbackRegistered = false; private final OnBackInvokedCallback mCompatBackCallback = this::compatHandleBack; private final CompatOnBackInvokedCallback mCompatBackCallback = this::compatHandleBack; /** * Returns whether {@link InputMethodService} is responsible for rendering the back button and Loading
core/java/android/view/ViewRootImpl.java +5 −10 Original line number Diff line number Diff line Loading @@ -196,6 +196,7 @@ import android.view.contentcapture.MainContentCaptureSession; import android.view.inputmethod.InputMethodManager; import android.widget.Scroller; import android.window.ClientWindowFrames; import android.window.CompatOnBackInvokedCallback; import android.window.OnBackInvokedCallback; import android.window.OnBackInvokedDispatcher; import android.window.SurfaceSyncer; Loading Loading @@ -339,13 +340,12 @@ public final class ViewRootImpl implements ViewParent, /** * The top level {@link OnBackInvokedDispatcher}. */ private final WindowOnBackInvokedDispatcher mOnBackInvokedDispatcher = new WindowOnBackInvokedDispatcher(); private final WindowOnBackInvokedDispatcher mOnBackInvokedDispatcher; /** * Compatibility {@link OnBackInvokedCallback} that dispatches KEYCODE_BACK events * to view root for apps using legacy back behavior. */ private OnBackInvokedCallback mCompatOnBackInvokedCallback; private CompatOnBackInvokedCallback mCompatOnBackInvokedCallback; /** * Callback for notifying about global configuration changes. Loading Loading @@ -959,6 +959,8 @@ public final class ViewRootImpl implements ViewParent, mFastScrollSoundEffectsEnabled = audioManager.areNavigationRepeatSoundEffectsEnabled(); mScrollCaptureRequestTimeout = SCROLL_CAPTURE_REQUEST_TIMEOUT_MILLIS; mOnBackInvokedDispatcher = new WindowOnBackInvokedDispatcher( context.getApplicationInfo().isOnBackInvokedCallbackEnabled()); } public static void addFirstDrawHandler(Runnable callback) { Loading Loading @@ -10836,13 +10838,6 @@ public final class ViewRootImpl implements ViewParent, OnBackInvokedDispatcher.PRIORITY_DEFAULT, mCompatOnBackInvokedCallback); } private void unregisterCompatOnBackInvokedCallback() { if (mCompatOnBackInvokedCallback != null) { mOnBackInvokedDispatcher.unregisterOnBackInvokedCallback(mCompatOnBackInvokedCallback); mCompatOnBackInvokedCallback = null; } } @Override public void setTouchableRegion(Region r) { if (r != null) { Loading
core/java/android/window/CompatOnBackInvokedCallback.java 0 → 100644 +30 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.window; /** * Marker interface for {@link OnBackInvokedCallback} used for backward compatibility between the * new system back and the old back event dispatching. Callbacks implementing this interface are * allowed to be registered even if <code>enableOnbackInvoked</code> is set to false in the * application manifest. * @hide */ public interface CompatOnBackInvokedCallback extends OnBackInvokedCallback{ @Override void onBackInvoked(); }