@@ -173,6 +173,22 @@ public void sendAccessibilityEvent(int eventType) {
173173 }
174174 }
175175
176+ private void updateWidgetFramesImportantForAccessibility () {
177+ final int pageCount = getPageCount ();
178+ for (int i = 0 ; i < pageCount ; i ++) {
179+ KeyguardWidgetFrame frame = getWidgetPageAt (i );
180+ updateWidgetFrameImportantForAccessibility (frame );
181+ }
182+ }
183+
184+ private void updateWidgetFrameImportantForAccessibility (KeyguardWidgetFrame frame ) {
185+ if (frame .getContentAlpha () <= 0 ) {
186+ frame .setImportantForAccessibility (View .IMPORTANT_FOR_ACCESSIBILITY_NO );
187+ } else {
188+ frame .setImportantForAccessibility (View .IMPORTANT_FOR_ACCESSIBILITY_YES );
189+ }
190+ }
191+
176192 private void userActivity () {
177193 if (mCallbacks != null ) {
178194 mCallbacks .onUserActivityTimeoutChanged ();
@@ -305,6 +321,7 @@ public void addWidget(View widget, int pageIndex) {
305321 content .getContentDescription ());
306322 frame .setContentDescription (contentDescription );
307323 }
324+ updateWidgetFrameImportantForAccessibility (frame );
308325 }
309326
310327 /**
@@ -547,6 +564,12 @@ public void showSidePageHints() {
547564 animateOutlinesAndSidePages (true , -1 );
548565 }
549566
567+ @ Override
568+ void setCurrentPage (int currentPage ) {
569+ super .setCurrentPage (currentPage );
570+ updateWidgetFramesImportantForAccessibility ();
571+ }
572+
550573 @ Override
551574 public void onAttachedToWindow () {
552575 super .onAttachedToWindow ();
@@ -658,6 +681,7 @@ public void onAnimationEnd(Animator animation) {
658681 }
659682 mWidgetToResetAfterFadeOut = -1 ;
660683 }
684+ updateWidgetFramesImportantForAccessibility ();
661685 }
662686 });
663687 mChildrenOutlineFadeAnimation .start ();
0 commit comments