Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 219371c4 authored by Charlie Anderson's avatar Charlie Anderson Committed by Android Build Coastguard Worker
Browse files

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
parent b93ba761
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -1130,6 +1130,9 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
                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 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
    }

    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()