Fixing low res folder icon when preview changes

Also removing legacy for drawable sharing between folder-content and folder-icon, since preview now always creates new drawables

Flag: EXEMPT bugfix
Bug: 386842651
Test: atest PreviewItemManagerTest
Change-Id: Ib8e4b4d5be4fb0c9601b9d8e3cef8a29d6c77651
This commit is contained in:
Sunny Goyal
2024-12-27 13:15:11 -08:00
parent 7482e5cbe2
commit 04b50a08f6
6 changed files with 82 additions and 67 deletions
@@ -1315,7 +1315,6 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
applyFromApplicationInfo((AppInfo) info);
} else if (info instanceof WorkspaceItemInfo) {
applyFromWorkspaceItem((WorkspaceItemInfo) info);
mActivity.invalidateParent(info);
} else if (info != null) {
applyFromItemInfoWithIcon(info);
}
@@ -1329,12 +1328,11 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
* Verifies that the current icon is high-res otherwise posts a request to load the icon.
*/
public void verifyHighRes() {
if (mIconLoadRequest != null) {
mIconLoadRequest.cancel();
mIconLoadRequest = null;
}
if (getTag() instanceof ItemInfoWithIcon info && !mHighResUpdateInProgress
&& info.getMatchingLookupFlag().useLowRes()) {
if (mIconLoadRequest != null) {
mIconLoadRequest.cancel();
}
mIconLoadRequest = LauncherAppState.getInstance(getContext()).getIconCache()
.updateIconInBackground(BubbleTextView.this, info);
}