From da6dad51014d867faf83191d83f1f4fc4207fdab Mon Sep 17 00:00:00 2001 From: vadimt Date: Tue, 21 May 2019 13:24:23 -0700 Subject: [PATCH] Not allowing applying dot state to override "disabled" description Disabled apps were always accessibility-marked like "Disabled Messenger" With introduction of dots, this degraded, the the "Disabled" part was never added. Restoring the old behavior here. Bug: 129036789 Change-Id: Icb97ea9a190643449d90f558a78039df30c53cbf --- src/com/android/launcher3/BubbleTextView.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index bff7f42131..2f801e04b9 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -51,7 +51,6 @@ import com.android.launcher3.graphics.PreloadIconDrawable; import com.android.launcher3.icons.DotRenderer; import com.android.launcher3.icons.IconCache.IconLoadRequest; import com.android.launcher3.icons.IconCache.ItemInfoUpdateReceiver; -import com.android.launcher3.icons.LauncherIcons; import com.android.launcher3.model.PackageItemInfo; import com.android.launcher3.views.ActivityContext; @@ -561,7 +560,10 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, } } if (itemInfo.contentDescription != null) { - if (hasDot()) { + if (itemInfo.isDisabled()) { + setContentDescription(getContext().getString(R.string.disabled_app_label, + itemInfo.contentDescription)); + } else if (hasDot()) { int count = mDotInfo.getNotificationCount(); setContentDescription(getContext().getResources().getQuantityString( R.plurals.dotted_app_label, count, itemInfo.contentDescription, count));