Loading core/java/android/view/View.java +23 −4 Original line number Diff line number Diff line Loading @@ -8226,11 +8226,27 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ public void setAccessibilityPaneTitle(@Nullable CharSequence accessibilityPaneTitle) { if (!TextUtils.equals(accessibilityPaneTitle, mAccessibilityPaneTitle)) { boolean currentPaneTitleEmpty = mAccessibilityPaneTitle == null; boolean newPaneTitleEmpty = accessibilityPaneTitle == null; mAccessibilityPaneTitle = accessibilityPaneTitle; // Make explicitly important as nulled titles need to be important for DISAPPEARED // events. if (mAccessibilityPaneTitle != null && getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO) { setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES); } if (currentPaneTitleEmpty) { notifyViewAccessibilityStateChangedIfNeeded( AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_APPEARED); } else if (newPaneTitleEmpty) { notifyViewAccessibilityStateChangedIfNeeded( AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_DISAPPEARED); } else { notifyViewAccessibilityStateChangedIfNeeded( AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_TITLE); } } } /** * Get the title of the pane for purposes of accessibility. Loading Loading @@ -14168,9 +14184,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } // Changes to views with a pane title count as window state changes, as the pane title // marks them as significant parts of the UI. // marks them as significant parts of the UI. A visible view with a nulled title may send // a disappeared event. if ((changeType != AccessibilityEvent.CONTENT_CHANGE_TYPE_SUBTREE) && isAccessibilityPane()) { && (isAccessibilityPane() || (changeType == AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_DISAPPEARED) && isAggregatedVisible())) { // If the pane isn't visible, content changed events are sufficient unless we're // reporting that the view just disappeared if ((isAggregatedVisible()) core/java/android/view/accessibility/AccessibilityEvent.java +5 −0 Original line number Diff line number Diff line Loading @@ -592,6 +592,11 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par /** * Change type for {@link #TYPE_WINDOW_STATE_CHANGED} event: * The node's pane title changed. * <p> * If this makes the pane appear, {@link #CONTENT_CHANGE_TYPE_PANE_APPEARED} is sent * instead. If this makes the pane disappear, {@link #CONTENT_CHANGE_TYPE_PANE_DISAPPEARED} * is sent. * */ public static final int CONTENT_CHANGE_TYPE_PANE_TITLE = 0x00000008; Loading Loading
core/java/android/view/View.java +23 −4 Original line number Diff line number Diff line Loading @@ -8226,11 +8226,27 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ public void setAccessibilityPaneTitle(@Nullable CharSequence accessibilityPaneTitle) { if (!TextUtils.equals(accessibilityPaneTitle, mAccessibilityPaneTitle)) { boolean currentPaneTitleEmpty = mAccessibilityPaneTitle == null; boolean newPaneTitleEmpty = accessibilityPaneTitle == null; mAccessibilityPaneTitle = accessibilityPaneTitle; // Make explicitly important as nulled titles need to be important for DISAPPEARED // events. if (mAccessibilityPaneTitle != null && getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO) { setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES); } if (currentPaneTitleEmpty) { notifyViewAccessibilityStateChangedIfNeeded( AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_APPEARED); } else if (newPaneTitleEmpty) { notifyViewAccessibilityStateChangedIfNeeded( AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_DISAPPEARED); } else { notifyViewAccessibilityStateChangedIfNeeded( AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_TITLE); } } } /** * Get the title of the pane for purposes of accessibility. Loading Loading @@ -14168,9 +14184,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } // Changes to views with a pane title count as window state changes, as the pane title // marks them as significant parts of the UI. // marks them as significant parts of the UI. A visible view with a nulled title may send // a disappeared event. if ((changeType != AccessibilityEvent.CONTENT_CHANGE_TYPE_SUBTREE) && isAccessibilityPane()) { && (isAccessibilityPane() || (changeType == AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_DISAPPEARED) && isAggregatedVisible())) { // If the pane isn't visible, content changed events are sufficient unless we're // reporting that the view just disappeared if ((isAggregatedVisible())
core/java/android/view/accessibility/AccessibilityEvent.java +5 −0 Original line number Diff line number Diff line Loading @@ -592,6 +592,11 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par /** * Change type for {@link #TYPE_WINDOW_STATE_CHANGED} event: * The node's pane title changed. * <p> * If this makes the pane appear, {@link #CONTENT_CHANGE_TYPE_PANE_APPEARED} is sent * instead. If this makes the pane disappear, {@link #CONTENT_CHANGE_TYPE_PANE_DISAPPEARED} * is sent. * */ public static final int CONTENT_CHANGE_TYPE_PANE_TITLE = 0x00000008; Loading