Boolean NotificationArea::OnRequestSendAccessibilityEvent(
    /* [in] */ IView* child,
    /* [in] */ IAccessibilityEvent* event)
{
    if (LinearLayout::OnRequestSendAccessibilityEvent(child, event)) {
        // The event is coming from a descendant like battery but append
        // the content of the entire notification area so accessibility
        // services can choose how to present the content to the user.
        AutoPtr<IAccessibilityEventHelper> helper;
        CAccessibilityEventHelper::AcquireSingleton((IAccessibilityEventHelper**)&helper);
        AutoPtr<IAccessibilityEvent> record;
        helper->Obtain((IAccessibilityEvent**)&record);
        OnInitializeAccessibilityEvent(record);
        DispatchPopulateAccessibilityEvent(record);
        event->AppendRecord(record);
        return TRUE;
    }
    return FALSE;
}
Пример #2
0
ECode CPhoneStatusBarView::OnRequestSendAccessibilityEvent(
    /* [in] */ IView* child,
    /* [in] */ IAccessibilityEvent* event,
    /* [out] */ Boolean* result)
{
    VALIDATE_NOT_NULL(result);
    Boolean tmp = FALSE;
    if (PanelBar::OnRequestSendAccessibilityEvent(child, event, &tmp), tmp) {
        // The status bar is very small so augment the view that the user is touching
        // with the content of the status bar a whole. This way an accessibility service
        // may announce the current item as well as the entire content if appropriate.
        AutoPtr<IAccessibilityEvent> record;
        AutoPtr<IAccessibilityEventHelper> helper;
        CAccessibilityEventHelper::AcquireSingleton((IAccessibilityEventHelper**)&helper);
        helper->Obtain((IAccessibilityEvent**)&record);
        OnInitializeAccessibilityEvent(record);
        DispatchPopulateAccessibilityEvent(record, &tmp);
        event->AppendRecord(IAccessibilityRecord::Probe(record));
        *result = TRUE;
        return NOERROR;
    }
    *result = FALSE;
    return NOERROR;
}