summaryrefslogtreecommitdiffstats
path: root/core/java/com
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2013-11-01 16:32:37 -0700
committerAdam Powell <adamp@google.com>2013-11-01 16:36:49 -0700
commitf37a5139db360095fc0ce9080efd4c375751b296 (patch)
tree288d9f7b8b34dc0281e909ac67f3d9b3283bd357 /core/java/com
parentefcc2ca63dfa9179979ecdc86031c06240ada1c5 (diff)
downloadframeworks_base-f37a5139db360095fc0ce9080efd4c375751b296.zip
frameworks_base-f37a5139db360095fc0ce9080efd4c375751b296.tar.gz
frameworks_base-f37a5139db360095fc0ce9080efd4c375751b296.tar.bz2
Fix incorrect content description on action bar home/up
Some stray code from a previous change caused an erroneous content description to be set on the wrong view in the action bar. Correct this and sync with the right behavior. Bug 10969992 Change-Id: I4deaa3528b4bc222e25354679fa93f8316fa2d70
Diffstat (limited to 'core/java/com')
-rw-r--r--core/java/com/android/internal/widget/ActionBarView.java20
1 files changed, 6 insertions, 14 deletions
diff --git a/core/java/com/android/internal/widget/ActionBarView.java b/core/java/com/android/internal/widget/ActionBarView.java
index b5d74e8..5f9d8f2 100644
--- a/core/java/com/android/internal/widget/ActionBarView.java
+++ b/core/java/com/android/internal/widget/ActionBarView.java
@@ -566,7 +566,11 @@ public class ActionBarView extends AbsActionBarView {
mUpGoerFive.setEnabled(enable);
mUpGoerFive.setFocusable(enable);
// Make sure the home button has an accurate content description for accessibility.
- if (!enable) {
+ updateHomeAccessibility(enable);
+ }
+
+ private void updateHomeAccessibility(boolean homeEnabled) {
+ if (!homeEnabled) {
mUpGoerFive.setContentDescription(null);
mUpGoerFive.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO);
} else {
@@ -677,19 +681,7 @@ public class ActionBarView extends AbsActionBarView {
}
// Make sure the home button has an accurate content description for accessibility.
- if (!mHomeLayout.isEnabled()) {
- mHomeLayout.setContentDescription(null);
- 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 {
- mHomeLayout.setContentDescription(mContext.getResources().getText(
- R.string.action_bar_home_description));
- }
- }
+ updateHomeAccessibility(!mUpGoerFive.isEnabled());
}
public void setIcon(Drawable icon) {