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

Commit 46bdc1eb authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android (Google) Code Review
Browse files

Merge "Added scroll and text selection change accessibility events."

parents aaad33e0 a0156177
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -22847,8 +22847,10 @@ package android.view.accessibility {
    field public static final int TYPE_VIEW_HOVER_ENTER = 128; // 0x80
    field public static final int TYPE_VIEW_HOVER_EXIT = 256; // 0x100
    field public static final int TYPE_VIEW_LONG_CLICKED = 2; // 0x2
    field public static final int TYPE_VIEW_SCROLLED = 4096; // 0x1000
    field public static final int TYPE_VIEW_SELECTED = 4; // 0x4
    field public static final int TYPE_VIEW_TEXT_CHANGED = 16; // 0x10
    field public static final int TYPE_VIEW_TEXT_SELECTION_CHANGED = 8192; // 0x2000
    field public static final int TYPE_WINDOW_CONTENT_CHANGED = 2048; // 0x800
    field public static final int TYPE_WINDOW_STATE_CHANGED = 32; // 0x20
  }
@@ -22897,6 +22899,7 @@ package android.view.accessibility {
    method public boolean isFocused();
    method public boolean isLongClickable();
    method public boolean isPassword();
    method public boolean isScrollable();
    method public boolean isSelected();
    method public static android.view.accessibility.AccessibilityNodeInfo obtain(android.view.View);
    method public static android.view.accessibility.AccessibilityNodeInfo obtain();
@@ -22916,6 +22919,7 @@ package android.view.accessibility {
    method public void setPackageName(java.lang.CharSequence);
    method public void setParent(android.view.View);
    method public void setPassword(boolean);
    method public void setScrollable(boolean);
    method public void setSelected(boolean);
    method public void setSource(android.view.View);
    method public void setText(java.lang.CharSequence);
@@ -22937,13 +22941,17 @@ package android.view.accessibility {
    method public int getItemCount();
    method public android.os.Parcelable getParcelableData();
    method public int getRemovedCount();
    method public int getScrollX();
    method public int getScrollY();
    method public android.view.accessibility.AccessibilityNodeInfo getSource();
    method public java.util.List<java.lang.CharSequence> getText();
    method public int getToIndex();
    method public int getWindowId();
    method public boolean isChecked();
    method public boolean isEnabled();
    method public boolean isFullScreen();
    method public boolean isPassword();
    method public boolean isScrollable();
    method public static android.view.accessibility.AccessibilityRecord obtain(android.view.accessibility.AccessibilityRecord);
    method public static android.view.accessibility.AccessibilityRecord obtain();
    method public void recycle();
@@ -22960,7 +22968,11 @@ package android.view.accessibility {
    method public void setParcelableData(android.os.Parcelable);
    method public void setPassword(boolean);
    method public void setRemovedCount(int);
    method public void setScrollX(int);
    method public void setScrollY(int);
    method public void setScrollable(boolean);
    method public void setSource(android.view.View);
    method public void setToIndex(int);
  }
}
+61 −7
Original line number Diff line number Diff line
@@ -2326,6 +2326,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
    private CheckForLongPress mPendingCheckForLongPress;
    private CheckForTap mPendingCheckForTap = null;
    private PerformClick mPerformClick;
    private SendViewScrolledAccessibilityEvent mSendViewScrolledAccessibilityEvent;

    private UnsetPressedState mUnsetPressedState;

@@ -3699,7 +3700,6 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
     * @see #dispatchPopulateAccessibilityEvent(AccessibilityEvent)
     */
    public void onPopulateAccessibilityEvent(AccessibilityEvent event) {

    }

    /**
@@ -3728,13 +3728,24 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
        event.setEnabled(isEnabled());
        event.setContentDescription(mContentDescription);

        if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_FOCUSED && mAttachInfo != null) {
        final int eventType = event.getEventType();
        switch (eventType) {
            case AccessibilityEvent.TYPE_VIEW_FOCUSED: {
                if (mAttachInfo != null) {
                    ArrayList<View> focusablesTempList = mAttachInfo.mFocusablesTempList;
            getRootView().addFocusables(focusablesTempList, View.FOCUS_FORWARD, FOCUSABLES_ALL);
                    getRootView().addFocusables(focusablesTempList, View.FOCUS_FORWARD,
                            FOCUSABLES_ALL);
                    event.setItemCount(focusablesTempList.size());
                    event.setCurrentItemIndex(focusablesTempList.indexOf(this));
                    focusablesTempList.clear();
                }
            } break;
            case AccessibilityEvent.TYPE_VIEW_SCROLLED: {
                event.setScrollX(mScrollX);
                event.setScrollY(mScrollY);
                event.setItemCount(getHeight());
            } break;
        }
    }

    /**
@@ -6164,6 +6175,16 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
        removeTapCallback();
    }

    /**
     * Remove the pending callback for sending a
     * {@link AccessibilityEvent#TYPE_VIEW_SCROLLED} accessibility event.
     */
    private void removeSendViewScrolledAccessibilityEventCallback() {
        if (mSendViewScrolledAccessibilityEvent != null) {
            removeCallbacks(mSendViewScrolledAccessibilityEvent);
        }
    }

    /**
     * Sets the TouchDelegate for this View.
     */
@@ -6337,6 +6358,10 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
     * @param oldt Previous vertical scroll origin.
     */
    protected void onScrollChanged(int l, int t, int oldl, int oldt) {
        if (AccessibilityManager.getInstance(mContext).isEnabled()) {
            postSendViewScrolledAccessibilityEventCallback();
        }

        mBackgroundSizeChanged = true;

        final AttachInfo ai = mAttachInfo;
@@ -8262,6 +8287,22 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
        }
    }

    /**
     * Post a callback to send a {@link AccessibilityEvent#TYPE_VIEW_SCROLLED} event.
     * This event is sent at most once every
     * {@link ViewConfiguration#getSendRecurringAccessibilityEventsInterval()}.
     */
    private void postSendViewScrolledAccessibilityEventCallback() {
        if (mSendViewScrolledAccessibilityEvent == null) {
            mSendViewScrolledAccessibilityEvent = new SendViewScrolledAccessibilityEvent();
        }
        if (!mSendViewScrolledAccessibilityEvent.mIsPending) {
            mSendViewScrolledAccessibilityEvent.mIsPending = true;
            postDelayed(mSendViewScrolledAccessibilityEvent,
                    ViewConfiguration.getSendRecurringAccessibilityEventsInterval());
        }
    }

    /**
     * Called by a parent to request that a child update its values for mScrollX
     * and mScrollY if necessary. This will typically be done if the child is
@@ -9019,6 +9060,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
        removeUnsetPressCallback();
        removeLongPressCallback();
        removePerformClickCallback();
        removeSendViewScrolledAccessibilityEventCallback();

        destroyDrawingCache();

@@ -13820,6 +13862,18 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
                host.invalidate(true);
            }
        }
    }

    /**
     * Resuable callback for sending
     * {@link AccessibilityEvent#TYPE_VIEW_SCROLLED} accessibility event.
     */
    private class SendViewScrolledAccessibilityEvent implements Runnable {
        public volatile boolean mIsPending;

        public void run() {
            sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SCROLLED);
            mIsPending = false;
        }
    }
}
+24 −17
Original line number Diff line number Diff line
@@ -136,13 +136,6 @@ public final class ViewAncestor extends Handler implements ViewParent,
    static final ArrayList<ComponentCallbacks> sConfigCallbacks
            = new ArrayList<ComponentCallbacks>();

    /**
     * Delay before dispatching an accessibility event that the window
     * content has changed. The window content is considered changed
     * after a layout pass.
     */
    private static final long SEND_WINDOW_CONTENT_CHANGED_DELAY_MILLIS = 500;

    long mLastTrackballTime = 0;
    final TrackballAxis mTrackballAxisX = new TrackballAxis();
    final TrackballAxis mTrackballAxisY = new TrackballAxis();
