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

Commit d666953f authored by Phil Weaver's avatar Phil Weaver
Browse files

Clarify extra data argument nullness.

Bug: 35098706
Test: Trivial change, so I just verified that it builds.
Change-Id: I234afe4f1e52ef1c4c64e44b486a539f0d46854c
parent dc8912b2
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -7390,16 +7390,19 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * This method only needs overloading if the node is marked as having extra data available.
     * </p>
     *
     * @param info The info to which to add the extra data
     * @param info The info to which to add the extra data. Never {@code null}.
     * @param extraDataKey A key specifying the type of extra data to add to the info. The
     *                     extra data should be added to the {@link Bundle} returned by
     *                     the info's {@link AccessibilityNodeInfo#getExtras} method.
     * @param arguments A {@link Bundle} holding any arguments relevant for this request.
     *                     the info's {@link AccessibilityNodeInfo#getExtras} method. Never
     *                     {@code null}.
     * @param arguments A {@link Bundle} holding any arguments relevant for this request. May be
     *                  {@code null} if the service provided no arguments.
     *
     * @see AccessibilityNodeInfo#setExtraAvailableData
     */
    public void addExtraDataToAccessibilityNodeInfo(
            AccessibilityNodeInfo info, String extraDataKey, Bundle arguments) {
            @NonNull AccessibilityNodeInfo info, @NonNull String extraDataKey,
            @Nullable Bundle arguments) {
    }
    /**
@@ -24415,17 +24418,20 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
         * the case where no accessibility delegate is set.
         * </p>
         *
         * @param host The View hosting the delegate.
         * @param info The info to which to add the extra data
         * @param host The View hosting the delegate. Never {@code null}.
         * @param info The info to which to add the extra data. Never {@code null}.
         * @param extraDataKey A key specifying the type of extra data to add to the info. The
         *                     extra data should be added to the {@link Bundle} returned by
         *                     the info's {@link AccessibilityNodeInfo#getExtras} method.
         *                     the info's {@link AccessibilityNodeInfo#getExtras} method.  Never
         *                     {@code null}.
         * @param arguments A {@link Bundle} holding any arguments relevant for this request.
         *                  May be {@code null} if the if the service provided no arguments.
         *
         * @see AccessibilityNodeInfo#setExtraAvailableData
         */
        public void addExtraDataToAccessibilityNodeInfo(
                View host, AccessibilityNodeInfo info, String extraDataKey, Bundle arguments) {
        public void addExtraDataToAccessibilityNodeInfo(@NonNull View host,
                @NonNull AccessibilityNodeInfo info, @NonNull String extraDataKey,
                @Nullable Bundle arguments) {
            host.addExtraDataToAccessibilityNodeInfo(info, extraDataKey, arguments);
        }
+4 −0
Original line number Diff line number Diff line
@@ -10066,6 +10066,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    @Override
    public void addExtraDataToAccessibilityNodeInfo(
            AccessibilityNodeInfo info, String extraDataKey, Bundle arguments) {
        // The only extra data we support requires arguments.
        if (arguments == null) {
            return;
        }
        if (extraDataKey.equals(EXTRA_DATA_TEXT_CHARACTER_LOCATION_KEY)) {
            int positionInfoStartIndex = arguments.getInt(
                    EXTRA_DATA_TEXT_CHARACTER_LOCATION_ARG_START_INDEX, -1);