From 85a154998720170569a3ba5536348316b9f6a208 Mon Sep 17 00:00:00 2001 From: Arthur Hung Date: Thu, 9 Feb 2023 08:10:10 +0000 Subject: [PATCH] Clarify unbuffered dispatch may fail before attached to window Add the docs to to clarify that prior to Android U, the call to `View::requestUnbufferedDispatch` will fail if the View is not attached to window. Bug: 268105812 Test: manual Change-Id: Ic57ac42447750129a80f6aa71710963ae4594ce0 --- core/java/android/view/View.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 20f6baf3780f1..cecfc8a7d66e8 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -17167,6 +17167,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * This is similar to {@link View#requestUnbufferedDispatch(MotionEvent)}, but does not * automatically terminate, and allows the specification of arbitrary input source classes. * + *

Prior to {@link android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE}, this method will fail + * when this View is not attached to a window. + * * @param source The combined input source class to request unbuffered dispatch for. All * events coming from these source classes will not be buffered. Set to * {@link InputDevice#SOURCE_CLASS_NONE} in order to return to default behaviour.