aidl: thermal: Rebrand to samsung
authorTim Zimmermann <tim@linux4.de>
Sun, 12 Nov 2023 05:46:19 +0000 (06:46 +0100)
committerTim Zimmermann <tim@linux4.de>
Sat, 20 Jan 2024 12:52:29 +0000 (13:52 +0100)
Change-Id: I381364e55b1e36e11f5a659ee07cd734ff397bae

aidl/thermal/Android.bp
aidl/thermal/android.hardware.thermal-service.pixel.rc [deleted file]
aidl/thermal/android.hardware.thermal-service.pixel.xml [deleted file]
aidl/thermal/android.hardware.thermal-service.samsung.rc [new file with mode: 0644]
aidl/thermal/android.hardware.thermal-service.samsung.xml [new file with mode: 0644]
aidl/thermal/pixel-thermal-logd.rc [deleted file]
aidl/thermal/pixel-thermal-symlinks.rc [deleted file]
aidl/thermal/samsung-thermal-logd.rc [new file with mode: 0644]
aidl/thermal/samsung-thermal-symlinks.rc [new file with mode: 0644]
aidl/thermal/service.cpp

index 5f426f9ca92b9291ed328c3a2cfef605ef1bec76..d2c03c5e2b793bdfa9302887bf5502d821343a85 100644 (file)
@@ -1,5 +1,5 @@
 cc_binary {
-  name: "android.hardware.thermal-service.pixel",
+  name: "android.hardware.thermal-service.samsung",
   srcs: [
     "service.cpp",
     "Thermal.cpp",
@@ -15,10 +15,10 @@ cc_binary {
   vendor: true,
   relative_install_path: "hw",
   vintf_fragments: [
-    "android.hardware.thermal-service.pixel.xml"
+    "android.hardware.thermal-service.samsung.xml"
   ],
   init_rc: [
-    "android.hardware.thermal-service.pixel.rc",
+    "android.hardware.thermal-service.samsung.rc",
   ],
   shared_libs: [
     "libbase",
@@ -60,19 +60,19 @@ cc_binary {
 }
 
 sh_binary {
-  name: "thermal_logd",
+  name: "thermal_logd.samsung",
   src: "init.thermal.logging.sh",
   vendor: true,
   init_rc: [
-    "pixel-thermal-logd.rc",
+    "samsung-thermal-logd.rc",
   ],
 }
 
 sh_binary {
-  name: "thermal_symlinks",
+  name: "thermal_symlinks.samsung",
   src: "init.thermal.symlinks.sh",
   vendor: true,
   init_rc: [
-    "pixel-thermal-symlinks.rc",
+    "samsung-thermal-symlinks.rc",
   ],
 }
diff --git a/aidl/thermal/android.hardware.thermal-service.pixel.rc b/aidl/thermal/android.hardware.thermal-service.pixel.rc
deleted file mode 100644 (file)
index f9f823b..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-on property:vendor.thermal.link_ready=1
-    # queue the trigger to start thermal-hal and continue execute
-    # per-device thermal setup "on property:vendor.thermal.link_ready=1"
-    trigger enable-thermal-hal
-
-on enable-thermal-hal
-    restart vendor.thermal-hal
-
-service vendor.thermal-hal /vendor/bin/hw/android.hardware.thermal-service.pixel
-    class hal
-    user system
-    group system
-    priority -20
-    disabled
diff --git a/aidl/thermal/android.hardware.thermal-service.pixel.xml b/aidl/thermal/android.hardware.thermal-service.pixel.xml
deleted file mode 100644 (file)
index bdee744..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<manifest version="1.0" type="device">
-    <hal format="aidl">
-        <name>android.hardware.thermal</name>
-        <version>1</version>
-        <fqname>IThermal/default</fqname>
-    </hal>
-</manifest>
diff --git a/aidl/thermal/android.hardware.thermal-service.samsung.rc b/aidl/thermal/android.hardware.thermal-service.samsung.rc
new file mode 100644 (file)
index 0000000..03eb6aa
--- /dev/null
@@ -0,0 +1,14 @@
+on property:vendor.thermal.link_ready=1
+    # queue the trigger to start thermal-hal and continue execute
+    # per-device thermal setup "on property:vendor.thermal.link_ready=1"
+    trigger enable-thermal-hal
+
+on enable-thermal-hal
+    restart vendor.thermal-hal
+
+service vendor.thermal-hal /vendor/bin/hw/android.hardware.thermal-service.samsung
+    class hal
+    user system
+    group system
+    priority -20
+    disabled
diff --git a/aidl/thermal/android.hardware.thermal-service.samsung.xml b/aidl/thermal/android.hardware.thermal-service.samsung.xml
new file mode 100644 (file)
index 0000000..bdee744
--- /dev/null
@@ -0,0 +1,7 @@
+<manifest version="1.0" type="device">
+    <hal format="aidl">
+        <name>android.hardware.thermal</name>
+        <version>1</version>
+        <fqname>IThermal/default</fqname>
+    </hal>
+</manifest>
diff --git a/aidl/thermal/pixel-thermal-logd.rc b/aidl/thermal/pixel-thermal-logd.rc
deleted file mode 100644 (file)
index c2ec9ff..0000000
+++ /dev/null
@@ -1,130 +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
-
-# Switch thermal protection for Pixels
-on property:persist.vendor.disable.thermal.control=*
-    setprop vendor.disable.thermal.control ${persist.vendor.disable.thermal.control}
-
-on property:persist.vendor.disable.thermalhal.control=*
-    setprop vendor.disable.thermalhal.control ${persist.vendor.disable.thermalhal.control}
-
-on property:persist.vendor.disable.usb.overheat.mitigation=*
-    setprop vendor.disable.usb.overheat.mitigation.control ${persist.vendor.disable.usb.overheat.mitigation}
-
-on property:persist.vendor.disable.bcl.control=*
-    setprop vendor.disable.bcl.control ${persist.vendor.disable.bcl.control}
-
-on property:vendor.disable.thermalhal.control=* && property:vendor.thermal.link_ready=1
-    restart vendor.thermal-hal
-
-on property:vendor.disable.thermal.control=1 && property:vendor.thermal.link_ready=1
-    # common
-    stop vendor.thermal-engine
-    setprop vendor.disable.thermalhal.control 1
-    # sdm845
-    write /dev/thermal/tz-by-name/quiet-therm-adc/mode disabled
-    write /dev/thermal/tz-by-name/quiet-therm-monitor/mode disabled
-    write /dev/thermal/tz-by-name/fps-therm-adc/mode disabled
-    write /dev/thermal/tz-by-name/fps-therm-monitor/mode disabled
-    # sdm670
-    write /dev/thermal/tz-by-name/mb-therm-adc/mode disabled
-    write /dev/thermal/tz-by-name/mb-therm-monitor/mode disabled
-    # sm8150
-    write /dev/thermal/tz-by-name/sdm-therm/mode disabled
-    write /dev/thermal/tz-by-name/sdm-therm-monitor/mode disabled
-    # sm7150
-    write /dev/thermal/tz-by-name/skin-therm-adc/mode disabled
-    write /dev/thermal/tz-by-name/skin-therm-monitor/mode disabled
-    # sm7250
-    write /dev/thermal/tz-by-name/skin-therm/emul_temp 25000
-    write /dev/thermal/tz-by-name/skin-therm/mode disabled
-    write /dev/thermal/tz-by-name/skin-virt/emul_temp 25000
-    write /dev/thermal/tz-by-name/skin-virt/mode disabled
-    write /dev/thermal/tz-by-name/skin-therm-cpu/emul_temp 25000
-    write /dev/thermal/tz-by-name/skin-therm-cpu/mode disabled
-    write /dev/thermal/tz-by-name/skin-virt-cpu/emul_temp 25000
-    write /dev/thermal/tz-by-name/skin-virt-cpu/mode disabled
-    write /dev/thermal/tz-by-name/skin-therm-monitor/emul_temp 25000
-    write /dev/thermal/tz-by-name/skin-therm-monitor/mode disabled
-    write /dev/thermal/tz-by-name/skin-virt-monitor/emul_temp 25000
-    write /dev/thermal/tz-by-name/skin-virt-monitor/mode disabled
-    write /dev/thermal/tz-by-name/panel-audio-therm/emul_temp 25000
-    write /dev/thermal/tz-by-name/panel-audio-therm/mode disabled
-    write /dev/thermal/tz-by-name/cellular-emergency/emul_temp 25000
-    write /dev/thermal/tz-by-name/cellular-emergency/mode disabled
-    write /dev/thermal/tz-by-name/sdm-therm/emul_temp 25000
-    write /dev/thermal/tz-by-name/sdm-therm/mode disabled
-    write /dev/thermal/tz-by-name/charger-therm/emul_temp 25000
-    write /dev/thermal/tz-by-name/charger-therm/mode disabled
-    # P21
-    write /dev/thermal/tz-by-name/disp_therm/mode disabled
-
-on property:vendor.disable.thermal.control=0 && property:vendor.thermal.link_ready=1
-    # common
-    start vendor.thermal-engine
-    setprop vendor.disable.thermalhal.control 0
-    # sdm845
-    write /dev/thermal/tz-by-name/quiet-therm-adc/mode enabled
-    write /dev/thermal/tz-by-name/quiet-therm-monitor/mode enabled
-    write /dev/thermal/tz-by-name/fps-therm-adc/mode enabled
-    write /dev/thermal/tz-by-name/fps-therm-monitor/mode enabled
-    # sdm670
-    write /dev/thermal/tz-by-name/mb-therm-adc/mode enabled
-    write /dev/thermal/tz-by-name/mb-therm-monitor/mode enabled
-    # sm8150
-    write /dev/thermal/tz-by-name/sdm-therm/mode enabled
-    write /dev/thermal/tz-by-name/sdm-therm-monitor/mode enabled
-    # sm7150
-    write /dev/thermal/tz-by-name/skin-therm-adc/mode enabled
-    write /dev/thermal/tz-by-name/skin-therm-monitor/mode enabled
-    # sm7250
-    write /dev/thermal/tz-by-name/skin-therm/emul_temp 0
-    write /dev/thermal/tz-by-name/skin-therm/mode enabled
-    write /dev/thermal/tz-by-name/skin-virt/emul_temp 0
-    write /dev/thermal/tz-by-name/skin-virt/mode enabled
-    write /dev/thermal/tz-by-name/skin-therm-cpu/emul_temp 0
-    write /dev/thermal/tz-by-name/skin-therm-cpu/mode enabled
-    write /dev/thermal/tz-by-name/skin-virt-cpu/emul_temp 0
-    write /dev/thermal/tz-by-name/skin-virt-cpu/mode enabled
-    write /dev/thermal/tz-by-name/skin-therm-monitor/emul_temp 0
-    write /dev/thermal/tz-by-name/skin-therm-monitor/mode enabled
-    write /dev/thermal/tz-by-name/skin-virt-monitor/emul_temp 0
-    write /dev/thermal/tz-by-name/skin-virt-monitor/mode enabled
-    write /dev/thermal/tz-by-name/panel-audio-therm/emul_temp 0
-    write /dev/thermal/tz-by-name/panel-audio-therm/mode enabled
-    write /dev/thermal/tz-by-name/cellular-emergency/emul_temp 0
-    write /dev/thermal/tz-by-name/cellular-emergency/mode enabled
-    write /dev/thermal/tz-by-name/sdm-therm/emul_temp 0
-    write /dev/thermal/tz-by-name/sdm-therm/mode enabled
-    write /dev/thermal/tz-by-name/charger-therm/emul_temp 0
-    write /dev/thermal/tz-by-name/charger-therm/mode enabled
-    # P21
-    write /dev/thermal/tz-by-name/disp_therm/mode enabled
-
-# Toggle BCL control
-on property:vendor.disable.bcl.control=1
-    write /dev/thermal/tz-by-name/soc/mode disabled
-
-on property:vendor.disable.bcl.control=0
-    write /dev/thermal/tz-by-name/soc/mode enabled
-
-# Switch USB port overheat protection
-on property:vendor.disable.usb.overheat.mitigation.control=1
-    write /sys/module/overheat_mitigation/parameters/enable 0
-    write /dev/thermal/tz-by-name/usb_pwr_therm2/emul_temp 25000
-
-on property:vendor.disable.usb.overheat.mitigation.control=0
-    write /sys/module/overheat_mitigation/parameters/enable 1
-    write /dev/thermal/tz-by-name/usb_pwr_therm2/emul_temp 0
diff --git a/aidl/thermal/pixel-thermal-symlinks.rc b/aidl/thermal/pixel-thermal-symlinks.rc
deleted file mode 100644 (file)
index 132ec5f..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-on boot
-    mkdir /dev/thermal 0750 system system
-    mkdir /dev/thermal/tz-by-name 0750 system system
-    mkdir /dev/thermal/cdev-by-name 0750 system system
-    start vendor.thermal.symlinks
-
-service vendor.thermal.symlinks /vendor/bin/thermal_symlinks
-    user system
-    group system
-    oneshot
-    disabled
diff --git a/aidl/thermal/samsung-thermal-logd.rc b/aidl/thermal/samsung-thermal-logd.rc
new file mode 100644 (file)
index 0000000..fe14f1f
--- /dev/null
@@ -0,0 +1,130 @@
+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.samsung ${persist.vendor.log.thermal.interval:-5}
+    class main
+    user root
+    group root system
+    disabled
+
+# Switch thermal protection for Pixels
+on property:persist.vendor.disable.thermal.control=*
+    setprop vendor.disable.thermal.control ${persist.vendor.disable.thermal.control}
+
+on property:persist.vendor.disable.thermalhal.control=*
+    setprop vendor.disable.thermalhal.control ${persist.vendor.disable.thermalhal.control}
+
+on property:persist.vendor.disable.usb.overheat.mitigation=*
+    setprop vendor.disable.usb.overheat.mitigation.control ${persist.vendor.disable.usb.overheat.mitigation}
+
+on property:persist.vendor.disable.bcl.control=*
+    setprop vendor.disable.bcl.control ${persist.vendor.disable.bcl.control}
+
+on property:vendor.disable.thermalhal.control=* && property:vendor.thermal.link_ready=1
+    restart vendor.thermal-hal
+
+on property:vendor.disable.thermal.control=1 && property:vendor.thermal.link_ready=1
+    # common
+    stop vendor.thermal-engine
+    setprop vendor.disable.thermalhal.control 1
+    # sdm845
+    write /dev/thermal/tz-by-name/quiet-therm-adc/mode disabled
+    write /dev/thermal/tz-by-name/quiet-therm-monitor/mode disabled
+    write /dev/thermal/tz-by-name/fps-therm-adc/mode disabled
+    write /dev/thermal/tz-by-name/fps-therm-monitor/mode disabled
+    # sdm670
+    write /dev/thermal/tz-by-name/mb-therm-adc/mode disabled
+    write /dev/thermal/tz-by-name/mb-therm-monitor/mode disabled
+    # sm8150
+    write /dev/thermal/tz-by-name/sdm-therm/mode disabled
+    write /dev/thermal/tz-by-name/sdm-therm-monitor/mode disabled
+    # sm7150
+    write /dev/thermal/tz-by-name/skin-therm-adc/mode disabled
+    write /dev/thermal/tz-by-name/skin-therm-monitor/mode disabled
+    # sm7250
+    write /dev/thermal/tz-by-name/skin-therm/emul_temp 25000
+    write /dev/thermal/tz-by-name/skin-therm/mode disabled
+    write /dev/thermal/tz-by-name/skin-virt/emul_temp 25000
+    write /dev/thermal/tz-by-name/skin-virt/mode disabled
+    write /dev/thermal/tz-by-name/skin-therm-cpu/emul_temp 25000
+    write /dev/thermal/tz-by-name/skin-therm-cpu/mode disabled
+    write /dev/thermal/tz-by-name/skin-virt-cpu/emul_temp 25000
+    write /dev/thermal/tz-by-name/skin-virt-cpu/mode disabled
+    write /dev/thermal/tz-by-name/skin-therm-monitor/emul_temp 25000
+    write /dev/thermal/tz-by-name/skin-therm-monitor/mode disabled
+    write /dev/thermal/tz-by-name/skin-virt-monitor/emul_temp 25000
+    write /dev/thermal/tz-by-name/skin-virt-monitor/mode disabled
+    write /dev/thermal/tz-by-name/panel-audio-therm/emul_temp 25000
+    write /dev/thermal/tz-by-name/panel-audio-therm/mode disabled
+    write /dev/thermal/tz-by-name/cellular-emergency/emul_temp 25000
+    write /dev/thermal/tz-by-name/cellular-emergency/mode disabled
+    write /dev/thermal/tz-by-name/sdm-therm/emul_temp 25000
+    write /dev/thermal/tz-by-name/sdm-therm/mode disabled
+    write /dev/thermal/tz-by-name/charger-therm/emul_temp 25000
+    write /dev/thermal/tz-by-name/charger-therm/mode disabled
+    # P21
+    write /dev/thermal/tz-by-name/disp_therm/mode disabled
+
+on property:vendor.disable.thermal.control=0 && property:vendor.thermal.link_ready=1
+    # common
+    start vendor.thermal-engine
+    setprop vendor.disable.thermalhal.control 0
+    # sdm845
+    write /dev/thermal/tz-by-name/quiet-therm-adc/mode enabled
+    write /dev/thermal/tz-by-name/quiet-therm-monitor/mode enabled
+    write /dev/thermal/tz-by-name/fps-therm-adc/mode enabled
+    write /dev/thermal/tz-by-name/fps-therm-monitor/mode enabled
+    # sdm670
+    write /dev/thermal/tz-by-name/mb-therm-adc/mode enabled
+    write /dev/thermal/tz-by-name/mb-therm-monitor/mode enabled
+    # sm8150
+    write /dev/thermal/tz-by-name/sdm-therm/mode enabled
+    write /dev/thermal/tz-by-name/sdm-therm-monitor/mode enabled
+    # sm7150
+    write /dev/thermal/tz-by-name/skin-therm-adc/mode enabled
+    write /dev/thermal/tz-by-name/skin-therm-monitor/mode enabled
+    # sm7250
+    write /dev/thermal/tz-by-name/skin-therm/emul_temp 0
+    write /dev/thermal/tz-by-name/skin-therm/mode enabled
+    write /dev/thermal/tz-by-name/skin-virt/emul_temp 0
+    write /dev/thermal/tz-by-name/skin-virt/mode enabled
+    write /dev/thermal/tz-by-name/skin-therm-cpu/emul_temp 0
+    write /dev/thermal/tz-by-name/skin-therm-cpu/mode enabled
+    write /dev/thermal/tz-by-name/skin-virt-cpu/emul_temp 0
+    write /dev/thermal/tz-by-name/skin-virt-cpu/mode enabled
+    write /dev/thermal/tz-by-name/skin-therm-monitor/emul_temp 0
+    write /dev/thermal/tz-by-name/skin-therm-monitor/mode enabled
+    write /dev/thermal/tz-by-name/skin-virt-monitor/emul_temp 0
+    write /dev/thermal/tz-by-name/skin-virt-monitor/mode enabled
+    write /dev/thermal/tz-by-name/panel-audio-therm/emul_temp 0
+    write /dev/thermal/tz-by-name/panel-audio-therm/mode enabled
+    write /dev/thermal/tz-by-name/cellular-emergency/emul_temp 0
+    write /dev/thermal/tz-by-name/cellular-emergency/mode enabled
+    write /dev/thermal/tz-by-name/sdm-therm/emul_temp 0
+    write /dev/thermal/tz-by-name/sdm-therm/mode enabled
+    write /dev/thermal/tz-by-name/charger-therm/emul_temp 0
+    write /dev/thermal/tz-by-name/charger-therm/mode enabled
+    # P21
+    write /dev/thermal/tz-by-name/disp_therm/mode enabled
+
+# Toggle BCL control
+on property:vendor.disable.bcl.control=1
+    write /dev/thermal/tz-by-name/soc/mode disabled
+
+on property:vendor.disable.bcl.control=0
+    write /dev/thermal/tz-by-name/soc/mode enabled
+
+# Switch USB port overheat protection
+on property:vendor.disable.usb.overheat.mitigation.control=1
+    write /sys/module/overheat_mitigation/parameters/enable 0
+    write /dev/thermal/tz-by-name/usb_pwr_therm2/emul_temp 25000
+
+on property:vendor.disable.usb.overheat.mitigation.control=0
+    write /sys/module/overheat_mitigation/parameters/enable 1
+    write /dev/thermal/tz-by-name/usb_pwr_therm2/emul_temp 0
diff --git a/aidl/thermal/samsung-thermal-symlinks.rc b/aidl/thermal/samsung-thermal-symlinks.rc
new file mode 100644 (file)
index 0000000..fc2e38b
--- /dev/null
@@ -0,0 +1,11 @@
+on boot
+    mkdir /dev/thermal 0750 system system
+    mkdir /dev/thermal/tz-by-name 0750 system system
+    mkdir /dev/thermal/cdev-by-name 0750 system system
+    start vendor.thermal.symlinks
+
+service vendor.thermal.symlinks /vendor/bin/thermal_symlinks.samsung
+    user system
+    group system
+    oneshot
+    disabled
index d18a0693b187c900be1001600b295124afd1edee..0e10d7b150df1ae8b5ef62da1390b6ecd679f88f 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "Thermal.h"
 
-constexpr std::string_view kThermalLogTag("pixel-thermal");
+constexpr std::string_view kThermalLogTag("samsung-thermal");
 
 using ::android::OK;
 using ::android::status_t;
@@ -36,16 +36,16 @@ int main(int /* argc */, char ** /* argv */) {
 
     auto svc = ndk::SharedRefBase::make<Thermal>();
     const auto svcName = std::string() + svc->descriptor + "/" + THERMAL_INSTANCE_NAME;
-    LOG(INFO) << "Pixel Thermal AIDL Service starting..." + svcName;
+    LOG(INFO) << "Samsung Thermal AIDL Service starting..." + svcName;
     ABinderProcess_setThreadPoolMaxThreadCount(0);
 
     auto svcBinder = svc->asBinder();
     binder_status_t status = AServiceManager_addService(svcBinder.get(), svcName.c_str());
     if (status != STATUS_OK) {
-        LOG(ERROR) << "Pixel Thermal AIDL Service failed to start: " << status << ".";
+        LOG(ERROR) << "Samsung Thermal AIDL Service failed to start: " << status << ".";
         return EXIT_FAILURE;
     }
-    LOG(INFO) << "Pixel Thermal HAL AIDL Service started.";
+    LOG(INFO) << "Samsung Thermal HAL AIDL Service started.";
     ABinderProcess_joinThreadPool();
     return EXIT_FAILURE;  // should not reach
 }