Stop double notifying a11y about Toasts. am: 532c7999c5

am: de13bcf08b

Change-Id: Ie3ed51a4fe4c6c818bc96e98c214ec7b610f507d
This commit is contained in:
Phil Weaver
2016-09-06 16:46:46 +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;