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

Commit 2f1ce123 authored by Sally Yuen's avatar Sally Yuen Committed by Android (Google) Code Review
Browse files

Merge "Add to AccessibilityEvent#TYPE_ANNOUNCEMENT with suggestion to avoid using it."

parents 6d44a9da 827ae4da
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -8457,6 +8457,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * accurately supplying the semantics of their UI.
     * They should not need to specify what exactly is announced to users.
     *
     * <p>
     * In general, only announce transitions and don’t generate a confirmation message for simple
     * actions like a button press. Label your controls concisely and precisely instead, and for
     * significant UI changes like window changes, use
     * {@link android.app.Activity#setTitle(CharSequence)} and
     * {@link View#setAccessibilityPaneTitle(CharSequence)}.
     *
     * <p>
     * Use {@link View#setAccessibilityLiveRegion(int)} to inform the user of changes to critical
     * views within the user interface. These should still be used sparingly as they may generate
     * announcements every time a View is updated.
     *
     * @param text The announcement text.
     */
    public void announceForAccessibility(CharSequence text) {
+4 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;

import com.android.internal.util.BitUtils;

@@ -519,6 +520,9 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par

    /**
     * Represents the event of an application making an announcement.
     * <p>
     * In general, follow the practices described in
     * {@link View#announceForAccessibility(CharSequence)}.
     */
    public static final int TYPE_ANNOUNCEMENT = 0x00004000;