mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2025-05-02 06:26:20 -04:00
deblobber: fixup timekeep replacement, credit Wang Han/aviraxp
This commit is contained in:
parent
38c52cc43b
commit
00a6a86126
4 changed files with 60 additions and 6 deletions
22
Patches/Common/android_timekeep_sepolicy/timekeep.te
Normal file
22
Patches/Common/android_timekeep_sepolicy/timekeep.te
Normal file
|
@ -0,0 +1,22 @@
|
|||
# Policy for the timekeep.c oneshot system service
|
||||
# Gets called once during init by vendor timekeep.rc and restores
|
||||
# clock from persist.vendor.timeadjust property, reads
|
||||
# /sys/class/rtc/rtc0/since_epoch
|
||||
type timekeep, domain;
|
||||
type timekeep_exec, exec_type, vendor_file_type, file_type;
|
||||
|
||||
init_daemon_domain(timekeep)
|
||||
|
||||
# Grant permission to set system time and to set the real-time clock
|
||||
allow timekeep self:capability sys_time;
|
||||
|
||||
# Write to /data/vendor/time/ats_2
|
||||
allow timekeep time_data_file:dir rw_dir_perms;
|
||||
allow timekeep time_data_file:file create_file_perms;
|
||||
|
||||
# Set persist.vendor.timeadjust
|
||||
set_prop(timekeep, vendor_timekeep_prop)
|
||||
|
||||
# Read /sys/class/rtc/rtc0/since_epoch
|
||||
allow timekeep sysfs_rtc:dir search;
|
||||
allow timekeep sysfs_rtc:{ file lnk_file } r_file_perms;
|
25
Patches/Common/android_timekeep_sepolicy/timekeep_app.te
Normal file
25
Patches/Common/android_timekeep_sepolicy/timekeep_app.te
Normal file
|
@ -0,0 +1,25 @@
|
|||
# Policy for the TimeKeep Java app. It listens to a BootReceiver
|
||||
# or TIME_SET event and calculates the offset between the rtc clock
|
||||
# in /sys/class/rtc0/since_epoch and the current device time and stores that
|
||||
# value in /data/vendor/time/ats_2 and as persist.vendor.timeadjust.
|
||||
type timekeep_app, domain;
|
||||
|
||||
app_domain(timekeep_app)
|
||||
|
||||
# Needed to get access to /data/data/com.sony.timekeep
|
||||
# Only getattr and search are requested since TimeKeep does not write to its own directory
|
||||
# /data/data/com.sony.timekeep only has two empty subdirs
|
||||
dontaudit timekeep_app app_data_file:dir { getattr search };
|
||||
|
||||
allow timekeep_app activity_service:service_manager find;
|
||||
|
||||
# Read from /data/vendor/time/ats_2
|
||||
allow timekeep_app time_data_file:dir create_dir_perms;
|
||||
allow timekeep_app time_data_file:file create_file_perms;
|
||||
|
||||
# Read /sys/class/rtc/rtc0/since_epoch
|
||||
allow timekeep_app sysfs_rtc:dir { search };
|
||||
allow timekeep_app sysfs_rtc:{ file lnk_file } r_file_perms;
|
||||
|
||||
# Set the persist.vendor.timeadjust property
|
||||
set_prop(timekeep_app, vendor_timekeep_prop)
|
Loading…
Add table
Add a link
Reference in a new issue