summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/lineage/LineageUtils.java
blob: ae324dd105b447681c1bdef740cfef31b72f9b32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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;
        }
    }
}