android判断是否为系统应用

public boolean isSystemApp(PackageInfo pInfo) { 
        return ((pInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0); 
    } 
 
    public boolean isSystemUpdateApp(PackageInfo pInfo) { 
        return ((pInfo.applicationInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0); 
    } 
 
    public boolean isUserApp(PackageInfo pInfo) { 
        return (!isSystemApp(pInfo) && !isSystemUpdateApp(pInfo)); 
    } 

你可能感兴趣的:(android判断是否为系统应用)