@OwnerUser @ProfileUser public static boolean ensureAppHiddenState(final Context context, final String pkg, final boolean state) {
		final DevicePolicies policies = new DevicePolicies(context);
		if (policies.setApplicationHidden(pkg, state)) return true;
		// Since setApplicationHidden() return false if already in that state, also check the current state.
		final boolean hidden = policies.invoke(DevicePolicyManager::isApplicationHidden, pkg);
		return state == hidden;
	}
Utilities of shared basic functionality for modules

Created by Oasis on 2017/2/20.
shared/src/main/java/com/oasisfeng/island/engine/IslandManager.java