From e7a4e4dfe2920d28435fe550021278726afc4206 Mon Sep 17 00:00:00 2001 From: Simon1511 Date: Sun, 24 Jul 2022 13:50:00 +0200 Subject: [PATCH] sm7125: A525FXXU4BVG1 *Patch RIL again since Samsung changed prop names *Update configs *Update sepolicy for new blob updates *dont allow rild and camera to access every prop, preventing log spam *Also import Samsung's thermal HAL since health blobs now depend on it. Label it as hal_thermal_samsung_hwservice since hal_thermal_hwservice is a neverallow in health sepolicy Change-Id: Ic6d699115c2e18f722b623e5a07e3a88e222f1f3 --- BoardConfigCommon.mk | 6 +- audio/PrimaryDevice.cpp | 30 +++++---- common.mk | 6 ++ .../audio/audio_platform_info_intcodec.xml | 6 +- configs/framework_compatibility_matrix.xml | 8 +++ configs/media/media_codecs.xml | 17 +++++- configs/media/media_codecs_performance.xml | 8 ++- extract-files.sh | 2 +- proprietary-files.txt | 28 ++++++--- rootdir/Android.mk | 8 +++ rootdir/etc/init.audio.samsung.rc | 7 ++- rootdir/etc/init.nfc.samsung.rc | 19 ++++++ rootdir/etc/init.qcom.usb.rc | 2 + rootdir/etc/init.samsung.display.rc | 12 +++- rootdir/etc/init.samsung.power.rc | 61 +++++++++++++++++++ rootdir/etc/init.samsung.rc | 13 ++-- rootdir/etc/wifi_qcom.rc | 10 ++- rootdir/etc/wifi_sec.rc | 2 +- sepolicy/vendor/file_contexts | 1 + sepolicy/vendor/genfs_contexts | 3 + sepolicy/vendor/hal_camera_default.te | 2 + sepolicy/vendor/hal_health_default.te | 4 ++ sepolicy/vendor/hal_thermal_default.te | 8 +++ sepolicy/vendor/hwservice.te | 2 + sepolicy/vendor/hwservice_contexts | 3 + sepolicy/vendor/macloader.te | 2 + sepolicy/vendor/property_contexts | 3 +- sepolicy/vendor/rild.te | 7 +++ sepolicy/vendor/vendor_hal_perf_default.te | 2 + vendor.prop | 1 + 30 files changed, 236 insertions(+), 47 deletions(-) create mode 100644 rootdir/etc/init.samsung.power.rc create mode 100644 sepolicy/vendor/hal_thermal_default.te create mode 100644 sepolicy/vendor/vendor_hal_perf_default.te diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index 78716d3..03c9ea6 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -176,10 +176,10 @@ TARGET_DISABLED_UBWC := true BOARD_USES_ADRENO := true # Fingerprint -BUILD_FINGERPRINT := "samsung/a52qnsxx/qssi:12/SP1A.210812.016/A525FXXS4BVA2:user/release-keys" -PRIVATE_BUILD_DESC := "a52qnsxx-user 12 SP1A.210812.016 A525FXXS4BVA2 release-keys" +BUILD_FINGERPRINT := "samsung/a52qnsxx/qssi:12/SP1A.210812.016/A525FXXU4BVG1:user/release-keys" +PRIVATE_BUILD_DESC := "a52qnsxx-user 12 SP1A.210812.016 A525FXXU4BVG1 release-keys" -VENDOR_SECURITY_PATCH := 2022-01-01 +VENDOR_SECURITY_PATCH := 2022-07-01 # FM BOARD_HAS_QCA_FM_SOC := cherokee diff --git a/audio/PrimaryDevice.cpp b/audio/PrimaryDevice.cpp index 6dc634a..9daf671 100644 --- a/audio/PrimaryDevice.cpp +++ b/audio/PrimaryDevice.cpp @@ -215,25 +215,29 @@ Return PrimaryDevice::setMode(AudioMode mode) { * For the g_call_sim_slot parameter 0x01 describes SIM1 and 0x02 SIM2. */ - char simSlot[92]; - - // This prop returns either -1 (no SIM is calling), - // 0 (SIM1 is calling) or 1 (SIM2 is calling) - property_get("vendor.calls.slotid", simSlot, ""); - - // Wait until RIL reports which SIM is being used - while (strcmp(simSlot, "-1") == 0 && mode == AudioMode::IN_CALL) { - std::this_thread::sleep_for(std::chrono::milliseconds(50)); - property_get("vendor.calls.slotid", simSlot, ""); + char simSlot1[92], simSlot2[92]; + + // These props return either 0 (not calling), + // or 1 (SIM is calling) + property_get("vendor.calls.ongoing0", simSlot1, ""); + property_get("vendor.calls.ongoing1", simSlot2, ""); + + // Wait until one sim slot reports a call + if (mode == AudioMode::IN_CALL) { + while (strcmp(simSlot1, "0") == 0 && strcmp(simSlot2, "0") == 0) { + std::this_thread::sleep_for(std::chrono::milliseconds(50)); + property_get("vendor.calls.ongoing0", simSlot1, ""); + property_get("vendor.calls.ongoing1", simSlot2, ""); + } } - if (strcmp(simSlot, "0") == 0) { + if (strcmp(simSlot1, "1") == 0) { // SIM1 mDevice->halSetParameters("call_state=2;g_call_state=2;g_call_sim_slot=0x01"); - } else if (strcmp(simSlot, "1") == 0) { + } else if (strcmp(simSlot2, "1") == 0) { // SIM2 mDevice->halSetParameters("call_state=2;g_call_state=2;g_call_sim_slot=0x02"); - } else if (strcmp(simSlot, "-1") == 0) { + } else if (strcmp(simSlot1, "0") == 0 && strcmp(simSlot2, "0") == 0) { // No call mDevice->halSetParameters("call_state=1;g_call_state=1"); } diff --git a/common.mk b/common.mk index 4909344..7f91839 100644 --- a/common.mk +++ b/common.mk @@ -43,6 +43,7 @@ PRODUCT_PACKAGES += \ init.samsung.bsp.rc \ init.samsung.display.rc \ init.samsung.rc \ + init.samsung.power.rc \ init.fingerprint.rc \ init.ramplus.rc \ init.target.rc \ @@ -380,6 +381,11 @@ PRODUCT_PACKAGES += \ android.hardware.sensors@2.1-service.samsung-multihal \ android.hardware.sensors@2.0-ScopedWakelock.vendor +# Thermal +PRODUCT_PACKAGES += \ + android.hardware.thermal@2.0.vendor \ + android.frameworks.cameraservice.service@2.1.vendor + # Touch features PRODUCT_PACKAGES += \ vendor.lineage.touch@1.0-service.samsung diff --git a/configs/audio/audio_platform_info_intcodec.xml b/configs/audio/audio_platform_info_intcodec.xml index b8a35f0..524befe 100644 --- a/configs/audio/audio_platform_info_intcodec.xml +++ b/configs/audio/audio_platform_info_intcodec.xml @@ -207,6 +207,8 @@ + + @@ -254,6 +256,8 @@ + + @@ -281,7 +285,7 @@ - + diff --git a/configs/framework_compatibility_matrix.xml b/configs/framework_compatibility_matrix.xml index e95e391..35b9d57 100644 --- a/configs/framework_compatibility_matrix.xml +++ b/configs/framework_compatibility_matrix.xml @@ -945,4 +945,12 @@ imsd2 + + vendor.samsung.hardware.thermal + 1.0 + + ISehThermal + default + + diff --git a/configs/media/media_codecs.xml b/configs/media/media_codecs.xml index c0b9894..0bc37ce 100644 --- a/configs/media/media_codecs.xml +++ b/configs/media/media_codecs.xml @@ -133,6 +133,7 @@ Only the three quirks included above are recognized at this point: + @@ -149,6 +150,7 @@ Only the three quirks included above are recognized at this point: + @@ -162,6 +164,7 @@ Only the three quirks included above are recognized at this point: + @@ -195,6 +198,7 @@ Only the three quirks included above are recognized at this point: + @@ -210,6 +214,7 @@ Only the three quirks included above are recognized at this point: + @@ -228,7 +233,7 @@ Only the three quirks included above are recognized at this point: - + @@ -246,6 +251,7 @@ Only the three quirks included above are recognized at this point: + @@ -260,6 +266,7 @@ Only the three quirks included above are recognized at this point: + @@ -274,6 +281,7 @@ Only the three quirks included above are recognized at this point: + @@ -288,6 +296,7 @@ Only the three quirks included above are recognized at this point: + @@ -303,6 +312,7 @@ Only the three quirks included above are recognized at this point: + @@ -320,6 +330,7 @@ Only the three quirks included above are recognized at this point: + @@ -333,6 +344,7 @@ Only the three quirks included above are recognized at this point: + @@ -350,6 +362,7 @@ Only the three quirks included above are recognized at this point: + @@ -364,6 +377,7 @@ Only the three quirks included above are recognized at this point: + @@ -378,6 +392,7 @@ Only the three quirks included above are recognized at this point: + diff --git a/configs/media/media_codecs_performance.xml b/configs/media/media_codecs_performance.xml index 458fbb2..d9aa58c 100644 --- a/configs/media/media_codecs_performance.xml +++ b/configs/media/media_codecs_performance.xml @@ -190,8 +190,12 @@ limitations under the License. - - + + + + + + diff --git a/extract-files.sh b/extract-files.sh index ee34516..2bcd6e9 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -66,7 +66,7 @@ BLOB_ROOT="$ANDROID_ROOT"/vendor/"$VENDOR"/"$DEVICE_COMMON"/proprietary function blob_fixup() { case "${1}" in vendor/lib64/libsec-ril.so) - sed -i 's/ril.dds.call.slotid/vendor.calls.slotid/g' "${2}" + sed -i 's/ril.dds.call.ongoing/vendor.calls.ongoing/g' "${2}" ;; esac } diff --git a/proprietary-files.txt b/proprietary-files.txt index ec1f1e2..2fb7cea 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -1,4 +1,4 @@ -# All blobs are from A525FXXS4BVA2, unless pinned +# All blobs are from A525FXXU4BVG1, unless pinned # ACDB vendor/lib/libacdb-fts.so @@ -38,7 +38,6 @@ vendor/lib/rfsa/adsp/libfastcvadsp.so vendor/lib/rfsa/adsp/libfastcvdsp_skel.so vendor/lib/rfsa/adsp/libsns_low_lat_stream_skel.so vendor/lib64/rfsa/adsp/libsns_low_lat_stream_skel.so -vendor/lib/rfsa/adsp/capi_v2_aptX_CLHDAD_Encoder.so vendor/lib/rfsa/adsp/libdsp_streamer_skel.so vendor/lib/rfsa/adsp/libcamera_nn_skel.so vendor/lib/rfsa/adsp/libcvpdsp_skel.so @@ -320,8 +319,8 @@ vendor/lib/libLocalTM_capture_core.camera.samsung.so vendor/lib/liblow_light_hdr.so vendor/lib/libdualcam_refocus_video.so vendor/lib/libvdis_core.so -vendor/lib/unihal_main@1.3.so -vendor/lib/unihal_cutils@1.3.so +vendor/lib/unihal_main@2.1.so +vendor/lib/unihal_cutils@2.1.so vendor/lib/unihal_uniplugin@1.0.so vendor/lib/libface_landmark.arcsoft.so vendor/lib64/libsuper_night_interface.so @@ -456,8 +455,8 @@ vendor/lib64/libmpbase.so vendor/lib64/libLocalTM_capture_core.camera.samsung.so vendor/lib64/liblow_light_hdr.so vendor/lib64/libvdis_core.so -vendor/lib64/unihal_main@1.3.so -vendor/lib64/unihal_cutils@1.3.so +vendor/lib64/unihal_main@2.1.so +vendor/lib64/unihal_cutils@2.1.so vendor/lib64/unihal_uniplugin@1.0.so vendor/lib64/libface_landmark.arcsoft.so vendor/firmware/CAMERA_ICP.elf @@ -729,7 +728,7 @@ vendor/bin/hw/android.hardware.health@2.1-service-samsung vendor/etc/init/android.hardware.health@2.1-service-samsung.rc -vendor/etc/vintf/manifest/android.hardware.health@2.1-samsung.xml vendor/lib/hw/android.hardware.health@2.0-impl-2.1-samsung.so -vendor/lib64/hw/android.hardware.health@2.0-impl-2.1-samsung.so|198198b82c376e1370e107d154859f95c8e72f86 +vendor/lib64/hw/android.hardware.health@2.0-impl-2.1-samsung.so|8e7c50b855276f6158d6dac82a5e9192b6ca4d09 vendor/lib/vendor.samsung.hardware.health@2.0.so vendor/lib64/vendor.samsung.hardware.health@2.0.so @@ -858,8 +857,8 @@ vendor/lib64/libqti-perfd-client.so vendor/lib64/libqti-perfd.so vendor/lib64/libperfioctl.so vendor/lib64/libqti-util.so -vendor/lib/vendor.qti.memory.pasrmanager@1.0.so -vendor/lib/vendor.qti.memory.pasrmanager@1.1.so +vendor/lib64/vendor.qti.memory.pasrmanager@1.0.so +vendor/lib64/vendor.qti.memory.pasrmanager@1.1.so vendor/etc/perf/targetresourceconfigs.xml vendor/etc/perf/perfconfigstore.xml vendor/etc/perf/commonresourceconfigs.xml @@ -972,7 +971,7 @@ vendor/lib64/libnetmgr.so vendor/lib64/libnetmgr_common.so vendor/lib/libqrtr.so vendor/lib64/libqrtr.so -vendor/lib64/libsec-ril.so|1d97ef6504c6380466d4ea82b3428f496e4d0ab8 +vendor/lib64/libsec-ril.so|27f3bb99e129e7521795c579092527d9da7ee3d2 vendor/lib64/libsecril-client.so vendor/lib/libsystem_health_mon.so vendor/lib64/libsystem_health_mon.so @@ -1067,6 +1066,15 @@ vendor/etc/init/init_thermal-engine.rc vendor/etc/thermal-engine.conf vendor/lib/libthermalclient.so vendor/lib64/libthermalclient.so +vendor/bin/hw/vendor.samsung.hardware.thermal@1.0-service +vendor/etc/init/vendor.samsung.hardware.thermal@1.0-service.rc +-vendor/etc/vintf/manifest/vendor.samsung.hardware.thermal@1.0-manifest.xml +vendor/lib/vendor.samsung.hardware.thermal@1.0.so +vendor/lib64/vendor.samsung.hardware.thermal@1.0.so +vendor/lib/libhypervintf.so +vendor/lib64/libhypervintf.so +vendor/lib/vendor.samsung.hardware.hyper-V2-ndk_platform.so +vendor/lib64/vendor.samsung.hardware.hyper-V2-ndk_platform.so # Time services -vendor/app/TimeService/TimeService.apk diff --git a/rootdir/Android.mk b/rootdir/Android.mk index a1ce372..68589b4 100644 --- a/rootdir/Android.mk +++ b/rootdir/Android.mk @@ -68,6 +68,14 @@ LOCAL_SRC_FILES := etc/init.samsung.rc LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw include $(BUILD_PREBUILT) +include $(CLEAR_VARS) +LOCAL_MODULE := init.samsung.power.rc +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/init.samsung.power.rc +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw +include $(BUILD_PREBUILT) + include $(CLEAR_VARS) LOCAL_MODULE := init.fingerprint.rc LOCAL_MODULE_TAGS := optional diff --git a/rootdir/etc/init.audio.samsung.rc b/rootdir/etc/init.audio.samsung.rc index 5b41975..79ffdb8 100644 --- a/rootdir/etc/init.audio.samsung.rc +++ b/rootdir/etc/init.audio.samsung.rc @@ -54,4 +54,9 @@ on property:sys.boot_completed=1 chmod 0660 /efs/tas25xx/calib_re chmod 0660 /efs/tas25xx/amb_temp chmod 0660 /efs/tas25xx/calib_re_r - chmod 0660 /efs/tas25xx/amb_temp_r \ No newline at end of file + chmod 0660 /efs/tas25xx/amb_temp_r + +# DBMDx + chmod 0660 /dev/dbmdx-1 + chown system audio /dev/dbmdx-1 + chown system audio /sys/class/voicep/dbmdx/va_mic_mode diff --git a/rootdir/etc/init.nfc.samsung.rc b/rootdir/etc/init.nfc.samsung.rc index eaae6be..9aa004c 100644 --- a/rootdir/etc/init.nfc.samsung.rc +++ b/rootdir/etc/init.nfc.samsung.rc @@ -1,7 +1,22 @@ +on late-init +# PVDD enable + write /sys/class/nfc_sec/pvdd "1" + on post-fs-data + write /sys/class/nfc_sec/pvdd "2" # NFC KEY mkdir /data/vendor/nfc 0770 nfc nfc +# NFC driver permission + chmod 0660 /dev/p3 + chown system system /dev/p3 + chmod 0660 /dev/p61 + chown system system /dev/p61 + chmod 0660 /dev/st54spi + chown system system /dev/st54spi + +on boot + write /sys/class/nfc_sec/pvdd "3" # NFC driver permission chmod 0660 /dev/sec-nfc chown nfc nfc /dev/sec-nfc @@ -28,3 +43,7 @@ on post-fs-data # copy /system/etc/nfc_key /data/nfc/Key chmod 660 /data/nfc/Key chown nfc nfc /data/nfc/Key + +# For NFC hardware SKU +on boot && property:ro.boot.nfc.feature.chipname=* + setprop ro.vendor.nfc.feature.chipname ${ro.boot.nfc.feature.chipname} diff --git a/rootdir/etc/init.qcom.usb.rc b/rootdir/etc/init.qcom.usb.rc index a204856..44c8d5e 100644 --- a/rootdir/etc/init.qcom.usb.rc +++ b/rootdir/etc/init.qcom.usb.rc @@ -31,6 +31,8 @@ on init chmod 0660 /sys/class/host_notify/usb_otg/booster chown system radio /sys/class/usb_notify/usb_control/disable chmod 0660 /sys/class/usb_notify/usb_control/disable + chown root system /sys/class/usb_notify/usb_control/usb_data_enabled + chmod 0664 /sys/class/usb_notify/usb_control/usb_data_enabled # usb hw param chown system usb /sys/class/usb_notify/usb_control/usb_hw_param diff --git a/rootdir/etc/init.samsung.display.rc b/rootdir/etc/init.samsung.display.rc index 693f464..c4fe9ec 100644 --- a/rootdir/etc/init.samsung.display.rc +++ b/rootdir/etc/init.samsung.display.rc @@ -354,7 +354,7 @@ on init chown system system /sys/class/lcd/panel/copr chmod 0660 /sys/class/lcd/panel/copr chown system system /sys/class/lcd/panel/brt_avg - chmod 0660 /sys/class/lcd/panel/brt_avg + chmod 0440 /sys/class/lcd/panel/brt_avg chown system system /sys/class/lcd/panel1/copr_roi chmod 0660 /sys/class/lcd/panel1/copr_roi @@ -363,7 +363,7 @@ on init chown system system /sys/class/lcd/panel1/copr chmod 0660 /sys/class/lcd/panel1/copr chown system system /sys/class/lcd/panel1/brt_avg - chmod 0660 /sys/class/lcd/panel1/brt_avg + chmod 0440 /sys/class/lcd/panel1/brt_avg # SELF MASK chown system system /sys/class/lcd/panel/self_mask @@ -408,7 +408,13 @@ on init chmod 0660 /sys/class/lcd/panel/mask_brightness chown system system /sys/class/lcd/panel/actual_mask_brightness - chmod 0660 /sys/class/lcd/panel/actual_mask_brightness + chmod 0440 /sys/class/lcd/panel/actual_mask_brightness + + chown system system /sys/class/lcd/panel1/mask_brightness + chmod 0660 /sys/class/lcd/panel1/mask_brightness + + chown system system /sys/class/lcd/panel1/actual_mask_brightness + chmod 0440 /sys/class/lcd/panel1/actual_mask_brightness # UB CONN DET chown system system /sys/class/lcd/panel/conn_det diff --git a/rootdir/etc/init.samsung.power.rc b/rootdir/etc/init.samsung.power.rc new file mode 100644 index 0000000..c688213 --- /dev/null +++ b/rootdir/etc/init.samsung.power.rc @@ -0,0 +1,61 @@ + +# Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# + +on early-init + +on init + +on late-init + +on post-fs + +on late-fs + +on post-fs-data + +on boot + chown radio system /sys/power/cpufreq_max_limit + chown radio system /sys/power/cpufreq_min_limit + chown radio system /sys/power/cpufreq_table + chown radio system /sys/power/over_limit + chmod 664 /sys/power/cpufreq_max_limit + chmod 664 /sys/power/cpufreq_min_limit + chmod 444 /sys/power/cpufreq_table + chmod 664 /sys/power/over_limit + write /sys/power/pm_debug_messages 1 + chown radio system /sys/module/lpm_levels/parameters/secdebug + chmod 664 /sys/module/lpm_levels/parameters/secdebug + +on shutdown + +# service definition + +# on property triggers + diff --git a/rootdir/etc/init.samsung.rc b/rootdir/etc/init.samsung.rc index 1bab794..cb517c3 100644 --- a/rootdir/etc/init.samsung.rc +++ b/rootdir/etc/init.samsung.rc @@ -28,6 +28,7 @@ # import /vendor/etc/init/hw/init.samsung.bsp.rc +import /vendor/etc/init/hw/init.samsung.power.rc import /vendor/etc/init/hw/init.samsung.display.rc on early-init @@ -37,8 +38,11 @@ on early-init mkdir /efs/taas 0770 system system mkdir /mnt/vendor/efs/taas 0770 system system chown system system /dev/tspio - chown system system /sys/class/sec/tsp/enable + chown system system /sys/class/sec/tsp/enabled + chmod 0660 /sys/class/sec/tsp/enabled chown system system /dev/tsp_data + chown system system /sys/class/sec/sec_epen/enabled + chmod 0660 /sys/class/sec/sec_epen/enabled # pogo keyboard chown system system /sys/class/sec/sec_keypad/fw_update @@ -185,9 +189,6 @@ on boot chown system system /sys/class/sec/tsp/ta_mode chown system system /sys/class/sec/tsp/virtual_prox chown system system /sys/class/sec/tsp/hw_param - chown system system /sys/class/sec/tsp/input/trusted_touch_enable - chown system system /sys/class/sec/tsp/input/trusted_touch_event - chown system system /sys/class/sec/tsp/input/trusted_touch_type # Permissions for Touchscreen-1 chown system radio /sys/class/sec/tsp1/cmd @@ -248,8 +249,12 @@ on boot # Permission for Securetouch chown system system /sys/class/sec/ss_touch/secure/secure_touch_enable + chown system system /sys/class/sec/tsp/input/secure_touch_enable chown system system /sys/class/sec/tsp1/input/secure_touch_enable chown system system /sys/class/sec/tsp2/input/secure_touch_enable + chown system system /sys/class/sec/tsp/input/trusted_touch_enable + chown system system /sys/class/sec/tsp/input/trusted_touch_event + chown system system /sys/class/sec/tsp/input/trusted_touch_type # Key chown system radio /sys/class/sec/sec_key/wakeup_keys diff --git a/rootdir/etc/wifi_qcom.rc b/rootdir/etc/wifi_qcom.rc index d3351ec..071dc4b 100644 --- a/rootdir/etc/wifi_qcom.rc +++ b/rootdir/etc/wifi_qcom.rc @@ -34,20 +34,18 @@ on post-fs-data chmod 0640 /sys/wifi/ant on property:vendor.wlan.ramdump_mode=0 - write /sys/bus/msm_subsys/devices/subsys9/restart_level "RELATED" + write /sys/module/subsystem_restart/parameters/enable_ramdumps 0 stop vendor.ss_ramdump on property:vendor.wlan.ramdump_mode=2 write /sys/module/subsystem_restart/parameters/enable_ramdumps 2 - write /sys/bus/msm_subsys/devices/subsys9/restart_level "RELATED" stop vendor.ss_ramdump - start vendor.ss_ramdump + #start vendor.ss_ramdump on property:vendor.wlan.ramdump_mode=3 - write /sys/module/subsystem_restart/parameters/enable_ramdumps 2 - write /sys/bus/msm_subsys/devices/subsys9/restart_level "SYSTEM" + write /sys/module/subsystem_restart/parameters/enable_ramdumps 3 stop vendor.ss_ramdump - start vendor.ss_ramdump + #start vendor.ss_ramdump on property:sys.boot_completed=1 chown wifi wifi /sys/module/wlan/parameters/fwpath diff --git a/rootdir/etc/wifi_sec.rc b/rootdir/etc/wifi_sec.rc index 8bf9e77..584abe0 100644 --- a/rootdir/etc/wifi_sec.rc +++ b/rootdir/etc/wifi_sec.rc @@ -40,7 +40,7 @@ on post-fs-data chmod 0640 /sys/wifi/mac_addr chown wifi wifi /sys/wifi/dump_in_progress - chmod 0640 /sys/wifi/dump_in_progress + chmod 0660 /sys/wifi/dump_in_progress on boot setprop wifi.interface wlan0 diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index 0051b57..97cf7a5 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -61,6 +61,7 @@ /(vendor|system/vendor)/bin/secril_config_svc u:object_r:secril_config_svc_exec:s0 /(vendor|system/vendor)/bin/hw/vendor\.lineage\.livedisplay@2\.0-service.samsung-qcom\.sm7125 u:object_r:hal_lineage_livedisplay_sysfs_exec:s0 /(vendor|system/vendor)/bin/hw/android.hardware.biometrics.fingerprint@2.3-service-samsung.sm7125 u:object_r:hal_fingerprint_default_exec:s0 +/(vendor|system/vendor)/bin/hw/vendor.samsung.hardware.thermal@1.0-service u:object_r:hal_thermal_default_exec:s0 /(vendor|system/vendor)/bin/hw/android.hardware.sensors@[0-9].[0-9]-service.samsung-multihal u:object_r:hal_sensors_default_exec:s0 /(vendor|system/vendor)/bin/hw/android.hardware.vibrator-service.sm7125 u:object_r:hal_vibrator_default_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.health@2\.1-service-samsung u:object_r:hal_health_default_exec:s0 diff --git a/sepolicy/vendor/genfs_contexts b/sepolicy/vendor/genfs_contexts index 8e19dc0..a8ab0ca 100644 --- a/sepolicy/vendor/genfs_contexts +++ b/sepolicy/vendor/genfs_contexts @@ -39,6 +39,9 @@ genfscon sysfs /devices/virtual/camera/ genfscon sysfs /devices/virtual/camera/rear/ssrm_camera_info u:object_r:sysfs_camera_writable:s0 genfscon sysfs /devices/virtual/camera/flash/rear_flash u:object_r:sysfs_camera_writable:s0 genfscon sysfs /kernel/mm/vmscan/mem_boost_mode u:object_r:sysfs_camera_writable:s0 +genfscon sysfs /devices/virtual/sec/sec-ap-thermistor/ u:object_r:sysfs_thermal:s0 +genfscon sysfs /devices/virtual/sec/sec-pa-thermistor/ u:object_r:sysfs_thermal:s0 +genfscon sysfs /devices/virtual/sec/sec-wf-thermistor/ u:object_r:sysfs_thermal:s0 genfscon sysfs /power/ u:object_r:sysfs_power_writable:s0 diff --git a/sepolicy/vendor/hal_camera_default.te b/sepolicy/vendor/hal_camera_default.te index b476b52..4b55b2f 100644 --- a/sepolicy/vendor/hal_camera_default.te +++ b/sepolicy/vendor/hal_camera_default.te @@ -12,3 +12,5 @@ get_prop(hal_camera_default, vendor_mpctl_prop) # EFS allow hal_camera_default efs_file:dir search; + +dontaudit hal_camera_default default_prop:file read; diff --git a/sepolicy/vendor/hal_health_default.te b/sepolicy/vendor/hal_health_default.te index df326cc..b744271 100644 --- a/sepolicy/vendor/hal_health_default.te +++ b/sepolicy/vendor/hal_health_default.te @@ -11,3 +11,7 @@ allow hal_health_default app_efs_file:dir { read write add_name search }; allow hal_health_default app_efs_file:file { read write open create getattr setattr }; allow hal_health_default efs_file:dir search; + +# Thermal +allow hal_health_default hal_thermal_samsung_hwservice:hwservice_manager find; +binder_call(hal_health_default, hal_thermal_default) diff --git a/sepolicy/vendor/hal_thermal_default.te b/sepolicy/vendor/hal_thermal_default.te new file mode 100644 index 0000000..069f291 --- /dev/null +++ b/sepolicy/vendor/hal_thermal_default.te @@ -0,0 +1,8 @@ +allow hal_thermal_default sysfs_thermal:file getattr; + +allow hal_thermal_default sysfs_battery:dir search; +allow hal_thermal_default sysfs_battery:file { read open getattr }; + +allow hal_thermal_default sysfs_power_writable:file { read open }; + +allow hal_thermal_default hal_thermal_samsung_hwservice:hwservice_manager { add find }; diff --git a/sepolicy/vendor/hwservice.te b/sepolicy/vendor/hwservice.te index 89917e0..a8e8c17 100644 --- a/sepolicy/vendor/hwservice.te +++ b/sepolicy/vendor/hwservice.te @@ -1 +1,3 @@ type hal_bluetooth_a2dp_hwservice, hwservice_manager_type; + +type hal_thermal_samsung_hwservice, hwservice_manager_type; diff --git a/sepolicy/vendor/hwservice_contexts b/sepolicy/vendor/hwservice_contexts index 9612352..8f5bcd7 100644 --- a/sepolicy/vendor/hwservice_contexts +++ b/sepolicy/vendor/hwservice_contexts @@ -14,3 +14,6 @@ vendor.samsung.hardware.health::ISehHealth vendor.samsung.hardware.radio.bridge::ISehBridge u:object_r:hal_telephony_hwservice:s0 vendor.samsung.hardware.radio::ISehRadio u:object_r:hal_telephony_hwservice:s0 vendor.samsung.hardware.radio.channel::ISehChannel u:object_r:hal_telephony_hwservice:s0 + +# Thermal +vendor.samsung.hardware.thermal::ISehThermal u:object_r:hal_thermal_samsung_hwservice:s0 diff --git a/sepolicy/vendor/macloader.te b/sepolicy/vendor/macloader.te index d8e9a9e..e0a9bfc 100644 --- a/sepolicy/vendor/macloader.te +++ b/sepolicy/vendor/macloader.te @@ -40,3 +40,5 @@ allow macloader sysfs_wifi:file r_file_perms; # /sys/kernel/boot_wlan allow macloader sysfs_wifi_writable:file { write open }; + +set_prop(macloader, vendor_wifi_prop) diff --git a/sepolicy/vendor/property_contexts b/sepolicy/vendor/property_contexts index fd97af0..65e455a 100644 --- a/sepolicy/vendor/property_contexts +++ b/sepolicy/vendor/property_contexts @@ -21,7 +21,7 @@ vendor.sec.rild. u:object_r:vendor_radio_prop:s0 ro.vendor.sec.radio. u:object_r:vendor_radio_prop:s0 ro.vendor.use_data_netmgrd u:object_r:vendor_radio_prop:s0 ro.vendor.epdg.support u:object_r:vendor_radio_prop:s0 -vendor.calls.slotid u:object_r:vendor_radio_prop:s0 +vendor.calls u:object_r:vendor_radio_prop:s0 # Sensors vendor.sensor.file.permission u:object_r:vendor_sensors_prop:s0 @@ -31,3 +31,4 @@ vendor.sys.qseecomd.enable u:object_r:vendor_qseecomd_prop # wifi vendor.wifi. u:object_r:vendor_wifi_prop:s0 +ro.vendor.wifi.sap.interface u:object_r:vendor_wifi_prop:s0 diff --git a/sepolicy/vendor/rild.te b/sepolicy/vendor/rild.te index 8b6ce4f..873bdec 100644 --- a/sepolicy/vendor/rild.te +++ b/sepolicy/vendor/rild.te @@ -41,3 +41,10 @@ allow rild proc_net:file rw_file_perms; allow rild tun_device:chr_file rw_file_perms; allowxperm rild tun_device:chr_file ioctl { 0x54ca 0x54cb }; allow rild self:tun_socket create; + +dontaudit rild { + system_prop + default_prop +}:file read; + +dontaudit rild default_prop:property_service set; diff --git a/sepolicy/vendor/vendor_hal_perf_default.te b/sepolicy/vendor/vendor_hal_perf_default.te new file mode 100644 index 0000000..5c34b8a --- /dev/null +++ b/sepolicy/vendor/vendor_hal_perf_default.te @@ -0,0 +1,2 @@ +# /sys/module/lpm_levels/parameters/bias_hyst +allow vendor_hal_perf_default sysfs_power_writable:file { read open getattr }; diff --git a/vendor.prop b/vendor.prop index 60aa19b..5b87338 100644 --- a/vendor.prop +++ b/vendor.prop @@ -58,6 +58,7 @@ vendor.audio.feature.hwdep_cal.enable=false vendor.audio.feature.concurrent_capture.enable=false vendor.audio.feature.maxx_audio.enable=false vendor.audio.feature.audiozoom.enable=false +vendor.audio.feature.incall_music.enable=true ro.config.vc_call_vol_steps=8 # Bluetooth