@@ -284,7 +277,7 @@ public final class ViewAncestor extends Handler implements ViewParent,

    AccessibilityInteractionConnectionManager mAccessibilityInteractionConnectionManager;

    SendWindowContentChanged mSendWindowContentChanged;
    SendWindowContentChangedAccessibilityEvent mSendWindowContentChangedAccessibilityEvent;

    private final int mDensity;

@@ -3692,14 +3685,19 @@ public final class ViewAncestor extends Handler implements ViewParent,
    /**
     * Post a callback to send a
     * {@link AccessibilityEvent#TYPE_WINDOW_CONTENT_CHANGED} event.
     * This event is send at most once every
     * {@link ViewConfiguration#getSendRecurringAccessibilityEventsInterval()}.
     */
    private void postSendWindowContentChangedCallback() {
        if (mSendWindowContentChanged == null) {
            mSendWindowContentChanged = new SendWindowContentChanged();
        } else {
            removeCallbacks(mSendWindowContentChanged);
        if (mSendWindowContentChangedAccessibilityEvent == null) {
            mSendWindowContentChangedAccessibilityEvent =
                new SendWindowContentChangedAccessibilityEvent();
        }
        if (!mSendWindowContentChangedAccessibilityEvent.mIsPending) {
            mSendWindowContentChangedAccessibilityEvent.mIsPending = true;
            postDelayed(mSendWindowContentChangedAccessibilityEvent,
                    ViewConfiguration.getSendRecurringAccessibilityEventsInterval());
        }
        postDelayed(mSendWindowContentChanged, SEND_WINDOW_CONTENT_CHANGED_DELAY_MILLIS);
    }

    /**
@@ -3707,8 +3705,8 @@ public final class ViewAncestor extends Handler implements ViewParent,
     * {@link AccessibilityEvent#TYPE_WINDOW_CONTENT_CHANGED} event.
     */
    private void removeSendWindowContentChangedCallback() {
        if (mSendWindowContentChanged != null) {
            removeCallbacks(mSendWindowContentChanged);
        if (mSendWindowContentChangedAccessibilityEvent != null) {
            removeCallbacks(mSendWindowContentChangedAccessibilityEvent);
        }
    }

@@ -4634,10 +4632,19 @@ public final class ViewAncestor extends Handler implements ViewParent,
        }
    }

    private class SendWindowContentChanged implements Runnable {
    private class SendWindowContentChangedAccessibilityEvent implements Runnable {
        public volatile boolean mIsPending;

        public void run() {
            if (mView != null) {
                mView.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
                // Send the event directly since we do not want to append the
                // source text because this is the text for the entire window
                // and we just want to notify that the content has changed.
                AccessibilityEvent event = AccessibilityEvent.obtain(
                        AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
                mView.onInitializeAccessibilityEvent(event);
                AccessibilityManager.getInstance(mView.mContext).sendAccessibilityEvent(event);
                mIsPending = false;
            }
        }
    }
+21 −0
Original line number Diff line number Diff line
@@ -175,6 +175,14 @@ public class ViewConfiguration {
     */
    private static final int TOUCH_EXPLORATION_TAP_SLOP = 80;

    /**
     * Delay before dispatching a recurring accessibility event in milliseconds.
     * This delay guarantees that a recurring event will be send at most once
     * during the {@link #SEND_RECURRING_ACCESSIBILITY_EVENTS_INTERVAL_MILLIS} time
     * frame.
     */
    private static final long SEND_RECURRING_ACCESSIBILITY_EVENTS_INTERVAL_MILLIS = 400;

    /**
     * The maximum size of View's drawing cache, expressed in bytes. This size
     * should be at least equal to the size of the screen in ARGB888 format.
@@ -497,6 +505,19 @@ public class ViewConfiguration {
        return mScaledTouchExplorationTapSlop;
    }

    /**
     * Interval for dispatching a recurring accessibility event in milliseconds.
     * This interval guarantees that a recurring event will be send at most once
     * during the {@link #getSendRecurringAccessibilityEventsInterval()} time frame.
     *
     * @return The delay in milliseconds.
     *
     * @hide
     */
    public static long getSendRecurringAccessibilityEventsInterval() {
        return SEND_RECURRING_ACCESSIBILITY_EVENTS_INTERVAL_MILLIS;
    }

    /**
     * @return Distance a touch must be outside the bounds of a window for it
     * to be counted as outside the window for purposes of dismissing that
+157 −70
Original line number Diff line number Diff line
@@ -56,76 +56,132 @@ import java.util.List;
 * <b>View clicked</b> - represents the event of clicking on a {@link android.view.View}
 * like {@link android.widget.Button}, {@link android.widget.CompoundButton}, etc. <br>
 * Type:{@link #TYPE_VIEW_CLICKED} <br>
 * Properties:
 * {@link #getClassName()},
 * {@link #getPackageName()},
 * {@link #getEventTime()},
 * {@link #getText()},
 * {@link #isChecked()},
 * {@link #isEnabled()},
 * {@link #isPassword()},
 * {@link #getItemCount()},
 * {@link #getCurrentItemIndex()}
 * Properties:</br>
 * <ul>
 *   <li>{@link #getSource()} - The source info (for registered clients).</li> *
 *   <li>{@link #getClassName()} - The class name of the source.</li>
 *   <li>{@link #getPackageName()} - The package name of the source.</li>
 *   <li>{@link #getEventTime()}  - The event time.</li>
 *   <li>{@link #getText()} - The text of the source.</li>
 *   <li>{@link #isEnabled()} - Whether the source is enabled.</li>
 *   <li>{@link #isPassword()} - Whether the source is password.</li>
 *   <li>{@link #isChecked()} - Whether the source is checked.</li>
 * </ul>
 * <p>
 * <b>View long clicked</b> - represents the event of long clicking on a {@link android.view.View}
 * like {@link android.widget.Button}, {@link android.widget.CompoundButton}, etc. <br>
 * Type:{@link #TYPE_VIEW_LONG_CLICKED} <br>
 * Properties:
 * {@link #getClassName()},
 * {@link #getPackageName()},
 * {@link #getEventTime()},
 * {@link #getText()},
 * {@link #isChecked()},
 * {@link #isEnabled()},
 * {@link #isPassword()},
 * {@link #getItemCount()},
 * {@link #getCurrentItemIndex()}
 * Properties:</br>
 * <ul>
 *   <li>{@link #getSource()} - The source info (for registered clients).</li> *
 *   <li>{@link #getClassName()} - The class name of the source.</li>
 *   <li>{@link #getPackageName()} - The package name of the source.</li>
 *   <li>{@link #getEventTime()}  - The event time.</li>
 *   <li>{@link #getText()} - The text of the source.</li>
 *   <li>{@link #isEnabled()} - Whether the source is enabled.</li>
 *   <li>{@link #isPassword()} - Whether the source is password.</li>
 *   <li>{@link #isChecked()} - Whether the source is checked.</li>
 * </ul>
 * <p>
 * <b>View selected</b> - represents the event of selecting an item usually in
 * the context of an {@link android.widget.AdapterView}. <br>
 * Type: {@link #TYPE_VIEW_SELECTED} <br>
 * Properties:
 * {@link #getClassName()},
 * {@link #getPackageName()},
 * {@link #getEventTime()},
 * {@link #getText()},
 * {@link #isChecked()},
 * {@link #isEnabled()},
 * {@link #isPassword()},
 * {@link #getItemCount()},
 * {@link #getCurrentItemIndex()}
 * Properties:</br>
 * <ul>
 *   <li>{@link #getSource()} - The source info (for registered clients).</li> *
 *   <li>{@link #getClassName()} - The class name of the source.</li>
 *   <li>{@link #getPackageName()} - The package name of the source.</li>
 *   <li>{@link #getEventTime()}  - The event time.</li>
 *   <li>{@link #getText()} - The text of the source.</li>
 *   <li>{@link #isEnabled()} - Whether the source is enabled.</li>
 *   <li>{@link #isPassword()} - Whether the source is password.</li>
 *   <li>{@link #isChecked()} - Whether the source is checked.</li>
 *   <li>{@link #getItemCount()} -The number of selectable items of the source.</li>
 *   <li>{@link #getCurrentItemIndex()} - The currently selected item index.</li>
 * </ul>
 * <p>
 * <p>
 * <b>View focused</b> - represents the event of focusing a
 * {@link android.view.View}. <br>
 * Type: {@link #TYPE_VIEW_FOCUSED} <br>
 * Properties:
 * {@link #getClassName()},
 * {@link #getPackageName()},
 * {@link #getEventTime()},
 * {@link #getText()},
 * {@link #isChecked()},
 * {@link #isEnabled()},
 * {@link #isPassword()},
 * {@link #getItemCount()},
 * {@link #getCurrentItemIndex()}
 * Properties:</br>
 * <ul>
 *   <li>{@link #getSource()} - The source info (for registered clients).</li> *
 *   <li>{@link #getClassName()} - The class name of the source.</li>
 *   <li>{@link #getPackageName()} - The package name of the source.</li>
 *   <li>{@link #getEventTime()}  - The event time.</li>
 *   <li>{@link #getText()} - The text of the source.</li>
 *   <li>{@link #isEnabled()} - Whether the source is enabled.</li>
 *   <li>{@link #isPassword()} - Whether the source is password.</li>
 *   <li>{@link #isChecked()} - Whether the source is checked.</li>
 *   <li>{@link #getItemCount()} -The number of focusable items on the screen.</li>
 *   <li>{@link #getCurrentItemIndex()} - The currently focused item index.</li>
 * </ul>
 * <p>
 * <b>View text changed</b> - represents the event of changing the text of an
 * {@link android.widget.EditText}. <br>
 * Type: {@link #TYPE_VIEW_TEXT_CHANGED} <br>
 * Properties:
 * {@link #getClassName()},
 * {@link #getPackageName()},
 * {@link #getEventTime()},
 * {@link #getText()},
 * {@link #isChecked()},
 * {@link #isEnabled()},
 * {@link #isPassword()},
 * {@link #getItemCount()},
 * {@link #getCurrentItemIndex()},
 * {@link #getFromIndex()},
 * {@link #getAddedCount()},
 * {@link #getRemovedCount()},
 * {@link #getBeforeText()}
 * Properties:</br>
 * <ul>
 *   <li>{@link #getSource()} - The source info (for registered clients).</li> *
 *   <li>{@link #getClassName()} - The class name of the source.</li>
 *   <li>{@link #getPackageName()} - The package name of the source.</li>
 *   <li>{@link #getEventTime()}  - The event time.</li>
 *   <li>{@link #getText()} - The text of the source.</li>
 *   <li>{@link #isEnabled()} - Whether the source is enabled.</li>
 *   <li>{@link #isPassword()} - Whether the source is password.</li>
 *   <li>{@link #isChecked()} - Whether the source is checked.</li>
 *   <li>{@link #getFromIndex()} - The text change start index.</li>
 *   <li>{@link #getAddedCount()} - The number of added characters.</li>
 *   <li>{@link #getRemovedCount()} - The number of removed characters.</li>
 *   <li>{@link #getBeforeText()} - The text of the source before the change.</li>
 * </ul>
 * <p>
 * <b>View text selection changed</b> - represents the event of changing the text
 * selection of an {@link android.widget.EditText}.<br>
 * Type: {@link #TYPE_VIEW_TEXT_SELECTION_CHANGED} <br>
 * Properties:</br>
 * <ul>
 *   <li>{@link #getSource()} - The source info (for registered clients).</li> *
 *   <li>{@link #getClassName()} - The class name of the source.</li>
 *   <li>{@link #getPackageName()} - The package name of the source.</li>
 *   <li>{@link #getEventTime()}  - The event time.</li>
 *   <li>{@link #getText()} - The text of the source.</li>
 *   <li>{@link #isEnabled()} - Whether the source is enabled.</li>
 *   <li>{@link #isPassword()} - Whether the source is password.</li>
 *   <li>{@link #getFromIndex()} - The selection start index.</li>
 *   <li>{@link #getToIndex()} - The selection end index.</li>
 *   <li>{@link #getItemCount()} - The length of the source text.</li>
 * <ul>
 * <p>
 * <b>View scrolled</b> - represents the event of scrolling a view. If
 * the source is a descendant of {@link android.widget.AdapterView} the
 * scroll is reported in terms of visible items - the first visible item,
 * the last visible item, and the total items - because the the source
 * is unaware if its pixel size since its adapter is responsible for
 * creating views. In all other cases the scroll is reported as the current
 * scroll on the X and Y axis respectively plus the height of the source in
 * pixels.<br>
 * Type: {@link #TYPE_VIEW_SCROLLED} <br>
 * Properties:</br>
 * <ul>
 *   <li>{@link #getSource()} - The source info (for registered clients).</li> *
 *   <li>{@link #getClassName()} - The class name of the source.</li>
 *   <li>{@link #getPackageName()} - The package name of the source.</li>
 *   <li>{@link #getEventTime()}  - The event time.</li>
 *   <li>{@link #getText()} - The text of the source.</li>
 *   <li>{@link #isEnabled()} - Whether the source is enabled.</li>
 *   <li>{@link #getScrollX())} - The horizontal offset of the source
 *                                (without descendants of AdapterView)).</li>
 *   <li>{@link #getScrollY())} - The vertical offset of the source
 *                                (without descendants of AdapterView)).</li>
 *   <li>{@link #getFromIndex()} - The index of the first visible item of the source
 *                                 (for descendants of AdapterView).</li>
 *   <li>{@link #getToIndex()} - The index of the last visible item of the source
 *                               (for descendants of AdapterView).</li>
 *   <li>{@link #getItemCount()} - The total items of the source (for descendants of AdapterView)
 *                                 or the height of the source in pixels (all other cases).</li>
 * <ul>
 * <p>
 * <b>TRANSITION TYPES</b> <br>
 * <p>
@@ -133,33 +189,40 @@ import java.util.List;
 * {@link android.widget.PopupWindow}, {@link android.view.Menu},
 * {@link android.app.Dialog}, etc. <br>
 * Type: {@link #TYPE_WINDOW_STATE_CHANGED} <br>
 * Properties:
 * {@link #getClassName()},
 * {@link #getPackageName()},
 * {@link #getEventTime()},
 * {@link #getText()}
 * Properties:</br>
 * <ul>
 *   <li>{@link #getSource()} - The source info (for registered clients).</li> *
 *   <li>{@link #getClassName()} - The class name of the source.</li>
 *   <li>{@link #getPackageName()} - The package name of the source.</li>
 *   <li>{@link #getEventTime()}  - The event time.</li>
 *   <li>{@link #getText()} - The text of the source.</li>
 * </ul>
 * <p>
 * <b>Window content changed</b> - represents the event of change in the
 * content of a window. This change can be adding/removing view, changing
 * a view size, etc.<br>
 * Type: {@link #TYPE_WINDOW_CONTENT_CHANGED} <br>
 * Properties:
 * {@link #getClassName()},
 * {@link #getPackageName()},
 * {@link #getEventTime()},
 * {@link #getText()}
 * Properties:</br>
 * <ul>
 *   <li>{@link #getSource()} - The source info (for registered clients).</li> *
 *   <li>{@link #getClassName()} - The class name of the source.</li>
 *   <li>{@link #getPackageName()} - The package name of the source.</li>
 *   <li>{@link #getEventTime()}  - The event time.</li>
 * <ul>
 * <p>
 * <b>NOTIFICATION TYPES</b> <br>
 * <p>
 * <b>Notification state changed</b> - represents the event showing/hiding
 * {@link android.app.Notification}.
 * Type: {@link #TYPE_NOTIFICATION_STATE_CHANGED} <br>
 * Properties:
 * {@link #getClassName()},
 * {@link #getPackageName()},
 * {@link #getEventTime()},
 * {@link #getText()}
 * {@link #getParcelableData()}
 * Properties:</br>
 * <ul>
 *   <li>{@link #getClassName()} - The class name of the source.</li>
 *   <li>{@link #getPackageName()} - The package name of the source.</li>
 *   <li>{@link #getEventTime()}  - The event time.</li>
 *   <li>{@link #getText()} - The text of the source.</li>
 *   <li>{@link #getParcelableData()} - The posted {@link android.app.Notification}.</li>
 * </ul>
 * <p>
 * <b>Security note</b>
 * <p>
@@ -257,6 +320,16 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
     */
    public static final int TYPE_WINDOW_CONTENT_CHANGED = 0x00000800;

    /**
     * Represents the event of scrolling a view.
     */
    public static final int TYPE_VIEW_SCROLLED = 0x00001000;

    /**
     * Represents the event of changing the selection in an {@link android.widget.EditText}.
     */
    public static final int TYPE_VIEW_TEXT_SELECTION_CHANGED = 0x00002000;

    /**
     * Mask for {@link AccessibilityEvent} all types.
     *
@@ -564,6 +637,9 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
        record.mCurrentItemIndex = parcel.readInt();
        record.mItemCount = parcel.readInt();
        record.mFromIndex = parcel.readInt();
        record.mToIndex = parcel.readInt();
        record.mScrollX = parcel.readInt();
        record.mScrollY =  parcel.readInt();
        record.mAddedCount = parcel.readInt();
        record.mRemovedCount = parcel.readInt();
        record.mClassName = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
@@ -613,6 +689,9 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
        parcel.writeInt(record.mCurrentItemIndex);
        parcel.writeInt(record.mItemCount);
        parcel.writeInt(record.mFromIndex);
        parcel.writeInt(record.mToIndex);
        parcel.writeInt(record.mScrollX);
        parcel.writeInt(record.mScrollY);
        parcel.writeInt(record.mAddedCount);
        parcel.writeInt(record.mRemovedCount);
        TextUtils.writeToParcel(record.mClassName, parcel, flags);
@@ -657,8 +736,12 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
                builder.append("; IsPassword: " + record.isPassword());
                builder.append("; IsChecked: " + record.isChecked());
                builder.append("; IsFullScreen: " + record.isFullScreen());
                builder.append("; Scrollable: " + record.isScrollable());
                builder.append("; BeforeText: " + record.mBeforeText);
                builder.append("; FromIndex: " + record.mFromIndex);
                builder.append("; ToIndex: " + record.mToIndex);
                builder.append("; ScrollX: " + record.mScrollX);
                builder.append("; ScrollY: " + record.mScrollY);
                builder.append("; AddedCount: " + record.mAddedCount);
                builder.append("; RemovedCount: " + record.mRemovedCount);
                builder.append("; ParcelableData: " + record.mParcelableData);
@@ -704,6 +787,10 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
                return "TYPE_TOUCH_EXPLORATION_GESTURE_END";
            case TYPE_WINDOW_CONTENT_CHANGED:
                return "TYPE_WINDOW_CONTENT_CHANGED";
            case TYPE_VIEW_TEXT_SELECTION_CHANGED:
                return "TYPE_VIEW_TEXT_SELECTION_CHANGED";
            case TYPE_VIEW_SCROLLED:
                return "TYPE_VIEW_SCROLLED";
            default:
                return null;
        }
Loading