Hiding DrawerLayout does not fire correct accessibility event.
While the drawer is a view we fake it as a window since it behaves as such.
When the drawer is closed it asks the content behind it to send an event as
if a window with that content is popping up. Unfortunately, this event is
not sent from the root view in the background view hierarchy resulting in
incorrect text content being added to the event. Asking the root of the
covered content to send the event results in getting the activity title/action
bar title (whichever is set) to be used as text in the event.
bug:12177380
Change-Id: I30b93d27d2ec763a3f64fe78a08c9b1ae0dd2b99
diff --git a/v4/java/android/support/v4/widget/DrawerLayout.java b/v4/java/android/support/v4/widget/DrawerLayout.java
index bc7321f..b11b070 100644
--- a/v4/java/android/support/v4/widget/DrawerLayout.java
+++ b/v4/java/android/support/v4/widget/DrawerLayout.java
@@ -476,7 +476,7 @@
if (mListener != null) {
mListener.onDrawerClosed(drawerView);
}
- sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
+ getRootView().sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
}
}