From fa702c5c2b82a33b7cdc564378abfc09c5b48d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Brey?= Date: Fri, 19 May 2017 13:35:14 +0200 Subject: [PATCH] Replace Qualcomm time daemon with sony timekeep --- device.mk | 5 +++++ lineage.dependencies | 4 ++++ proprietary-files.txt | 4 ---- rootdir/etc/init.qcom.rc | 11 ++++++----- sepolicy/file_contexts | 3 +++ sepolicy/property.te | 1 + sepolicy/property_contexts | 1 + sepolicy/system_app.te | 3 +++ sepolicy/timekeep.te | 18 ++++++++++++++++++ 9 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 sepolicy/timekeep.te diff --git a/device.mk b/device.mk index e923609..d52b800 100755 --- a/device.mk +++ b/device.mk @@ -261,6 +261,11 @@ PRODUCT_PACKAGES += \ libxml2 \ libprotobuf-cpp-full +# TimeKeep +PRODUCT_PACKAGES += \ + timekeep \ + TimeKeep + # Sensors PRODUCT_PACKAGES += \ sensors.msm8996 diff --git a/lineage.dependencies b/lineage.dependencies index 6cb8349..be32c26 100644 --- a/lineage.dependencies +++ b/lineage.dependencies @@ -10,5 +10,9 @@ { "repository": "android_packages_resources_devicesettings", "target_path": "packages/resources/devicesettings" + }, + { + "repository": "android_hardware_sony_timekeep", + "target_path": "hardware/sony/timekeep" } ] diff --git a/proprietary-files.txt b/proprietary-files.txt index 3e409b8..32dffc8 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -654,11 +654,7 @@ vendor/lib64/libthermalioctl.so -vendor/lib/libthermalclient.so # Time services --app/TimeService/TimeService.apk -bin/time_daemon -vendor/lib64/libTimeService.so -vendor/lib64/libtime_genoff.so -vendor/lib/libTimeService.so -vendor/lib/libtime_genoff.so # Widevine diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index 7be407f..53010df 100755 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -516,11 +516,12 @@ service thermal-engine /system/vendor/bin/thermal-engine group root writepid /dev/cpuset/system-background/tasks -service time_daemon /system/bin/time_daemon - class late_start - user root - group root - writepid /dev/cpuset/system-background/tasks +service timekeep /system/bin/timekeep restore + class late_start + user root + group root + oneshot + writepid /dev/cpuset/system-background/tasks service adsprpcd /system/bin/adsprpcd class main diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts index 979f833..1f7b545 100644 --- a/sepolicy/file_contexts +++ b/sepolicy/file_contexts @@ -33,3 +33,6 @@ # Data files /data/decrypt.txt u:object_r:thermal_data_file:s0 /data/misc/netmgr/log.txt u:object_r:netmgrd_data_file:s0 + +# Timekeep +/system/bin/timekeep u:object_r:timekeep_exec:s0 diff --git a/sepolicy/property.te b/sepolicy/property.te index 85dcb78..333772b 100644 --- a/sepolicy/property.te +++ b/sepolicy/property.te @@ -1 +1,2 @@ type diag_prop, property_type; +type timekeep_prop, property_type; diff --git a/sepolicy/property_contexts b/sepolicy/property_contexts index 4c44017..0f2a505 100644 --- a/sepolicy/property_contexts +++ b/sepolicy/property_contexts @@ -3,3 +3,4 @@ audio. u:object_r:audio_prop:s0 ro.sys.oem.sno u:object_r:system_radio_prop:s0 sys.fake_bs_flag0 u:object_r:system_radio_prop:s0 sys.fake_bs_flag1 u:object_r:system_radio_prop:s0 +persist.sys.timeadjust u:object_r:timekeep_prop:s0 diff --git a/sepolicy/system_app.te b/sepolicy/system_app.te index f9df2ec..50dca1d 100644 --- a/sepolicy/system_app.te +++ b/sepolicy/system_app.te @@ -2,3 +2,6 @@ allow system_app proc_touchpanel:dir search; allow system_app proc_touchpanel:file rw_file_perms; allow system_app sysfs_fpc_proximity:file rw_file_perms; + +allow system_app time_data_file:file rw_file_perms; +set_prop(system_app, timekeep_prop) diff --git a/sepolicy/timekeep.te b/sepolicy/timekeep.te new file mode 100644 index 0000000..a7c39d8 --- /dev/null +++ b/sepolicy/timekeep.te @@ -0,0 +1,18 @@ +type timekeep, domain, domain_deprecated; +type timekeep_exec, exec_type, file_type; + +# Started by init +init_daemon_domain(timekeep) + +allow timekeep self:capability { + fowner + fsetid + sys_time + dac_override + dac_read_search +}; + +allow timekeep time_data_file:file create_file_perms; +allow timekeep time_data_file:dir create_dir_perms; + +set_prop(timekeep, timekeep_prop)