charger.te 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. type charger, domain;
  2. type charger_exec, system_file_type, exec_type, file_type;
  3. # Write to /dev/kmsg
  4. allow charger kmsg_device:chr_file rw_file_perms;
  5. # Read access to pseudo filesystems.
  6. r_dir_file(charger, rootfs)
  7. r_dir_file(charger, cgroup)
  8. # Allow to read /sys/class/power_supply directory
  9. allow charger sysfs_type:dir r_dir_perms;
  10. allow charger self:global_capability_class_set { sys_tty_config };
  11. allow charger self:global_capability_class_set sys_boot;
  12. wakelock_use(charger)
  13. allow charger self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl;
  14. # Read/write to /sys/power/state
  15. allow charger sysfs_power:file rw_file_perms;
  16. r_dir_file(charger, sysfs_batteryinfo)
  17. # Read /sys/fs/pstore/console-ramoops
  18. # Don't worry about overly broad permissions for now, as there's
  19. # only one file in /sys/fs/pstore
  20. allow charger pstorefs:dir r_dir_perms;
  21. allow charger pstorefs:file r_file_perms;
  22. allow charger graphics_device:dir r_dir_perms;
  23. allow charger graphics_device:chr_file rw_file_perms;
  24. allow charger input_device:dir r_dir_perms;
  25. allow charger input_device:chr_file r_file_perms;
  26. allow charger tty_device:chr_file rw_file_perms;
  27. allow charger proc_sysrq:file rw_file_perms;
  28. # charger needs to tell init to continue the boot
  29. # process when running in charger mode.
  30. set_prop(charger, system_prop)
  31. set_prop(charger, exported_system_prop)
  32. set_prop(charger, exported2_system_prop)
  33. set_prop(charger, exported3_system_prop)