Fix broken documentation in android.view
The most common problem were references to SystemApi or @hide symbols
from public documentation. Replace such references with natural english
or {@code}. A few references were just incorrect before and have been
fixed.
Bug: 303184203
Test: m docs
Change-Id: I243e27d7ae6e0dafa2af4f3cc44aa7e8894025f1
diff --git a/api/javadoc-lint-baseline b/api/javadoc-lint-baseline
index d1821d9..48c7657 100644
--- a/api/javadoc-lint-baseline
+++ b/api/javadoc-lint-baseline
@@ -197,33 +197,7 @@
android/service/voice/VoiceInteractionSession.java:293: lint: Unresolved link/see tag "android.service.voice.VoiceInteractionService#KEY_SHOW_SESSION_ID VoiceInteractionService#KEY_SHOW_SESSION_ID" in android.service.voice.VoiceInteractionSession [101]
android/text/DynamicLayout.java:141: lint: Unresolved link/see tag "LineBreakconfig" in android.text.DynamicLayout [101]
android/text/WordSegmentFinder.java:13: lint: Unresolved link/see tag "android.text.method.WordIterator WordIterator" in android.text.WordSegmentFinder [101]
-android/view/InputDevice.java:71: lint: Unresolved link/see tag "InputManagerGlobal.InputDeviceListener" in android.view.InputDevice [101]
android/view/PixelCopy.java:468: lint: Unresolved link/see tag "android.view.PixelCopy.CopyResultStatus CopyResultStatus" in android.view.PixelCopy.Result [101]
-android/view/ScrollFeedbackProvider.java:-25: lint: Unresolved link/see tag "InputManager" in android.view.ScrollFeedbackProvider [101]
-android/view/ScrollFeedbackProvider.java:-25: lint: Unresolved link/see tag "InputManager#getInputDeviceIds()" in android.view.ScrollFeedbackProvider [101]
-android/view/SurfaceControl.java:823: lint: Unresolved link/see tag "android.view.SurfaceControl.TrustedPresentationCallback TrustedPresentationCallback" in android.view.SurfaceControl.Transaction [101]
-android/view/SurfaceControl.java:900: lint: Unresolved link/see tag "android.view.SurfaceControl.TrustedPresentationCallback TrustedPresentationCallback" in android.view.SurfaceControl.Transaction [101]
-android/view/SurfaceControl.java:908: lint: Unresolved link/see tag "android.view.SurfaceControl.TrustedPresentationCallback TrustedPresentationCallback" in android.view.SurfaceControl.Transaction [101]
-android/view/View.java:1647: lint: Unresolved link/see tag "androidx.core.view.ViewCompat#setAccessibilityPaneTitle(View, CharSequence)" in android.view.View [101]
-android/view/View.java:4669: lint: Unresolved link/see tag "androidx.core.view.ViewCompat#setScreenReaderFocusable(View, boolean)" in android.view.View [101]
-android/view/View.java:4712: lint: Unresolved link/see tag "androidx.core.view.ViewCompat#setAccessibilityHeading(View, boolean)" in android.view.View [101]
-android/view/WindowManager.java:230: lint: Unresolved link/see tag "android.annotation.UiContext" in android.view.WindowManager [101]
-android/view/WindowManager.java:247: lint: Unresolved link/see tag "android.annotation.UiContext" in android.view.WindowManager [101]
-android/view/WindowManager.java:822: lint: @attr must be a field: android.R.attr#Window_windowNoMoveAnimation [106]
-android/view/WindowManager.java:832: lint: @attr must be a field: android.R.attr#Window_windowNoMoveAnimation [106]
-android/view/WindowMetrics.java:22: lint: Unresolved link/see tag "android.annotation.UiContext" in android.view.WindowMetrics [101]
-android/view/WindowMetrics.java:57: lint: Unresolved link/see tag "android.annotation.UiContext" in android.view.WindowMetrics [101]
-android/view/WindowMetrics.java:114: lint: Unresolved link/see tag "android.annotation.UiContext" in android.view.WindowMetrics [101]
-android/view/WindowMetrics.java:127: lint: Unresolved link/see tag "android.annotation.UiContext" in android.view.WindowMetrics [101]
-android/view/accessibility/AccessibilityNodeInfo.java:368: lint: Unresolved link/see tag "androidx.core.view.ViewCompat#addAccessibilityAction(View, AccessibilityNodeInfoCompat.AccessibilityActionCompat)" in android.view.accessibility.AccessibilityNodeInfo [101]
-android/view/accessibility/AccessibilityNodeInfo.java:3246: lint: Unresolved link/see tag "androidx.core.view.ViewCompat#addAccessibilityAction(View, AccessibilityNodeInfoCompat.AccessibilityActionCompat)" in android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction [101]
-android/view/displayhash/DisplayHashResultCallback.java:38: lint: Unresolved link/see tag "android.view.displayhash.DisplayHashResultCallback.DisplayHashErrorCode DisplayHashErrorCode" in android.view.displayhash.DisplayHashResultCallback [101]
-android/view/inputmethod/EditorInfo.java:107: lint: Unresolved link/see tag "android.widget.Editor Editor" in android.view.inputmethod.EditorInfo [101]
-android/view/inputmethod/EditorInfo.java:122: lint: Unresolved link/see tag "android.widget.Editor Editor" in android.view.inputmethod.EditorInfo [101]
-android/view/inputmethod/InputMethodManager.java:423: lint: Unresolved link/see tag "android.widget.Editor Editor" in android.view.inputmethod.InputMethodManager [101]
-android/view/inputmethod/InputMethodManager.java:447: lint: Unresolved link/see tag "android.widget.Editor Editor" in android.view.inputmethod.InputMethodManager [101]
-android/view/inputmethod/InputMethodManager.java:456: lint: Unresolved link/see tag "android.widget.Editor Editor" in android.view.inputmethod.InputMethodManager [101]
-android/view/inspector/PropertyReader.java:141: lint: Unresolved link/see tag "android.annotation.ColorInt ColorInt" in android.view.inspector.PropertyReader [101]
android/window/BackEvent.java:24: lint: Unresolved link/see tag "android.window.BackMotionEvent BackMotionEvent" in android.window.BackEvent [101]
android/net/wifi/SoftApConfiguration.java:173: lint: Unresolved link/see tag "android.net.wifi.SoftApConfiguration.Builder#setShutdownTimeoutMillis(long)" in android.net.wifi.SoftApConfiguration [101]
@@ -234,8 +208,6 @@
android/service/voice/AlwaysOnHotwordDetector.java:278: lint: Unresolved link/see tag "#STATE_ERROR" in android [101]
android/service/voice/AlwaysOnHotwordDetector.java:278: lint: Unresolved link/see tag "Callback#onFailure" in android [101]
android/service/voice/AlwaysOnHotwordDetector.java:278: lint: Unresolved link/see tag "Callback#onUnknownFailure" in android [101]
-android/view/animation/AnimationUtils.java:64: lint: Unresolved link/see tag "Build.VERSION_CODES#VANILLA_ICE_CREAM" in android.view.animation.AnimationUtils [101]
-android/view/contentcapture/ContentCaptureSession.java:188: lint: Unresolved link/see tag "UPSIDE_DOWN_CAKE" in android.view.contentcapture.ContentCaptureSession [101]
com/android/internal/policy/PhoneWindow.java:172: lint: Unresolved link/see tag "Build.VERSION_CODES#VANILLA_ICE_CREAM" in com.android.internal.policy.PhoneWindow [101]
com/android/server/broadcastradio/aidl/ConversionUtils.java:70: lint: Unresolved link/see tag "IdentifierType#DAB_SID_EXT" in android [101]
@@ -257,7 +229,5 @@
android/os/BatteryStatsManager.java:260: lint: Invalid tag: @Deprecated [131]
android/os/BatteryStatsManager.java:275: lint: Invalid tag: @Deprecated [131]
-android/view/WindowManager.java:906: lint: @attr must be a field: android.R.attr#Window_windowNoMoveAnimation [106]
-android/view/WindowManager.java:916: lint: @attr must be a field: android.R.attr#Window_windowNoMoveAnimation [106]
java/lang/ClassLoader.java:853: lint: Unknown tag: @systemProperty [103]
diff --git a/core/java/android/view/InputDevice.java b/core/java/android/view/InputDevice.java
index c35b690..9f886c8 100644
--- a/core/java/android/view/InputDevice.java
+++ b/core/java/android/view/InputDevice.java
@@ -778,7 +778,8 @@
* Each gamepad or joystick is given a unique, positive controller number when initially
* configured by the system. This number may change due to events such as device disconnects /
* reconnects or user initiated reassignment. Any change in number will trigger an event that
- * can be observed by registering an {@link InputManagerGlobal.InputDeviceListener}.
+ * can be observed by registering an
+ * {@link android.hardware.input.InputManager.InputDeviceListener}.
* </p>
* <p>
* All input devices which are not gamepads or joysticks will be assigned a controller number
diff --git a/core/java/android/view/ScrollFeedbackProvider.java b/core/java/android/view/ScrollFeedbackProvider.java
index 78716f5..0ba4148 100644
--- a/core/java/android/view/ScrollFeedbackProvider.java
+++ b/core/java/android/view/ScrollFeedbackProvider.java
@@ -17,7 +17,6 @@
package android.view;
import android.annotation.FlaggedApi;
-import android.annotation.NonNull;
import android.view.flags.Flags;
/**
@@ -43,7 +42,8 @@
* the scroll event. If calling this method in response to a {@link MotionEvent}, use the device ID
* that is reported by the event, which can be obtained using {@link MotionEvent#getDeviceId()}.
* Otherwise, use a valid ID that is obtained from {@link InputDevice#getId()}, or from an
- * {@link InputManager} instance ({@link InputManager#getInputDeviceIds()} gives all the valid input
+ * {@link android.hardware.input.InputManager} instance
+ * ({@link android.hardware.input.InputManager#getInputDeviceIds()} gives all the valid input
* device IDs).
*
* <li><p><b>source</b>: should always be the {@link InputDevice} source that generated the scroll
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java
index b080b71..658341c 100644
--- a/core/java/android/view/SurfaceControl.java
+++ b/core/java/android/view/SurfaceControl.java
@@ -4266,8 +4266,7 @@
* be somewhat arbitrary, and so there are some somewhat arbitrary decisions in
* this API as well.
* <p>
- * @param sc The {@link SurfaceControl} to set the
- * {@link TrustedPresentationCallback} on
+ * @param sc The {@link SurfaceControl} to set the callback on
* @param thresholds The {@link TrustedPresentationThresholds} that will specify when the to
* invoke the callback.
* @param executor The {@link Executor} where the callback will be invoked on.
@@ -4300,10 +4299,9 @@
}
/**
- * Clears the {@link TrustedPresentationCallback} for a specific {@link SurfaceControl}
+ * Clears the callback for a specific {@link SurfaceControl}
*
- * @param sc The SurfaceControl that the {@link TrustedPresentationCallback} should be
- * cleared from
+ * @param sc The SurfaceControl that the callback should be cleared from
* @return This transaction
*/
@NonNull
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index 6c8f542..a3b93b4 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -1685,7 +1685,7 @@
* orientation (e.g. with {@link android.app.Activity#setRequestedOrientation(int)}). This
* listener gives application an opportunity to selectively react to device orientation changes.
* The newly added listener will be called with current proposed rotation. Note that the context
- * of this window manager instance must be a {@link android.annotation.UiContext}.
+ * of this window manager instance must be a {@code UiContext}.
*
* @param executor The executor on which callback method will be invoked.
* @param listener Called when the proposed rotation for the context is being delivered.
@@ -1693,7 +1693,7 @@
* {@link Surface#ROTATION_90}, {@link Surface#ROTATION_180} and
* {@link Surface#ROTATION_270}.
* @throws UnsupportedOperationException if this method is called on an instance that is not
- * associated with a {@link android.annotation.UiContext}.
+ * associated with a {@code UiContext}.
*/
default void addProposedRotationListener(@NonNull @CallbackExecutor Executor executor,
@NonNull IntConsumer listener) {
@@ -3115,7 +3115,7 @@
/**
* Never animate position changes of the window.
*
- * @see android.R.attr#Window_windowNoMoveAnimation
+ * @see android.R.styleable#Window_windowNoMoveAnimation
* {@hide}
*/
@UnsupportedAppUsage
@@ -4531,7 +4531,7 @@
* Set whether animations can be played for position changes on this window. If disabled,
* the window will move to its new position instantly without animating.
*
- * @attr ref android.R.attr#Window_windowNoMoveAnimation
+ * @attr ref android.R.styleable#Window_windowNoMoveAnimation
*/
public void setCanPlayMoveAnimation(boolean enable) {
if (enable) {
@@ -4546,7 +4546,7 @@
* This does not guarantee that an animation will be played in all such situations. For
* example, drag-resizing may move the window but not play an animation.
*
- * @attr ref android.R.attr#Window_windowNoMoveAnimation
+ * @attr ref android.R.styleable#Window_windowNoMoveAnimation
*/
public boolean canPlayMoveAnimation() {
return (privateFlags & PRIVATE_FLAG_NO_MOVE_ANIMATION) == 0;
diff --git a/core/java/android/view/WindowMetrics.java b/core/java/android/view/WindowMetrics.java
index 7ad43c7..26298bc 100644
--- a/core/java/android/view/WindowMetrics.java
+++ b/core/java/android/view/WindowMetrics.java
@@ -47,7 +47,6 @@
* @see WindowInsets#getInsets(int)
* @see WindowManager#getCurrentWindowMetrics()
* @see WindowManager#getMaximumWindowMetrics()
- * @see android.annotation.UiContext
*/
public final class WindowMetrics {
@NonNull
@@ -99,8 +98,7 @@
}
/**
- * Returns the bounds of the area associated with this window or
- * {@link android.annotation.UiContext}.
+ * Returns the bounds of the area associated with this window or {@code UiContext}.
* <p>
* <b>Note that the size of the reported bounds can have different size than
* {@link Display#getSize(Point)}.</b> This method reports the window size including all system
@@ -133,7 +131,7 @@
/**
* Returns the {@link WindowInsets} of the area associated with this window or
- * {@link android.annotation.UiContext}.
+ * {@code UiContext}.
*
* @return the {@link WindowInsets} of the visual area.
*/
@@ -146,9 +144,8 @@
}
/**
- * Returns the density of the area associated with this window or
- * {@link android.annotation.UiContext}, which uses the same units as
- * {@link android.util.DisplayMetrics#density}.
+ * Returns the density of the area associated with this window or {@code UiContext},
+ * which uses the same units as {@link android.util.DisplayMetrics#density}.
*
* @see android.util.DisplayMetrics#DENSITY_DEFAULT
* @see android.util.DisplayMetrics#density
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
index e6a8b78..43bfe13 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
@@ -1562,9 +1562,8 @@
* describes the action.
* </p>
* <p>
- * Use {@link androidx.core.view.ViewCompat#addAccessibilityAction(View,
- * AccessibilityNodeInfoCompat.AccessibilityActionCompat)} to register an action directly on the
- * view.
+ * Use {@link androidx.core.view.ViewCompat#addAccessibilityAction(View, CharSequence,
+ * AccessibilityViewCommand)} to register an action directly on the view.
* <p>
* <strong>Note:</strong> Cannot be called from an
* {@link android.accessibilityservice.AccessibilityService}.
@@ -5167,8 +5166,7 @@
* </p>
* <aside class="note">
* <b>Note:</b> Use {@link androidx.core.view.ViewCompat#addAccessibilityAction(View,
- * AccessibilityNodeInfoCompat.AccessibilityActionCompat)} to register an action directly on the
- * view.
+ * CharSequence, AccessibilityViewCommand)} to register an action directly on the view.
* </p>
*/
public static final class AccessibilityAction implements Parcelable {
diff --git a/core/java/android/view/animation/AnimationUtils.java b/core/java/android/view/animation/AnimationUtils.java
index a76780d..32256b9 100644
--- a/core/java/android/view/animation/AnimationUtils.java
+++ b/core/java/android/view/animation/AnimationUtils.java
@@ -56,7 +56,7 @@
private static final int SEQUENTIALLY = 1;
/**
- * For apps targeting {@link Build.VERSION_CODES#VANILLA_ICE_CREAM} and above,
+ * For apps targeting {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM} and above,
* this change ID enables to use expectedPresentationTime instead of the frameTime
* for the frame start time .
*
diff --git a/core/java/android/view/contentcapture/ContentCaptureSession.java b/core/java/android/view/contentcapture/ContentCaptureSession.java
index dc3d323..bb815c0 100644
--- a/core/java/android/view/contentcapture/ContentCaptureSession.java
+++ b/core/java/android/view/contentcapture/ContentCaptureSession.java
@@ -183,7 +183,8 @@
public static final int FLUSH_REASON_VIEW_TREE_APPEARED = 10;
/**
- * After {@link UPSIDE_DOWN_CAKE}, {@link #notifyViewsDisappeared(AutofillId, long[])} wraps
+ * After {@link android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE},
+ * {@link #notifyViewsDisappeared(AutofillId, long[])} wraps
* the virtual children with a pair of view tree appearing and view tree appeared events.
*/
@ChangeId
diff --git a/core/java/android/view/displayhash/DisplayHashResultCallback.java b/core/java/android/view/displayhash/DisplayHashResultCallback.java
index 6e3d9a8..927874f 100644
--- a/core/java/android/view/displayhash/DisplayHashResultCallback.java
+++ b/core/java/android/view/displayhash/DisplayHashResultCallback.java
@@ -106,7 +106,7 @@
* {@link android.view.View#generateDisplayHash(String, Rect, Executor,
* DisplayHashResultCallback)} results in an error and cannot generate a display hash.
*
- * @param errorCode One of the values in {@link DisplayHashErrorCode}
+ * @param errorCode the error code
*/
void onDisplayHashError(@DisplayHashErrorCode int errorCode);
}
diff --git a/core/java/android/view/inputmethod/EditorInfo.java b/core/java/android/view/inputmethod/EditorInfo.java
index a92420a..c5114b9 100644
--- a/core/java/android/view/inputmethod/EditorInfo.java
+++ b/core/java/android/view/inputmethod/EditorInfo.java
@@ -47,7 +47,6 @@
import android.view.MotionEvent.ToolType;
import android.view.View;
import android.view.autofill.AutofillId;
-import android.widget.Editor;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.inputmethod.InputMethodDebug;
@@ -722,9 +721,9 @@
private boolean mIsStylusHandwritingEnabled;
/**
- * Set {@code true} if the {@link Editor} has
+ * Set {@code true} if the {@code Editor} has
* {@link InputMethodManager#startStylusHandwriting stylus handwriting} enabled.
- * {@code false} by default, {@link Editor} must set it {@code true} to indicate that
+ * {@code false} by default, {@code Editor} must set it {@code true} to indicate that
* it supports stylus handwriting.
*
* @param enabled {@code true} if stylus handwriting is enabled.
@@ -736,7 +735,7 @@
}
/**
- * Returns {@code true} when an {@link Editor} has stylus handwriting enabled.
+ * Returns {@code true} when an {@code Editor} has stylus handwriting enabled.
* {@code false} by default.
* @see #setStylusHandwritingEnabled(boolean)
* @see InputMethodManager#isStylusHandwritingAvailable()
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index 5bb1e93..8159af3 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -100,7 +100,6 @@
import android.view.WindowManager.LayoutParams.SoftInputModeFlags;
import android.view.autofill.AutofillId;
import android.view.autofill.AutofillManager;
-import android.widget.Editor;
import android.window.ImeOnBackInvokedDispatcher;
import android.window.WindowOnBackInvokedDispatcher;
@@ -2374,16 +2373,16 @@
* Prepares delegation of starting stylus handwriting session to a different editor in same
* or different window than the view on which initial handwriting stroke was detected.
*
- * Delegation can be used to start stylus handwriting session before the {@link Editor} view or
+ * Delegation can be used to start stylus handwriting session before the {@code Editor} view or
* its {@link InputConnection} is started. Calling this method starts buffering of stylus
* motion events until {@link #acceptStylusHandwritingDelegation(View)} is called, at which
* point the handwriting session can be started and the buffered stylus motion events will be
* delivered to the IME.
* e.g. Delegation can be used when initial handwriting stroke is
- * on a pseudo {@link Editor} like widget (with no {@link InputConnection}) but actual
- * {@link Editor} is on a different window.
+ * on a pseudo {@code Editor} like widget (with no {@link InputConnection}) but actual
+ * {@code Editor} is on a different window.
*
- * <p> Note: If an actual {@link Editor} capable of {@link InputConnection} is being scribbled
+ * <p> Note: If an actual {@code Editor} capable of {@link InputConnection} is being scribbled
* upon using stylus, use {@link #startStylusHandwriting(View)} instead.</p>
*
* @param delegatorView the view that receives initial stylus stroke and delegates it to the
@@ -2402,21 +2401,21 @@
* different window in a different package than the view on which initial handwriting stroke
* was detected.
*
- * Delegation can be used to start stylus handwriting session before the {@link Editor} view or
+ * Delegation can be used to start stylus handwriting session before the {@code Editor} view or
* its {@link InputConnection} is started. Calling this method starts buffering of stylus
* motion events until {@link #acceptStylusHandwritingDelegation(View, String)} is called, at
* which point the handwriting session can be started and the buffered stylus motion events will
* be delivered to the IME.
* e.g. Delegation can be used when initial handwriting stroke is
- * on a pseudo {@link Editor} like widget (with no {@link InputConnection}) but actual
- * {@link Editor} is on a different window in the given package.
+ * on a pseudo {@code Editor} like widget (with no {@link InputConnection}) but actual
+ * {@code Editor} is on a different window in the given package.
*
* <p>Note: If delegator and delegate are in same package use
* {@link #prepareStylusHandwritingDelegation(View)} instead.</p>
*
* @param delegatorView the view that receives initial stylus stroke and delegates it to the
* actual editor. Its window must {@link View#hasWindowFocus have focus}.
- * @param delegatePackageName package name that contains actual {@link Editor} which should
+ * @param delegatePackageName package name that contains actual {@code Editor} which should
* start stylus handwriting session by calling {@link #acceptStylusHandwritingDelegation}.
* @see #prepareStylusHandwritingDelegation(View)
* @see #acceptStylusHandwritingDelegation(View, String)
diff --git a/core/java/android/view/inspector/PropertyReader.java b/core/java/android/view/inspector/PropertyReader.java
index 5be0e3f..78de7e1 100644
--- a/core/java/android/view/inspector/PropertyReader.java
+++ b/core/java/android/view/inspector/PropertyReader.java
@@ -124,7 +124,7 @@
void readObject(int id, @Nullable Object value);
/**
- * Read a color packed into a {@link ColorInt} as a property.
+ * Read a color packed into an int as a property.
*
* @param id Identifier of the property from a {@link PropertyMapper}
* @param value Value of the property