@@ -180,6 +180,22 @@ public void sendAccessibilityEvent(int eventType) {
180180 }
181181 }
182182
183+ private void updateWidgetFramesImportantForAccessibility () {
184+ final int pageCount = getPageCount ();
185+ for (int i = 0 ; i < pageCount ; i ++) {
186+ KeyguardWidgetFrame frame = getWidgetPageAt (i );
187+ updateWidgetFrameImportantForAccessibility (frame );
188+ }
189+ }
190+
191+ private void updateWidgetFrameImportantForAccessibility (KeyguardWidgetFrame frame ) {
192+ if (frame .getContentAlpha () <= 0 ) {
193+ frame .setImportantForAccessibility (View .IMPORTANT_FOR_ACCESSIBILITY_NO );
194+ } else {
195+ frame .setImportantForAccessibility (View .IMPORTANT_FOR_ACCESSIBILITY_YES );
196+ }
197+ }
198+
183199 private void userActivity () {
184200 if (mCallbacks != null ) {
185201 mCallbacks .onUserActivityTimeoutChanged ();
@@ -312,6 +328,7 @@ public void addWidget(View widget, int pageIndex) {
312328 content .getContentDescription ());
313329 frame .setContentDescription (contentDescription );
314330 }
331+ updateWidgetFrameImportantForAccessibility (frame );
315332 }
316333
317334 /**
@@ -558,6 +575,12 @@ public void showSidePageHints() {
558575 animateOutlinesAndSidePages (true , -1 );
559576 }
560577
578+ @ Override
579+ void setCurrentPage (int currentPage ) {
580+ super .setCurrentPage (currentPage );
581+ updateWidgetFramesImportantForAccessibility ();
582+ }
583+
561584 @ Override
562585 public void onAttachedToWindow () {
563586 super .onAttachedToWindow ();
@@ -669,6 +692,7 @@ public void onAnimationEnd(Animator animation) {
669692 }
670693 mWidgetToResetAfterFadeOut = -1 ;
671694 }
695+ updateWidgetFramesImportantForAccessibility ();
672696 }
673697 });
674698 mChildrenOutlineFadeAnimation .start ();
0 commit comments