From 6f042cb1c632b8fa6592a3e00042831df09930e1 Mon Sep 17 00:00:00 2001 From: Roberto Sartori Date: Thu, 29 Dec 2022 10:30:17 +0100 Subject: [PATCH] miatoll: Switch from time_daemon to TimeKeep * time_daemon just refuses to work properly on mata. Sony's TimeKeep, instead, does the job flawlessly, so just ditch the former in favor of the latter. Signed-off-by: Roberto Sartori Change-Id: I54f50ed3d49efc2834d478781b15e6ee428a3062 --- aosp.dependencies | 6 ++++++ device.mk | 4 ++++ proprietary-files.txt | 3 --- rootdir/etc/init.qcom.rc | 10 ---------- sepolicy/vendor/file_contexts | 3 +++ sepolicy/vendor/property.te | 2 ++ sepolicy/vendor/property_contexts | 3 +++ sepolicy/vendor/seapp_contexts | 1 + sepolicy/vendor/timekeep.te | 13 +++++++++++++ sepolicy/vendor/timekeep_app.te | 12 ++++++++++++ 10 files changed, 44 insertions(+), 13 deletions(-) create mode 100644 sepolicy/vendor/seapp_contexts create mode 100644 sepolicy/vendor/timekeep.te create mode 100644 sepolicy/vendor/timekeep_app.te diff --git a/aosp.dependencies b/aosp.dependencies index 05530b9..8922cc5 100644 --- a/aosp.dependencies +++ b/aosp.dependencies @@ -1,4 +1,10 @@ [ + { + "repository": "LineageOS/android_hardware_sony_timekeep", + "target_path": "hardware/sony/timekeep", + "branch": "lineage-20", + "remote": "github" + }, { "repository": "hardware_xiaomi", "target_path": "hardware/xiaomi", diff --git a/device.mk b/device.mk index c4b8b9c..db5bd85 100644 --- a/device.mk +++ b/device.mk @@ -404,6 +404,10 @@ PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/configs/thermal-engine-gram.conf:$(TARGET_COPY_OUT_VENDOR)/etc/thermal-engine-gram.conf \ $(LOCAL_PATH)/configs/thermal-engine-joyeuse.conf:$(TARGET_COPY_OUT_VENDOR)/etc/thermal-engine-joyeuse.conf +# TimeKeep +PRODUCT_PACKAGES += \ + TimeKeep + # USB PRODUCT_PACKAGES += \ android.hardware.usb@1.0-service diff --git a/proprietary-files.txt b/proprietary-files.txt index c111448..8ef2cf2 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -1125,9 +1125,6 @@ vendor/bin/thermal-engine|549f8284d4aca92e2b8187ab2a283a90c40e6dca vendor/lib64/libthermalclient.so # Time services -vendor/app/TimeService/TimeService.apk -vendor/bin/time_daemon -vendor/etc/init/init.time_daemon.rc vendor/lib64/libtime_genoff.so # Touchscreen firmware diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index 51fa912..cbadc88 100644 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -176,7 +176,6 @@ on boot mkdir /persist/bluetooth 0770 bluetooth bluetooth mkdir /persist/misc 0770 system system mkdir /persist/alarm 0770 system system - mkdir /mnt/vendor/persist/time 0770 system system mkdir /mnt/vendor/persist/secnvm 0770 system system mkdir /mnt/vendor/persist/iar_db 0770 system system mkdir /mnt/vendor/spunvm 0770 system system @@ -360,9 +359,6 @@ on post-fs-data mkdir /dev/socket/wifihal 0770 wifi wifi chmod 2770 /dev/socket/wifihal - # Create /data/time folder for time-services - mkdir /data/vendor/time/ 0700 system system - setprop vold.post_fs_data_done 1 #Create a folder for SRS to be able to create a usercfg file @@ -797,12 +793,6 @@ service poweroffhandler /system/vendor/bin/poweroffhandler disabled oneshot -service time_daemon /vendor/bin/time_daemon - class main - user system - group system - capabilities SYS_TIME - # Set vendor-ril lib path based on Meta version on property:vendor.rild.libpath=* setprop rild.libpath ${vendor.rild.libpath} diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index 996aa2c..ec7da7c 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -30,3 +30,6 @@ /vendor/bin/hw/android\.hardware\.thermal@2\.0-service\.pixel u:object_r:hal_thermal_default_exec:s0 /vendor/bin/thermal_symlinks u:object_r:init-thermal-symlinks-sh_exec:s0 /dev/thermal(/.*)? u:object_r:thermal_link_device:s0 + +# Time +/vendor/bin/timekeep u:object_r:timekeep_exec:s0 diff --git a/sepolicy/vendor/property.te b/sepolicy/vendor/property.te index 40e2e7e..af43571 100644 --- a/sepolicy/vendor/property.te +++ b/sepolicy/vendor/property.te @@ -2,4 +2,6 @@ vendor_internal_prop(vendor_power_prop) vendor_internal_prop(vendor_thermal_prop) +vendor_internal_prop(vendor_timekeep_prop) + vendor_restricted_prop(vendor_fingerprint_prop) diff --git a/sepolicy/vendor/property_contexts b/sepolicy/vendor/property_contexts index e406adf..276133a 100644 --- a/sepolicy/vendor/property_contexts +++ b/sepolicy/vendor/property_contexts @@ -16,3 +16,6 @@ vendor.powerhal.rendering u:object_r:vendor_power_prop:s0 # Thermal vendor.thermal. u:object_r:vendor_thermal_prop:s0 + +# Time +persist.vendor.timeadjust u:object_r:vendor_timekeep_prop:s0 diff --git a/sepolicy/vendor/seapp_contexts b/sepolicy/vendor/seapp_contexts new file mode 100644 index 0000000..f0e9bc8 --- /dev/null +++ b/sepolicy/vendor/seapp_contexts @@ -0,0 +1 @@ +user=system seinfo=platform name=com.sony.timekeep domain=vendor_timekeep_app diff --git a/sepolicy/vendor/timekeep.te b/sepolicy/vendor/timekeep.te new file mode 100644 index 0000000..0631c89 --- /dev/null +++ b/sepolicy/vendor/timekeep.te @@ -0,0 +1,13 @@ +type timekeep, domain; +type timekeep_exec, exec_type, vendor_file_type, file_type; + +init_daemon_domain(timekeep) + +allow timekeep self:capability sys_time; + +allow timekeep vendor_time_data_file:dir rw_dir_perms; +allow timekeep vendor_time_data_file:file create_file_perms; + +r_dir_file(timekeep, sysfs_rtc) + +set_prop(timekeep, vendor_timekeep_prop) diff --git a/sepolicy/vendor/timekeep_app.te b/sepolicy/vendor/timekeep_app.te new file mode 100644 index 0000000..c33953a --- /dev/null +++ b/sepolicy/vendor/timekeep_app.te @@ -0,0 +1,12 @@ +type vendor_timekeep_app, domain; + +app_domain(vendor_timekeep_app) + +allow vendor_timekeep_app activity_service:service_manager find; + +allow vendor_timekeep_app vendor_time_data_file:dir search; +allow vendor_timekeep_app vendor_time_data_file:file create_file_perms; + +r_dir_file(vendor_timekeep_app, sysfs_rtc) + +set_prop(vendor_timekeep_app, vendor_timekeep_prop)