summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/AppInfo.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/AppInfo.java')
-rw-r--r--src/com/android/launcher3/AppInfo.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/com/android/launcher3/AppInfo.java b/src/com/android/launcher3/AppInfo.java
index d884049f5..c8e7619c7 100644
--- a/src/com/android/launcher3/AppInfo.java
+++ b/src/com/android/launcher3/AppInfo.java
@@ -29,11 +29,19 @@ import com.android.launcher3.compat.UserManagerCompat;
import com.android.launcher3.util.ComponentKey;
import com.android.launcher3.util.PackageManagerHelper;
+import java.util.Comparator;
+
/**
* Represents an app in AllAppsView.
*/
public class AppInfo extends ItemInfoWithIcon {
+ public static AppInfo[] EMPTY_ARRAY = new AppInfo[0];
+ public static Comparator<AppInfo> COMPONENT_KEY_COMPARATOR = (a, b) -> {
+ int uc = a.user.hashCode() - b.user.hashCode();
+ return uc != 0 ? uc : a.componentName.compareTo(b.componentName);
+ };
+
/**
* The intent used to start the application.
*/
@@ -41,6 +49,9 @@ public class AppInfo extends ItemInfoWithIcon {
public ComponentName componentName;
+ // Section name used for indexing.
+ public String sectionName = "";
+
public AppInfo() {
itemType = LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
}
@@ -74,6 +85,8 @@ public class AppInfo extends ItemInfoWithIcon {
componentName = info.componentName;
title = Utilities.trim(info.title);
intent = new Intent(info.intent);
+ user = info.user;
+ runtimeStatusFlags = info.runtimeStatusFlags;
}
@Override
@@ -116,4 +129,9 @@ public class AppInfo extends ItemInfoWithIcon {
info.runtimeStatusFlags |= FLAG_ADAPTIVE_ICON;
}
}
+
+ @Override
+ public AppInfo clone() {
+ return new AppInfo(this);
+ }
}