Version-2: Prioritize the session-provided icon & label for archived apps during unarchival in the iconCache.

* Also ensures that apps are sorted based on their actual name, so that
  they don't jump around when "Pending.." switches to "Downloading.."
* In case of faillure during unarchival, icons shown are reverted to that of PM supplied ones.

New UI: http://recall/-/gMbThhDGagWFqnJTbQCqSz/fPuzxUuU7cGXCNdygMkXAB

Test: atest CacheDataUpdatedTaskTest.java and locally verified.
Bug: 319495216
Flag: ACONFIG com.android.launcher3.enable_support_for_archiving TRUNKFOOD
Change-Id: I6410482706af900e273fdc6f7cf0b0692442364c
This commit is contained in:
Jakob Schneider committed 2024-02-09 13:55:41 +00:00
1 parent e35d5d8cb0
commit 4f5b60169d
5 files changed
+173 -11

No files matched your search

@@ -43,9 +43,7 @@ public class AppInfoComparator implements Comparator<AppInfo> {
@Override
public int compare(AppInfo a, AppInfo b) {
// Order by the title in the current locale
int result = mLabelComparator.compare(
a.title == null ? "" : a.title.toString(),
b.title == null ? "" : b.title.toString());
int result = mLabelComparator.compare(getSortingTitle(a), getSortingTitle(b));
if (result != 0) {
return result;
}
@@ -64,4 +62,14 @@ public class AppInfoComparator implements Comparator<AppInfo> {
return aUserSerial.compareTo(bUserSerial);
}
}
private String getSortingTitle(AppInfo info) {
if (info.appTitle != null) {
return info.appTitle.toString();
}
if (info.title != null) {
return info.title.toString();
}
return "";
}
}