@ProfileUser private static void hideUnnecessaryAppsInManagedProfile(final Context context) {
		final List<ResolveInfo> resolves = context.getPackageManager().queryIntentActivities(
				new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI), PackageManager.MATCH_SYSTEM_ONLY);	// Do not use resolveActivity(), which will return ResolverActivity.
		for (final ResolveInfo resolve : resolves) {
			final String pkg = resolve.activityInfo.packageName;
			if ((resolve.activityInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0 || "android".equals(pkg)) continue;
			if (context.getPackageManager().resolveActivity(new Intent(ACTION_MAIN).addCategory(CATEGORY_LAUNCHER).setPackage(pkg), 0) != null)
				new DevicePolicies(context).setApplicationHiddenWithoutAppOpsSaver(pkg, true);
		}
	}
This is the normal procedure after ManagedProvision finished its provisioning, running in profile.
engine/src/main/java/com/oasisfeng/island/provisioning/IslandProvisioning.java