From 91f6591de902e8961d0341098cde643aeb2fadec Mon Sep 17 00:00:00 2001 From: Jorge Lucas Date: Mon, 28 Dec 2020 12:35:21 -0300 Subject: [PATCH] sanders: Add DTV Support for XT1802 --- BoardConfig.mk | 3 +++ configs/check_features.sh | 15 +++++++++++++++ device.mk | 4 ++++ proprietary-files.txt | 10 ++++++++++ releasetools/releasetools.py | 28 ++++++++++++++++++++++++++++ rootdir/etc/init.sanders.rc | 3 +++ 6 files changed, 63 insertions(+) create mode 100644 configs/check_features.sh create mode 100644 releasetools/releasetools.py diff --git a/BoardConfig.mk b/BoardConfig.mk index 2b0f690..344aa37 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -35,6 +35,9 @@ TARGET_PROVIDES_KEYMASTER := true # Recovery TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/etc/fstab.qcom +# Releasetools +TARGET_RELEASETOOLS_EXTENSIONS := $(DEVICE_PATH)/releasetools + # NFC NXP_CHIP_TYPE := PN551 diff --git a/configs/check_features.sh b/configs/check_features.sh new file mode 100644 index 0000000..a617f45 --- /dev/null +++ b/configs/check_features.sh @@ -0,0 +1,15 @@ +#!/sbin/sh + +remove_dtv() { + rm /system/system/etc/permissions/com.motorola.hardware.dtv.xml + rm /system/system/etc/permissions/mot_dtv_permissions.xml + rm /system/system/lib*/libdtvtuner.so + rm /system/system/lib*/libdtvhal.so + rm /vendor/lib/modules/isdbt.ko + rm -r /system/system/priv-app/DTVPlayer + rm -r /system/system/priv-app/DTVService +} + +if [ $(getprop ro.boot.hardware.sku) != "XT1802" ]; then + remove_dtv +fi diff --git a/device.mk b/device.mk index 825fe3b..9158475 100644 --- a/device.mk +++ b/device.mk @@ -75,6 +75,10 @@ PRODUCT_PACKAGES += \ fstab.qcom \ init.sanders.rc +# Releasetools script +PRODUCT_COPY_FILES += \ + $(DEVICE_PATH)/configs/check_features.sh:$(TARGET_COPY_OUT_VENDOR)/bin/check_features.sh + # Sensors PRODUCT_COPY_FILES += \ $(DEVICE_PATH)/configs/sensors/sensor_def_qcomdev.conf:$(TARGET_COPY_OUT_VENDOR)/etc/sensors/sensor_def_qcomdev.conf \ diff --git a/proprietary-files.txt b/proprietary-files.txt index 92b8f6c..7f95782 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -554,6 +554,16 @@ vendor/firmware/focaltech-biel-ft5436-06-0001-sanders.bin vendor/firmware/focaltech-djn-ft5436-02-0001-sanders.bin vendor/firmware/focaltech-toptouch-ft5436-0a-0001-sanders.bin +# DTV +-app/DTVPlayer/DTVPlayer.apk +-app/DTVService/DTVService.apk +etc/permissions/com.motorola.hardware.dtv.xml +etc/permissions/mot_dtv_permissions.xml +lib/libdtvhal.so +lib/libdtvtuner.so +lib64/libdtvhal.so +lib64/libdtvtuner.so + # Gatekeeper - from LA.UM.8.6.r1-04700-89xx.0 vendor/lib64/hw/gatekeeper.msm8953.so|b3a9d78faa65029b0a20f2ff6dfe986bc80b64c1 diff --git a/releasetools/releasetools.py b/releasetools/releasetools.py new file mode 100644 index 0000000..b4ab7a7 --- /dev/null +++ b/releasetools/releasetools.py @@ -0,0 +1,28 @@ +# Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017 The LineageOS Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +def IncrementalOTA_InstallEnd(info): + ReplaceDeviceConfig(info) + +def FullOTA_InstallEnd(info): + ReplaceDeviceConfig(info) + +def ReplaceDeviceConfig(info): + info.script.Mount("/system") + info.script.Mount("/vendor") + info.script.AppendExtra('run_program("/sbin/sh", "/vendor/bin/check_features.sh");') + info.script.Unmount("/system") + info.script.Unmount("/vendor") diff --git a/rootdir/etc/init.sanders.rc b/rootdir/etc/init.sanders.rc index 92e5651..a14b502 100644 --- a/rootdir/etc/init.sanders.rc +++ b/rootdir/etc/init.sanders.rc @@ -44,3 +44,6 @@ on boot on post-fs-data mkdir /data/fpc 0700 system system mkdir /data/.fps 0770 system fingerp + +on property:ro.boot.hardware.sku=XT1802 + insmod /vendor/lib/modules/isdbt.ko