Loading core/java/android/view/View.java +1 −0 Original line number Diff line number Diff line Loading @@ -15015,6 +15015,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } /** @hide */ @Nullable View getSelfOrParentImportantForA11y() { if (isImportantForAccessibility()) return this; ViewParent parent = getParentForAccessibility(); core/java/android/view/ViewRootImpl.java +33 −8 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ import static android.view.WindowManager.PROPERTY_COMPAT_ALLOW_SANDBOXING_VIEW_B import static android.view.WindowManagerGlobal.RELAYOUT_RES_CANCEL_AND_REDRAW; import static android.view.WindowManagerGlobal.RELAYOUT_RES_CONSUME_ALWAYS_SYSTEM_BARS; import static android.view.WindowManagerGlobal.RELAYOUT_RES_SURFACE_CHANGED; import static android.view.accessibility.Flags.fixMergedContentChangeEvent; import static android.view.accessibility.Flags.forceInvertColor; import static android.view.accessibility.Flags.reduceWindowContentChangedEventThrottle; import static android.view.inputmethod.InputMethodEditorTraceProto.InputMethodClientsTraceProto.ClientSideProto.IME_FOCUS_CONTROLLER; Loading Loading @@ -11509,6 +11510,15 @@ public final class ViewRootImpl implements ViewParent, event.setContentChangeTypes(mChangeTypes); if (mAction.isPresent()) event.setAction(mAction.getAsInt()); if (AccessibilityEvent.DEBUG_ORIGIN) event.originStackTrace = mOrigin; if (fixMergedContentChangeEvent()) { if ((mChangeTypes & AccessibilityEvent.CONTENT_CHANGE_TYPE_SUBTREE) != 0) { final View importantParent = source.getSelfOrParentImportantForA11y(); if (importantParent != null) { source = importantParent; } } } source.sendAccessibilityEventUnchecked(event); } else { mLastEventTimeMillis = 0; Loading Loading @@ -11543,6 +11553,20 @@ public final class ViewRootImpl implements ViewParent, } if (mSource != null) { if (fixMergedContentChangeEvent()) { View newSource = getCommonPredecessor(mSource, source); if (newSource == null) { // If there is no common predecessor, then mSource points to // a removed view, hence in this case always prefer the source. newSource = source; } mChangeTypes |= changeType; if (mSource != newSource) { mChangeTypes |= AccessibilityEvent.CONTENT_CHANGE_TYPE_SUBTREE; mSource = newSource; } } else { // If there is no common predecessor, then mSource points to // a removed view, hence in this case always prefer the source. View predecessor = getCommonPredecessor(mSource, source); Loading @@ -11551,6 +11575,7 @@ public final class ViewRootImpl implements ViewParent, } mSource = (predecessor != null) ? predecessor : source; mChangeTypes |= changeType; } final int performingAction = mAccessibilityManager.getPerformingAction(); if (performingAction != 0) { Loading core/java/android/view/accessibility/flags/accessibility_flags.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,13 @@ flag { bug: "280130713" } flag { namespace: "accessibility" name: "fix_merged_content_change_event" description: "Fixes event type and source of content change event merged in ViewRootImpl" bug: "277305460" } flag { namespace: "accessibility" name: "flash_notification_system_api" Loading Loading
core/java/android/view/View.java +1 −0 Original line number Diff line number Diff line Loading @@ -15015,6 +15015,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } /** @hide */ @Nullable View getSelfOrParentImportantForA11y() { if (isImportantForAccessibility()) return this; ViewParent parent = getParentForAccessibility();
core/java/android/view/ViewRootImpl.java +33 −8 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ import static android.view.WindowManager.PROPERTY_COMPAT_ALLOW_SANDBOXING_VIEW_B import static android.view.WindowManagerGlobal.RELAYOUT_RES_CANCEL_AND_REDRAW; import static android.view.WindowManagerGlobal.RELAYOUT_RES_CONSUME_ALWAYS_SYSTEM_BARS; import static android.view.WindowManagerGlobal.RELAYOUT_RES_SURFACE_CHANGED; import static android.view.accessibility.Flags.fixMergedContentChangeEvent; import static android.view.accessibility.Flags.forceInvertColor; import static android.view.accessibility.Flags.reduceWindowContentChangedEventThrottle; import static android.view.inputmethod.InputMethodEditorTraceProto.InputMethodClientsTraceProto.ClientSideProto.IME_FOCUS_CONTROLLER; Loading Loading @@ -11509,6 +11510,15 @@ public final class ViewRootImpl implements ViewParent, event.setContentChangeTypes(mChangeTypes); if (mAction.isPresent()) event.setAction(mAction.getAsInt()); if (AccessibilityEvent.DEBUG_ORIGIN) event.originStackTrace = mOrigin; if (fixMergedContentChangeEvent()) { if ((mChangeTypes & AccessibilityEvent.CONTENT_CHANGE_TYPE_SUBTREE) != 0) { final View importantParent = source.getSelfOrParentImportantForA11y(); if (importantParent != null) { source = importantParent; } } } source.sendAccessibilityEventUnchecked(event); } else { mLastEventTimeMillis = 0; Loading Loading @@ -11543,6 +11553,20 @@ public final class ViewRootImpl implements ViewParent, } if (mSource != null) { if (fixMergedContentChangeEvent()) { View newSource = getCommonPredecessor(mSource, source); if (newSource == null) { // If there is no common predecessor, then mSource points to // a removed view, hence in this case always prefer the source. newSource = source; } mChangeTypes |= changeType; if (mSource != newSource) { mChangeTypes |= AccessibilityEvent.CONTENT_CHANGE_TYPE_SUBTREE; mSource = newSource; } } else { // If there is no common predecessor, then mSource points to // a removed view, hence in this case always prefer the source. View predecessor = getCommonPredecessor(mSource, source); Loading @@ -11551,6 +11575,7 @@ public final class ViewRootImpl implements ViewParent, } mSource = (predecessor != null) ? predecessor : source; mChangeTypes |= changeType; } final int performingAction = mAccessibilityManager.getPerformingAction(); if (performingAction != 0) { Loading
core/java/android/view/accessibility/flags/accessibility_flags.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,13 @@ flag { bug: "280130713" } flag { namespace: "accessibility" name: "fix_merged_content_change_event" description: "Fixes event type and source of content change event merged in ViewRootImpl" bug: "277305460" } flag { namespace: "accessibility" name: "flash_notification_system_api" Loading