Stop double notifying a11y about Toasts.

am: 532c7999c5

Change-Id: If8d025884b8a941386cd472403c1c93fee5a70af
This commit is contained in:
Phil Weaver
2016-09-06 16:40:15 +00:00
committed by android-build-merger

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;