@@ -556,12 +556,16 @@ public void setHomeButtonEnabled(boolean enable) {
556556 // Make sure the home button has an accurate content description for accessibility.
557557 if (!enable ) {
558558 mHomeLayout .setContentDescription (null );
559- } else if ((mDisplayOptions & ActionBar .DISPLAY_HOME_AS_UP ) != 0 ) {
560- mHomeLayout .setContentDescription (mContext .getResources ().getText (
561- R .string .action_bar_up_description ));
559+ mHomeLayout .setImportantForAccessibility (IMPORTANT_FOR_ACCESSIBILITY_NO );
562560 } else {
563- mHomeLayout .setContentDescription (mContext .getResources ().getText (
564- R .string .action_bar_home_description ));
561+ mHomeLayout .setImportantForAccessibility (IMPORTANT_FOR_ACCESSIBILITY_AUTO );
562+ if ((mDisplayOptions & ActionBar .DISPLAY_HOME_AS_UP ) != 0 ) {
563+ mHomeLayout .setContentDescription (mContext .getResources ().getText (
564+ R .string .action_bar_up_description ));
565+ } else {
566+ mHomeLayout .setContentDescription (mContext .getResources ().getText (
567+ R .string .action_bar_home_description ));
568+ }
565569 }
566570 }
567571
@@ -624,12 +628,16 @@ public void setDisplayOptions(int options) {
624628 // Make sure the home button has an accurate content description for accessibility.
625629 if (!mHomeLayout .isEnabled ()) {
626630 mHomeLayout .setContentDescription (null );
627- } else if ((options & ActionBar .DISPLAY_HOME_AS_UP ) != 0 ) {
628- mHomeLayout .setContentDescription (mContext .getResources ().getText (
629- R .string .action_bar_up_description ));
631+ mHomeLayout .setImportantForAccessibility (IMPORTANT_FOR_ACCESSIBILITY_NO );
630632 } else {
631- mHomeLayout .setContentDescription (mContext .getResources ().getText (
632- R .string .action_bar_home_description ));
633+ mHomeLayout .setImportantForAccessibility (IMPORTANT_FOR_ACCESSIBILITY_AUTO );
634+ if ((options & ActionBar .DISPLAY_HOME_AS_UP ) != 0 ) {
635+ mHomeLayout .setContentDescription (mContext .getResources ().getText (
636+ R .string .action_bar_up_description ));
637+ } else {
638+ mHomeLayout .setContentDescription (mContext .getResources ().getText (
639+ R .string .action_bar_home_description ));
640+ }
633641 }
634642 }
635643
0 commit comments