16179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov/*
26179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov * Copyright (C) 2011 The Android Open Source Project
36179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov *
46179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov * Licensed under the Apache License, Version 2.0 (the "License");
56179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov * you may not use this file except in compliance with the License.
66179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov * You may obtain a copy of the License at
76179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov *
86179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov *      http://www.apache.org/licenses/LICENSE-2.0
96179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov *
106179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov * Unless required by applicable law or agreed to in writing, software
116179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov * distributed under the License is distributed on an "AS IS" BASIS,
126179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
136179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov * See the License for the specific language governing permissions and
146179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov * limitations under the License.
156179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov */
166179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov
176179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganovpackage com.android.systemui.statusbar.tablet;
186179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov
196179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganovimport android.content.Context;
206179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganovimport android.util.AttributeSet;
216179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganovimport android.view.View;
226179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganovimport android.view.accessibility.AccessibilityEvent;
236179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganovimport android.widget.LinearLayout;
246179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov
256179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganovpublic class NotificationArea extends LinearLayout {
266179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov
276179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov    public NotificationArea(Context context, AttributeSet attrs) {
286179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov        super(context, attrs);
296179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov    }
306179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov
316179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov    @Override
326179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov    public boolean onRequestSendAccessibilityEvent(View child, AccessibilityEvent event) {
336179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov        if (super.onRequestSendAccessibilityEvent(child, event)) {
346179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov            // The event is coming from a descendant like battery but append
356179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov            // the content of the entire notification area so accessibility
366179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov            // services can choose how to present the content to the user.
376179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov            AccessibilityEvent record = AccessibilityEvent.obtain();
386179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov            onInitializeAccessibilityEvent(record);
396179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov            dispatchPopulateAccessibilityEvent(record);
406179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov            event.appendRecord(record);
416179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov            return true;
426179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov        }
436179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov        return false;
446179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov    }
456179ea3196e9306d3f14361fe9ef14191b1edba6Svetoslav Ganov}
46