Merge "Lockscreen widgets not always announced." into jb-mr2-dev

This commit is contained in:
Svetoslav
2013-04-25 21:49:00 +00:00
committed by Android (Google) Code Review
2 changed files with 4 additions and 6 deletions

View File

@@ -6617,12 +6617,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @hide
*/
public void clearAccessibilityFocus() {
if ((mPrivateFlags2 & PFLAG2_ACCESSIBILITY_FOCUSED) != 0) {
mPrivateFlags2 &= ~PFLAG2_ACCESSIBILITY_FOCUSED;
invalidate();
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED);
notifyAccessibilityStateChanged();
}
clearAccessibilityFocusNoCallbacks();
// Clear the global reference of accessibility focus if this
// view or any of its descendants had accessibility focus.
ViewRootImpl viewRootImpl = getViewRootImpl();
@@ -6669,6 +6664,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
if ((mPrivateFlags2 & PFLAG2_ACCESSIBILITY_FOCUSED) != 0) {
mPrivateFlags2 &= ~PFLAG2_ACCESSIBILITY_FOCUSED;
invalidate();
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED);
notifyAccessibilityStateChanged();
}
}

View File

@@ -169,6 +169,7 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit
KeyguardWidgetFrame newWidgetPage = getWidgetPageAt(newPageIndex);
if (newWidgetPage != null) {
newWidgetPage.onActive(true);
newWidgetPage.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
newWidgetPage.requestAccessibilityFocus();
}
if (mParent != null && AccessibilityManager.getInstance(mContext).isEnabled()) {