Update content description for applied theme
Fixes: 131293339
Change-Id: I10935d9517ebf47333b7bfd356fe5b9020688756
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 75bd9a6..2b3427b 100755
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -57,6 +57,9 @@
<!-- Content description of the previous button to bring user to the previous preview page. [CHAR LIMIT=NONE] -->
<string name="previous_page_content_description">Previous</string>
+ <!-- Content description indicating that the selected option is currently applied to the device. [CHAR_LIMIT=NONE] -->
+ <string name="option_applied_description"><xliff:g name="style_name">%1$s</xliff:g>, currently applied</string>
+
<!-- Sample text used to show a preview of a selected font [CHAR LIMIT=3] -->
<string name="theme_font_example">ABC</string>
diff --git a/src/com/android/customization/widget/OptionSelectorController.java b/src/com/android/customization/widget/OptionSelectorController.java
index 8fe7bd8..5e4a30a 100644
--- a/src/com/android/customization/widget/OptionSelectorController.java
+++ b/src/com/android/customization/widget/OptionSelectorController.java
@@ -178,6 +178,11 @@
holder.itemView.getPaddingBottom() - (checkSize/3));
checkedFrame.setLayerInsetLeft(idx, checkSize/3);
holder.itemView.setForeground(checkedFrame);
+
+ CharSequence cd = mContainer.getContext().getString(
+ R.string.option_applied_description, option.getTitle());
+ holder.labelView.setContentDescription(cd);
+
} else if (mShowCheckmark) {
holder.itemView.setForeground(null);
}