author | Tellen Yu <tellen.yu@amlogic.com> | 2019-12-24 03:24:26 (GMT) |
---|---|---|
committer | Tellen Yu <tellen.yu@amlogic.com> | 2020-01-22 06:33:47 (GMT) |
commit | 1124035ef0006c65e2bcd2fe1a811e0068597581 (patch) | |
tree | a5a79869449b70a2dae7debaf0bb63f6d0a12f08 | |
parent | 8f1afeccacd57e0c19f7e557e7bfaf765b789546 (diff) | |
download | common-1124035ef0006c65e2bcd2fe1a811e0068597581.zip common-1124035ef0006c65e2bcd2fe1a811e0068597581.tar.gz common-1124035ef0006c65e2bcd2fe1a811e0068597581.tar.bz2 |
thermal2: add thermal 2.0 hidl service [1/2]
PD#SWPL-18881
BUG=146310857
Problem:
A set of Thermal APIs were added in API level 29.
https://developer.android.com/about/versions/10/features#thermal
Solution:
add thermal 2.0 HIDL service to implement it.
Verify:
Newton
Change-Id: Ie054f637675599c4eb335dc58026d855a7b0a736
Signed-off-by: Tellen Yu <tellen.yu@amlogic.com>
-rwxr-xr-x | core_amlogic.mk | 10 | ||||
-rwxr-xr-x | hidl_manifests/manifest_common.xml | 9 | ||||
-rwxr-xr-x | sepolicy/file.te | 1 | ||||
-rwxr-xr-x | sepolicy/file_contexts | 7 | ||||
-rw-r--r-- | sepolicy/hal_thermal_default.te | 4 | ||||
-rwxr-xr-x | thermal_info_config.json | 29 |
6 files changed, 45 insertions, 15 deletions
diff --git a/core_amlogic.mk b/core_amlogic.mk index 9b73c95..860a007 100755 --- a/core_amlogic.mk +++ b/core_amlogic.mk @@ -200,8 +200,7 @@ PRODUCT_PACKAGES += \ power.amlogic \ hwcomposer.amlogic \ memtrack.amlogic \ - screen_source.amlogic \ - thermal.amlogic + screen_source.amlogic #glscaler and 3d format api PRODUCT_PACKAGES += \ @@ -437,8 +436,11 @@ PRODUCT_PACKAGES += \ #thermal hal PRODUCT_PACKAGES += \ - android.hardware.thermal@1.0-impl \ - android.hardware.thermal@1.0-service + android.hardware.thermal@2.0-service.droidlogic + +#normally, every device need a config file, currently all chips are the same +PRODUCT_COPY_FILES += \ + device/amlogic/common/thermal_info_config.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config.json PRODUCT_PACKAGES += \ android.hardware.cas@1.1-service diff --git a/hidl_manifests/manifest_common.xml b/hidl_manifests/manifest_common.xml index 565bf65..3ff4c7a 100755 --- a/hidl_manifests/manifest_common.xml +++ b/hidl_manifests/manifest_common.xml @@ -203,15 +203,6 @@ </interface> </hal> <hal format="hidl"> - <name>android.hardware.thermal</name> - <transport>hwbinder</transport> - <version>1.0</version> - <interface> - <name>IThermal</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl"> <name>android.hardware.light</name> <transport>hwbinder</transport> <version>2.0</version> diff --git a/sepolicy/file.te b/sepolicy/file.te index 5aa4025..53dfbc7 100755 --- a/sepolicy/file.te +++ b/sepolicy/file.te @@ -61,7 +61,6 @@ type sysfs_store, fs_type, sysfs_type; type sysfs_defendkey, fs_type, sysfs_type; #type sysfs_usb, fs_type, sysfs_type; type sysfs_boottype, fs_type, sysfs_type; -#type sysfs_thermal, fs_type, sysfs_type; type sysfs_amhdmitx, fs_type, sysfs_type; type sysfs_amvdec, fs_type, sysfs_type; type sysfs_remote, fs_type, sysfs_type; diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts index 92f55f0..a3d9f80 100755 --- a/sepolicy/file_contexts +++ b/sepolicy/file_contexts @@ -210,7 +210,11 @@ /sys/class/android_usb(/.*)? u:object_r:sysfs_usb:s0 /sys/class/dual_role_usb(/.*)? u:object_r:sysfs_usb:s0 /sys/power/boot_type u:object_r:sysfs_boottype:s0 -/sys/class/thermal/thermal_zone0/temp u:object_r:sysfs_thermal:s0 +#/sys/class/thermal/thermal_zone0/temp u:object_r:sysfs_thermal:s0 + +/sys/devices/virtual/thermal/thermal_zone[0-1](/.*) u:object_r:sysfs_thermal:s0 +/sys/devices/virtual/thermal/cooling_device[0-3](/.*) u:object_r:sysfs_thermal:s0 + /sys/class/amhdmitx/amhdmitx0/sink_type u:object_r:sysfs_amhdmitx:s0 /sys/class/amhdmitx/amhdmitx0/edid_parsing u:object_r:sysfs_amhdmitx:s0 /sys/class/amhdmitx/amhdmitx0/hdcp_mode u:object_r:sysfs_amhdmitx:s0 @@ -301,6 +305,7 @@ /vendor/bin/hw/android\.hardware\.drm@1\.2-service\.clearkey u:object_r:hal_drm_clearkey_exec:s0 /vendor/bin/hw/android\.hardware\.power\.stats@1\.0-service\.mock u:object_r:hal_power_stats_default_exec:s0 /vendor/bin/hw/android\.hardware\.graphics\.composer@2\.3-service\.droidlogic u:object_r:hal_graphics_composer_default_exec:s0 +/vendor/bin/hw/android\.hardware\.thermal@2\.0-service.droidlogic u:object_r:hal_thermal_default_exec:s0 /data/vendor/mediadrm(/.*)? u:object_r:hal_drm_data:s0 diff --git a/sepolicy/hal_thermal_default.te b/sepolicy/hal_thermal_default.te index 815a6cb..6d27168 100644 --- a/sepolicy/hal_thermal_default.te +++ b/sepolicy/hal_thermal_default.te @@ -1,3 +1,7 @@ allow hal_thermal_default sysfs:dir { open read }; allow hal_thermal_default sysfs:file { open read }; allow hal_thermal_default proc_stat:file { r_file_perms }; + +allow hal_thermal_default sysfs_thermal:file r_file_perms; +allow hal_thermal_default self:netlink_kobject_uevent_socket { create setopt getopt bind read }; + diff --git a/thermal_info_config.json b/thermal_info_config.json new file mode 100755 index 0000000..53f38f4 --- a/dev/null +++ b/thermal_info_config.json @@ -0,0 +1,29 @@ +{ + "Sensors":[ + { + "Name":"soc_thermal", + "Type":"CPU", + "HotThreshold":[ + "NAN", + 65.0, + 75.0, + 95.0, + "NAN", + 105.0, + 110.0 + ], + "Multiplier":0.001, + "Monitor":true + } + ], + "CoolingDevices":[ + { + "Name":"thermal-cpufreq-0", + "Type":"CPU" + }, + { + "Name":"thermal-gpufreq-0", + "Type":"GPU" + } + ] +} |