summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/lineage/LineageUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/lineage/LineageUtils.java')
-rw-r--r--src/com/android/launcher3/lineage/LineageUtils.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/launcher3/lineage/LineageUtils.java b/src/com/android/launcher3/lineage/LineageUtils.java
new file mode 100644
index 000000000..ae324dd10
--- /dev/null
+++ b/src/com/android/launcher3/lineage/LineageUtils.java
@@ -0,0 +1,17 @@
+package com.android.launcher3.lineage;
+
+import android.content.Context;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
+
+public class LineageUtils {
+
+ public static boolean hasPackageInstalled(Context context, String pkgName) {
+ try {
+ ApplicationInfo ai = context.getPackageManager().getApplicationInfo(pkgName, 0);
+ return ai.enabled;
+ } catch (PackageManager.NameNotFoundException e) {
+ return false;
+ }
+ }
+}