Prevent archived apps content description from being overridden unexpectedly
Bug: 372035896
Test: manually tested archiving/unarchiving with Talkback
Flag: EXEMPT bugfix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:91a2aad67f2f5a9b8773d49daaf8c634884867e3)
Merged-In: Ief7f7d176c6ed23a8d7798cf31506e0a9c8921ed
Change-Id: Ief7f7d176c6ed23a8d7798cf31506e0a9c8921ed
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 8121e53..5224ee3 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -1130,6 +1130,9 @@
if (itemInfo.isDisabled()) {
setContentDescription(getContext().getString(R.string.disabled_app_label,
itemInfo.contentDescription));
+ } else if (itemInfo instanceof WorkspaceItemInfo wai && wai.isArchived()) {
+ setContentDescription(
+ getContext().getString(R.string.app_archived_title, itemInfo.title));
} else if (hasDot()) {
int count = mDotInfo.getNotificationCount();
setContentDescription(
@@ -1142,8 +1145,16 @@
}
private void setDownloadStateContentDescription(ItemInfoWithIcon info, int progressLevel) {
- if ((info.runtimeStatusFlags & ItemInfoWithIcon.FLAG_ARCHIVED) != 0 && progressLevel == 0) {
- setContentDescription(getContext().getString(R.string.app_archived_title, info.title));
+ if ((info.runtimeStatusFlags & ItemInfoWithIcon.FLAG_ARCHIVED) != 0
+ && progressLevel == 0) {
+ if (mIcon instanceof PreloadIconDrawable) {
+ // Tell user that download is pending and not to tap to download again.
+ setContentDescription(getContext().getString(
+ R.string.app_waiting_download_title, info.title));
+ } else {
+ setContentDescription(getContext().getString(
+ R.string.app_archived_title, info.title));
+ }
} else if ((info.runtimeStatusFlags & ItemInfoWithIcon.FLAG_SHOW_DOWNLOAD_PROGRESS_MASK)
!= 0) {
String percentageString = NumberFormat.getPercentInstance()