From 6783bef9b9b26df093b07b0044cf079a0b5011cd Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Mon, 22 Sep 2014 13:50:05 -0400 Subject: [PATCH] Fix accessibility announcement for QS details Rather than using announceForAccessibility, which will provide the wrong experience for Braille users, send a AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED. Bug: 17578404 Change-Id: I3e2c465511cf2135f216d01d29319a057ebbfbda --- packages/SystemUI/src/com/android/systemui/qs/QSPanel.java | 2 ++ .../android/systemui/statusbar/phone/StatusBarHeaderView.java | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java index 2fafb2c948bdc..fdebdd3b88284 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java @@ -30,6 +30,7 @@ import android.util.TypedValue; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.view.accessibility.AccessibilityEvent; import android.widget.ImageView; import android.widget.TextView; @@ -360,6 +361,7 @@ public class QSPanel extends ViewGroup { listener = mTeardownDetailWhenDone; fireScanStateChanged(false); } + sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); fireShowingDetail(show ? detailAdapter : null); mClipper.animateCircularClip(x, y, show, listener); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java index 072fb29430efe..cb9abfd9e5fe0 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java @@ -748,9 +748,7 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL transition(mQsDetailHeader, showingDetail); mShowingDetail = showingDetail; if (showingDetail) { - String title = mContext.getString(detail.getTitle()); - mQsDetailHeaderTitle.setText(title); - announceForAccessibility(title); + mQsDetailHeaderTitle.setText(detail.getTitle()); final Boolean toggleState = detail.getToggleState(); if (toggleState == null) { mQsDetailHeaderSwitch.setVisibility(INVISIBLE);