Add content description setter to RemoteViews
bug:5480389
Change-Id: I66616f379a244ba7f3552d766f3aaa77f207550a
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index a2f9b36..fea79d5 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -4219,6 +4219,7 @@
*
* @attr ref android.R.styleable#View_contentDescription
*/
+ @RemotableViewMethod
public void setContentDescription(CharSequence contentDescription) {
mContentDescription = contentDescription;
}
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index 9cf2718..1592061 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -1546,6 +1546,16 @@
}
/**
+ * Equivalent to calling View.setContentDescription
+ *
+ * @param viewId The id of the view whose content description should change
+ * @param contentDescription The new content description for the view
+ */
+ public void setContentDescription(int viewId, CharSequence contentDescription) {
+ setCharSequence(viewId, "setContentDescription", contentDescription);
+ }
+
+ /**
* Inflates the view hierarchy represented by this object and applies
* all of the actions.
*