@Override public boolean isComponentEnabled(ResolveInfo resolveInfo){
  if (resolveInfo != null && resolveInfo.serviceInfo != null && !TextUtils.isEmpty(resolveInfo.serviceInfo.packageName)) {
    if (mPermittedPackageNames == null || isSystemApp(resolveInfo.serviceInfo.applicationInfo)) {
      return true;
    }
 else {
      return mPermittedPackageNames.contains(resolveInfo.serviceInfo.packageName);
    }
  }
  return false;
}

@ Override public boolean isComponentEnabled ( ResolveInfo resolveInfo ) { if ( resolveInfo != null && resolveInfo . serviceInfo != null && ! TextUtils . isEmpty ( resolveInfo . serviceInfo . packageName ) ) { if ( mPermittedPackageNames == null || isSystemApp ( resolveInfo . serviceInfo . applicationInfo ) ) { return true ; } else { return mPermittedPackageNames . contains ( resolveInfo . serviceInfo . packageName ) ; } } return false ; }
there are three cases where a given component in a profile is enabled . 1 ) there is no restriction on the given component . 2 ) the given component ' s package name exist in the permitted package list . 3 ) the given component belong to a system package .
