summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/compat/LauncherActivityInfoCompat.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/compat/LauncherActivityInfoCompat.java')
-rw-r--r--src/com/android/launcher3/compat/LauncherActivityInfoCompat.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/launcher3/compat/LauncherActivityInfoCompat.java b/src/com/android/launcher3/compat/LauncherActivityInfoCompat.java
index 90a4d1a1f..07ef0efb7 100644
--- a/src/com/android/launcher3/compat/LauncherActivityInfoCompat.java
+++ b/src/com/android/launcher3/compat/LauncherActivityInfoCompat.java
@@ -17,7 +17,9 @@
package com.android.launcher3.compat;
import android.content.ComponentName;
+import android.content.Context;
import android.content.pm.ApplicationInfo;
+import android.content.pm.ResolveInfo;
import android.graphics.drawable.Drawable;
public abstract class LauncherActivityInfoCompat {
@@ -32,4 +34,11 @@ public abstract class LauncherActivityInfoCompat {
public abstract ApplicationInfo getApplicationInfo();
public abstract long getFirstInstallTime();
public abstract Drawable getBadgedIcon(int density);
+
+ /**
+ * Creates a LauncherActivityInfoCompat for the primary user.
+ */
+ public static LauncherActivityInfoCompat fromResolveInfo(ResolveInfo info, Context context) {
+ return new LauncherActivityInfoCompatV16(context, info);
+ }
}