Merge "Stop double notifying a11y about Toasts." into nyc-mr1-dev

This commit is contained in:
Phil Weaver
2016-09-06 16:33:39 +00:00
committed by Android (Google) Code Review

View File

@@ -2167,7 +2167,12 @@ public final class ViewRootImpl implements ViewParent,
}
if (changedVisibility || regainedFocus) {
host.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
// Toasts are presented as notifications - don't present them as windows as well
boolean isToast = (mWindowAttributes == null) ? false
: (mWindowAttributes.type == WindowManager.LayoutParams.TYPE_TOAST);
if (!isToast) {
host.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
}
}
mFirst = false;