policy_module(switcheroo)

# switcheroo is a daemon to manage discrete vs integrated GPU use for apps

########################################
#
# Declarations
#

type switcheroo_t;
type switcheroo_exec_t;
init_daemon_domain(switcheroo_t, switcheroo_exec_t)

########################################
#
# Local policy
#

allow switcheroo_t self:netlink_kobject_uevent_socket create_socket_perms;

kernel_read_system_state(switcheroo_t)

dev_read_sysfs(switcheroo_t)

dbus_list_system_bus_runtime(switcheroo_t)
dbus_system_bus_client(switcheroo_t)
dbus_connect_system_bus(switcheroo_t)

miscfiles_read_localization(switcheroo_t)

udev_search_runtime(switcheroo_t)

optional_policy(`
	unconfined_dbus_send(switcheroo_t)
')

optional_policy(`
	xserver_dbus_chat_xdm(switcheroo_t)
')
