Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e56dfc1f authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android Git Automerger
Browse files

am d8357cee: Merge "Sets accessibility importance for the home/up button. Bug:...

am d8357cee: Merge "Sets accessibility importance for the home/up button. Bug: 7196985 Change-Id: I4d27470eccb8933f751db892218a8032a80df3da" into jb-mr1-dev

* commit 'd8357cee':
  Sets accessibility importance for the home/up button. Bug: 7196985 Change-Id: I4d27470eccb8933f751db892218a8032a80df3da
parents 397c8629 d8357cee
Loading
Loading
Loading
Loading
+18 −10
Original line number Diff line number Diff line
@@ -556,7 +556,10 @@ public class ActionBarView extends AbsActionBarView {
        // Make sure the home button has an accurate content description for accessibility.
        if (!enable) {
            mHomeLayout.setContentDescription(null);
        } else if ((mDisplayOptions & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
            mHomeLayout.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO);
        } else {
            mHomeLayout.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_AUTO);
            if ((mDisplayOptions & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
                mHomeLayout.setContentDescription(mContext.getResources().getText(
                        R.string.action_bar_up_description));
            } else {
@@ -564,6 +567,7 @@ public class ActionBarView extends AbsActionBarView {
                        R.string.action_bar_home_description));
            }
        }
    }

    public void setDisplayOptions(int options) {
        final int flagsChanged = mDisplayOptions == -1 ? -1 : options ^ mDisplayOptions;
@@ -624,7 +628,10 @@ public class ActionBarView extends AbsActionBarView {
        // Make sure the home button has an accurate content description for accessibility.
        if (!mHomeLayout.isEnabled()) {
            mHomeLayout.setContentDescription(null);
        } else if ((options & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
            mHomeLayout.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO);
        } else {
            mHomeLayout.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_AUTO);
            if ((options & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
                mHomeLayout.setContentDescription(mContext.getResources().getText(
                        R.string.action_bar_up_description));
            } else {
@@ -632,6 +639,7 @@ public class ActionBarView extends AbsActionBarView {
                        R.string.action_bar_home_description));
            }
        }
    }

    public void setIcon(Drawable icon) {
        mIcon = icon;