List of usage examples for android.content.pm ApplicationInfo FLAG_SYSTEM
int FLAG_SYSTEM
To view the source code for android.content.pm ApplicationInfo FLAG_SYSTEM.
Click Source Link
From source file:Main.java
public static boolean isSystemApp(ApplicationInfo pInfo) { return ((pInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0); }
From source file:Main.java
private static boolean isSystemPackage(ApplicationInfo pkgInfo) { return ((pkgInfo.flags & ApplicationInfo.FLAG_SYSTEM) == ApplicationInfo.FLAG_SYSTEM); }
From source file:Main.java
public static boolean isUserApp(ApplicationInfo info) { if (info == null) { return false; }/*from ww w . j a v a2s . c om*/ return !((info.flags & ApplicationInfo.FLAG_SYSTEM) != 0 || (info.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0); }
From source file:Main.java
public static boolean isAsSystemApp(Context pContext) { return (pContext.getApplicationInfo().flags & ApplicationInfo.FLAG_SYSTEM) != 0; }
From source file:Main.java
public static boolean filterApp(ApplicationInfo info) { if ((info.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) return true; else if ((info.flags & ApplicationInfo.FLAG_SYSTEM) == 0) { return true; }/*from ww w . j a va2 s.c o m*/ return false; }
From source file:Main.java
public static boolean isSystemApp(ApplicationInfo info) { if ((info.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) { return true; } else if ((info.flags & ApplicationInfo.FLAG_SYSTEM) == 0) { return true; }/*from ww w . j ava 2s . c o m*/ return false; }
From source file:Main.java
public static boolean isSystemApplication(int flags) { if ((flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) return true; else if ((flags & ApplicationInfo.FLAG_SYSTEM) != 0) return true; return false; }
From source file:Main.java
public static boolean isSystemApp(Context context, String packageName) { boolean isSys = false; PackageManager pm = context.getPackageManager(); try {// w w w . java 2s . c o m ApplicationInfo applicationInfo = pm.getApplicationInfo(packageName, 0); if (applicationInfo != null && (applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) > 0) { isSys = true; } } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); isSys = false; } return isSys; }
From source file:Main.java
public static boolean isSystem(String packageName, Context context) { try {// w w w .j a v a 2 s . com PackageManager pm = context.getPackageManager(); PackageInfo info = pm.getPackageInfo(packageName, 0); return ((info.applicationInfo.flags & (ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP)) != 0); /* PackageInfo pkg = pm.getPackageInfo(packageName, PackageManager.GET_SIGNATURES); PackageInfo sys = pm.getPackageInfo("android", PackageManager.GET_SIGNATURES); return (pkg != null && pkg.signatures != null && pkg.signatures.length > 0 && sys.signatures.length > 0 && sys.signatures[0].equals(pkg.signatures[0])); */ } catch (PackageManager.NameNotFoundException ignore) { return false; } }
From source file:Main.java
public static List<PackageInfo> getAllApps(Context context) { List<PackageInfo> apps = new ArrayList<PackageInfo>(); PackageManager pManager = context.getPackageManager(); List<PackageInfo> paklist = pManager.getInstalledPackages(0); for (int i = 0; i < paklist.size(); i++) { PackageInfo pak = paklist.get(i); if ((pak.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) <= 0) { // customs applications apps.add(pak);//from w w w.j a va 2 s .c om } } return apps; }