Merge "Revert "Make getStateDescription() in View none final""

This commit is contained in:
TreeHugger Robot
2019-11-22 22:37:00 +00:00
committed by Android (Google) Code Review
2 changed files with 8 additions and 9 deletions

View File

@@ -50819,7 +50819,7 @@ package android.view {
method public final int getScrollY();
method @android.view.ViewDebug.ExportedProperty(category="drawing") @ColorInt public int getSolidColor();
method @LayoutRes public int getSourceLayoutResId();
method @android.view.ViewDebug.ExportedProperty(category="accessibility") @Nullable public CharSequence getStateDescription();
method @android.view.ViewDebug.ExportedProperty(category="accessibility") @Nullable public final CharSequence getStateDescription();
method public android.animation.StateListAnimator getStateListAnimator();
method protected int getSuggestedMinimumHeight();
method protected int getSuggestedMinimumWidth();

View File

@@ -8732,7 +8732,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
structure.setContextClickable(true);
}
structure.setClassName(getAccessibilityClassName().toString());
structure.setContentDescription(mContentDescription);
structure.setContentDescription(getContentDescription());
}
/**
@@ -9939,8 +9939,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
info.setImportantForAccessibility(isImportantForAccessibility());
info.setPackageName(mContext.getPackageName());
info.setClassName(getAccessibilityClassName());
info.setStateDescription(mStateDescription);
info.setContentDescription(mContentDescription);
info.setStateDescription(getStateDescription());
info.setContentDescription(getContentDescription());
info.setEnabled(isEnabled());
info.setClickable(isClickable());
@@ -10323,7 +10323,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @see #setStateDescription(CharSequence)
*/
@ViewDebug.ExportedProperty(category = "accessibility")
public @Nullable CharSequence getStateDescription() {
public final @Nullable CharSequence getStateDescription() {
return mStateDescription;
}
@@ -13717,7 +13717,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
*/
@UnsupportedAppUsage
public CharSequence getIterableTextForAccessibility() {
return mContentDescription;
return getContentDescription();
}
/**
@@ -29498,10 +29498,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
stream.addProperty("text:textAlignment", getTextAlignment());
// accessibility
CharSequence contentDescription = getContentDescription();
stream.addProperty("accessibility:contentDescription",
mContentDescription == null ? "" : mContentDescription.toString());
stream.addProperty("accessibility:stateDescription",
mStateDescription == null ? "" : mStateDescription.toString());
contentDescription == null ? "" : contentDescription.toString());
stream.addProperty("accessibility:labelFor", getLabelFor());
stream.addProperty("accessibility:importantForAccessibility", getImportantForAccessibility());
}