From cefd104891bd857e62054353de5d48017d89658e Mon Sep 17 00:00:00 2001 From: Alexander Winkowski Date: Fri, 6 Aug 2021 08:29:39 +0200 Subject: [PATCH] sm6250-common: thermal: Rebrand to Xiaomi SM6250 Change-Id: Iafa72da14648a2652df9b64a02dd6e5b9fa8bd9b --- atoll.mk | 2 +- sepolicy/vendor/file_contexts | 2 +- thermal/Android.bp | 15 +++-------- ...dware.thermal@2.0-service.xiaomi_atoll.rc} | 2 +- ...ware.thermal@2.0-service.xiaomi_atoll.xml} | 0 thermal/init.thermal.logging.sh | 25 ------------------- thermal/pixel-thermal-logd.rc | 14 ----------- thermal/service.cpp | 6 ++--- 8 files changed, 9 insertions(+), 57 deletions(-) rename thermal/{android.hardware.thermal@2.0-service.pixel.rc => android.hardware.thermal@2.0-service.xiaomi_atoll.rc} (87%) rename thermal/{android.hardware.thermal@2.0-service.pixel.xml => android.hardware.thermal@2.0-service.xiaomi_atoll.xml} (100%) delete mode 100755 thermal/init.thermal.logging.sh delete mode 100644 thermal/pixel-thermal-logd.rc diff --git a/atoll.mk b/atoll.mk index 32689d7..9ea6e42 100644 --- a/atoll.mk +++ b/atoll.mk @@ -353,7 +353,7 @@ PRODUCT_BOOT_JARS += \ # Thermal HAL PRODUCT_PACKAGES += \ - android.hardware.thermal@2.0-service.pixel + android.hardware.thermal@2.0-service.xiaomi_atoll PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/configs/thermal_info_config.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config.json diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index c73df8f..aac47cd 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -8,4 +8,4 @@ /vendor/bin/hw/android\.hardware\.power-service\.xiaomi-libperfmgr u:object_r:hal_power_default_exec:s0 # Thermal -/vendor/bin/hw/android\.hardware\.thermal@2\.0-service\.pixel u:object_r:hal_thermal_default_exec:s0 +/vendor/bin/hw/android\.hardware\.thermal@2\.0-service\.xiaomi_atoll u:object_r:hal_thermal_default_exec:s0 diff --git a/thermal/Android.bp b/thermal/Android.bp index a305521..5f44cfe 100644 --- a/thermal/Android.bp +++ b/thermal/Android.bp @@ -1,13 +1,13 @@ cc_binary { - name: "android.hardware.thermal@2.0-service.pixel", + name: "android.hardware.thermal@2.0-service.xiaomi_atoll", defaults: [ "hidl_defaults", ], vendor: true, relative_install_path: "hw", - vintf_fragments: ["android.hardware.thermal@2.0-service.pixel.xml"], + vintf_fragments: ["android.hardware.thermal@2.0-service.xiaomi_atoll.xml"], init_rc: [ - "android.hardware.thermal@2.0-service.pixel.rc", + "android.hardware.thermal@2.0-service.xiaomi_atoll.rc", ], srcs: [ "service.cpp", @@ -45,12 +45,3 @@ cc_binary { "-warnings-as-errors=android-*,clang-analyzer-security*,cert-*" ], } - -sh_binary { - name: "thermal_logd", - src: "init.thermal.logging.sh", - vendor: true, - init_rc: [ - "pixel-thermal-logd.rc", - ], -} diff --git a/thermal/android.hardware.thermal@2.0-service.pixel.rc b/thermal/android.hardware.thermal@2.0-service.xiaomi_atoll.rc similarity index 87% rename from thermal/android.hardware.thermal@2.0-service.pixel.rc rename to thermal/android.hardware.thermal@2.0-service.xiaomi_atoll.rc index fd2735b..2bd33d7 100644 --- a/thermal/android.hardware.thermal@2.0-service.pixel.rc +++ b/thermal/android.hardware.thermal@2.0-service.xiaomi_atoll.rc @@ -1,4 +1,4 @@ -service vendor.thermal-hal-2-0 /vendor/bin/hw/android.hardware.thermal@2.0-service.pixel +service vendor.thermal-hal-2-0 /vendor/bin/hw/android.hardware.thermal@2.0-service.xiaomi_atoll interface android.hardware.thermal@1.0::IThermal default interface android.hardware.thermal@2.0::IThermal default class hal diff --git a/thermal/android.hardware.thermal@2.0-service.pixel.xml b/thermal/android.hardware.thermal@2.0-service.xiaomi_atoll.xml similarity index 100% rename from thermal/android.hardware.thermal@2.0-service.pixel.xml rename to thermal/android.hardware.thermal@2.0-service.xiaomi_atoll.xml diff --git a/thermal/init.thermal.logging.sh b/thermal/init.thermal.logging.sh deleted file mode 100755 index de385ab..0000000 --- a/thermal/init.thermal.logging.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/vendor/bin/sh - -if [ $# -eq 1 ]; then - interval=$1 -else - exit 1 -fi - -while true -do - logline="tz:" - for f in /sys/class/thermal/thermal* - do - temp=`cat $f/temp` - logline+="|$temp" - done - logline+=" cdev:" - for f in /sys/class/thermal/cooling_device* - do - cur_state=`cat $f/cur_state` - logline+="|$cur_state" - done - log -p w -t THERMAL_LOG $logline - sleep $interval -done diff --git a/thermal/pixel-thermal-logd.rc b/thermal/pixel-thermal-logd.rc deleted file mode 100644 index c69282d..0000000 --- a/thermal/pixel-thermal-logd.rc +++ /dev/null @@ -1,14 +0,0 @@ -on property:persist.vendor.log.thermal=1 - start vendor.thermal.logd - -on property:persist.vendor.log.thermal=0 - stop vendor.thermal.logd - -on property:persist.vendor.log.thermal=1 && property:persist.vendor.log.thermal.interval=* - restart vendor.thermal.logd - -service vendor.thermal.logd /vendor/bin/thermal_logd ${persist.vendor.log.thermal.interval:-5} - class main - user root - group root system - disabled diff --git a/thermal/service.cpp b/thermal/service.cpp index 190269b..36166b0 100644 --- a/thermal/service.cpp +++ b/thermal/service.cpp @@ -29,7 +29,7 @@ using ::android::hardware::thermal::V2_0::IThermal; using ::android::hardware::thermal::V2_0::implementation::Thermal; static int shutdown() { - LOG(ERROR) << "Pixel Thermal HAL Service is shutting down."; + LOG(ERROR) << "Xiaomi SM6250 Thermal HAL Service is shutting down."; return 1; } @@ -37,7 +37,7 @@ int main(int /* argc */, char ** /* argv */) { status_t status; android::sp service = nullptr; - LOG(INFO) << "Pixel Thermal HAL Service 2.0 starting..."; + LOG(INFO) << "Xiaomi SM6250 Thermal HAL Service 2.0 starting..."; service = new Thermal(); if (service == nullptr) { @@ -53,7 +53,7 @@ int main(int /* argc */, char ** /* argv */) { return shutdown(); } - LOG(INFO) << "Pixel Thermal HAL Service 2.0 started successfully."; + LOG(INFO) << "Xiaomi SM6250 Thermal HAL Service 2.0 started successfully."; joinRpcThreadpool(); // We should not get past the joinRpcThreadpool(). return shutdown();