From efad3c2f9243ca760f04208572b8dca77ebdfeb6 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Thu, 2 Feb 2023 16:11:34 -0800 Subject: [PATCH] Using internal format cache for loading user badged label Bug: 267683009 Test: Manual Change-Id: I7d1df2704c4513bd80e2b6adb7a3921637fa617b --- src/com/android/launcher3/icons/IconCache.java | 3 +-- src/com/android/launcher3/model/LoaderCursor.java | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/com/android/launcher3/icons/IconCache.java b/src/com/android/launcher3/icons/IconCache.java index 0b4a4a53d4..b17b7dc701 100644 --- a/src/com/android/launcher3/icons/IconCache.java +++ b/src/com/android/launcher3/icons/IconCache.java @@ -484,8 +484,7 @@ public class IconCache extends BaseIconCache { WidgetSection widgetSection = WidgetSections.getWidgetSections(mContext) .get(infoInOut.widgetCategory); infoInOut.title = mContext.getString(widgetSection.mSectionTitle); - infoInOut.contentDescription = mPackageManager.getUserBadgedLabel( - infoInOut.title, infoInOut.user); + infoInOut.contentDescription = getUserBadgedLabel(infoInOut.title, infoInOut.user); final BitmapInfo cachedBitmap = mWidgetCategoryBitmapInfos.get(infoInOut.widgetCategory); if (cachedBitmap != null) { infoInOut.bitmap = getBadgedIcon(cachedBitmap, infoInOut.user); diff --git a/src/com/android/launcher3/model/LoaderCursor.java b/src/com/android/launcher3/model/LoaderCursor.java index 0a6a7cda9c..855a69d4bc 100644 --- a/src/com/android/launcher3/model/LoaderCursor.java +++ b/src/com/android/launcher3/model/LoaderCursor.java @@ -310,7 +310,7 @@ public class LoaderCursor extends CursorWrapper { throw new InvalidParameterException("Invalid restoreType " + restoreFlag); } - info.contentDescription = mPM.getUserBadgedLabel(info.title, info.user); + info.contentDescription = mIconCache.getUserBadgedLabel(info.title, info.user); info.itemType = itemType; info.status = restoreFlag; return info; @@ -381,7 +381,7 @@ public class LoaderCursor extends CursorWrapper { } } - info.contentDescription = mPM.getUserBadgedLabel(info.title, info.user); + info.contentDescription = mIconCache.getUserBadgedLabel(info.title, info.user); return info; }