Loading core/java/android/view/View.java +3 −3 Original line number Diff line number Diff line Loading @@ -14944,8 +14944,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, /** * Notifies that the accessibility state of this view changed. The change * is local to this view and does not represent structural changes such * as children and parent. For example, the view became focusable. The * notification is at at most once every * as children and parent. For example, the view became focusable. Some of * the notification is at at most once every * {@link ViewConfiguration#getSendRecurringAccessibilityEventsInterval()} * to avoid unnecessary load to the system. Also once a view has a pending * notification this method is a NOP until the notification has been sent. Loading Loading @@ -15007,7 +15007,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, /** * Notifies that the accessibility state of this view changed. The change * is *not* local to this view and does represent structural changes such * as children and parent. For example, the view size changed. The * as children and parent. For example, the view size changed. Some of the * notification is at at most once every * {@link ViewConfiguration#getSendRecurringAccessibilityEventsInterval()} * to avoid unnecessary load to the system. Also once a view has a pending core/java/android/view/ViewRootImpl.java +24 −2 Original line number Diff line number Diff line Loading @@ -218,7 +218,6 @@ import com.android.internal.os.IResultReceiver; import com.android.internal.os.SomeArgs; import com.android.internal.policy.DecorView; import com.android.internal.policy.PhoneFallbackEventHandler; import com.android.internal.util.Preconditions; import com.android.internal.view.BaseSurfaceHolder; import com.android.internal.view.RootViewSurfaceTaker; import com.android.internal.view.SurfaceCallbackHelper; Loading Loading @@ -808,6 +807,7 @@ public final class ViewRootImpl implements ViewParent, final HighContrastTextManager mHighContrastTextManager; SendWindowContentChangedAccessibilityEvent mSendWindowContentChangedAccessibilityEvent; boolean mSendingAccessibilityWIndowContentChange = false; HashSet<View> mTempHashSet; Loading Loading @@ -9867,7 +9867,29 @@ public final class ViewRootImpl implements ViewParent, @Override public void notifySubtreeAccessibilityStateChanged(View child, View source, int changeType) { postSendWindowContentChangedCallback(Preconditions.checkNotNull(source), changeType); Objects.requireNonNull(source); if (changeType == AccessibilityEvent.CONTENT_CHANGE_TYPE_SUBTREE) { postSendWindowContentChangedCallback(source, changeType); return; } if (mSendingAccessibilityWIndowContentChange) { // This allows re-entering this method. // Some apps update views during an event dispatch, which triggers another a11y event. // In order to avoid an infinite loop, postpone second event dispatch. mHandler.post(() -> notifySubtreeAccessibilityStateChanged(child, source, changeType)); return; } AccessibilityEvent event = new AccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); event.setContentChangeTypes(changeType); event.setAction(mAccessibilityManager.getPerformingAction()); mSendingAccessibilityWIndowContentChange = true; try { source.sendAccessibilityEventUnchecked(event); } finally { mSendingAccessibilityWIndowContentChange = false; } } @Override Loading Loading
core/java/android/view/View.java +3 −3 Original line number Diff line number Diff line Loading @@ -14944,8 +14944,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, /** * Notifies that the accessibility state of this view changed. The change * is local to this view and does not represent structural changes such * as children and parent. For example, the view became focusable. The * notification is at at most once every * as children and parent. For example, the view became focusable. Some of * the notification is at at most once every * {@link ViewConfiguration#getSendRecurringAccessibilityEventsInterval()} * to avoid unnecessary load to the system. Also once a view has a pending * notification this method is a NOP until the notification has been sent. Loading Loading @@ -15007,7 +15007,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, /** * Notifies that the accessibility state of this view changed. The change * is *not* local to this view and does represent structural changes such * as children and parent. For example, the view size changed. The * as children and parent. For example, the view size changed. Some of the * notification is at at most once every * {@link ViewConfiguration#getSendRecurringAccessibilityEventsInterval()} * to avoid unnecessary load to the system. Also once a view has a pending
core/java/android/view/ViewRootImpl.java +24 −2 Original line number Diff line number Diff line Loading @@ -218,7 +218,6 @@ import com.android.internal.os.IResultReceiver; import com.android.internal.os.SomeArgs; import com.android.internal.policy.DecorView; import com.android.internal.policy.PhoneFallbackEventHandler; import com.android.internal.util.Preconditions; import com.android.internal.view.BaseSurfaceHolder; import com.android.internal.view.RootViewSurfaceTaker; import com.android.internal.view.SurfaceCallbackHelper; Loading Loading @@ -808,6 +807,7 @@ public final class ViewRootImpl implements ViewParent, final HighContrastTextManager mHighContrastTextManager; SendWindowContentChangedAccessibilityEvent mSendWindowContentChangedAccessibilityEvent; boolean mSendingAccessibilityWIndowContentChange = false; HashSet<View> mTempHashSet; Loading Loading @@ -9867,7 +9867,29 @@ public final class ViewRootImpl implements ViewParent, @Override public void notifySubtreeAccessibilityStateChanged(View child, View source, int changeType) { postSendWindowContentChangedCallback(Preconditions.checkNotNull(source), changeType); Objects.requireNonNull(source); if (changeType == AccessibilityEvent.CONTENT_CHANGE_TYPE_SUBTREE) { postSendWindowContentChangedCallback(source, changeType); return; } if (mSendingAccessibilityWIndowContentChange) { // This allows re-entering this method. // Some apps update views during an event dispatch, which triggers another a11y event. // In order to avoid an infinite loop, postpone second event dispatch. mHandler.post(() -> notifySubtreeAccessibilityStateChanged(child, source, changeType)); return; } AccessibilityEvent event = new AccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); event.setContentChangeTypes(changeType); event.setAction(mAccessibilityManager.getPerformingAction()); mSendingAccessibilityWIndowContentChange = true; try { source.sendAccessibilityEventUnchecked(event); } finally { mSendingAccessibilityWIndowContentChange = false; } } @Override Loading