diff --git a/BoardConfig.mk b/BoardConfig.mk index ce8f91a..8ade00a 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -89,8 +89,6 @@ TARGET_KERNEL_NO_GCC := true TARGET_KERNEL_SOURCE := kernel/xiaomi/taoyao TARGET_KERNEL_CONFIG := vendor/taoyao-qgki_defconfig -include device/xiaomi/taoyao-kernel/BoardConfig.mk - BOARD_KERNEL_CMDLINE += androidboot.console=ttyMSM0 BOARD_KERNEL_CMDLINE += androidboot.hardware=qcom BOARD_KERNEL_CMDLINE += androidboot.usbcontroller=a600000.dwc3 @@ -105,6 +103,8 @@ BOARD_KERNEL_CMDLINE += iptable_raw.raw_before_defrag=1 BOARD_KERNEL_CMDLINE += ip6table_raw.raw_before_defrag=1 BOARD_KERNEL_CMDLINE += androidboot.init_fatal_reboot_target=recovery +-include device/xiaomi/taoyao-kernel/BoardConfig.mk + # Partitions BOARD_FLASH_BLOCK_SIZE := 131072 BOARD_BOOTIMAGE_PARTITION_SIZE := 201326592 @@ -140,7 +140,6 @@ TARGET_BOARD_PLATFORM := lahaina # Properties TARGET_ODM_PROP += $(DEVICE_PATH)/odm.prop -TARGET_PRODUCT_PROP += $(DEVICE_PATH)/product.prop TARGET_SYSTEM_PROP += $(DEVICE_PATH)/system.prop TARGET_SYSTEM_EXT_PROP += $(DEVICE_PATH)/system_ext.prop TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop @@ -205,3 +204,6 @@ WPA_SUPPLICANT_VERSION := VER_0_8_X # Inherit proprietary blobs include vendor/xiaomi/taoyao/BoardConfigVendor.mk + +# Inherit camera proprietary blobs +-include device/xiaomi/taoyao-camera/BoardConfig.mk diff --git a/configs/default-permissions-miuicamera.xml b/configs/default-permissions-miuicamera.xml deleted file mode 100644 index ff8ca26..0000000 --- a/configs/default-permissions-miuicamera.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/configs/idc/uinput-goodix.idc b/configs/idc/uinput-goodix.idc deleted file mode 100644 index 2b580cd..0000000 --- a/configs/idc/uinput-goodix.idc +++ /dev/null @@ -1,16 +0,0 @@ -# -# FPC1020 Touch sensor driver -# -# Copyright (c) 2013,2014 Fingerprint Cards AB -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License Version 2 -# as published by the Free Software Foundation. -# - -device.internal = 1 - -keyboard.layout = uinput-goodix -keyboard.builtIn = 1 -keyboard.orientationAware = 1 - diff --git a/configs/keylayout/gpio-keys.kl b/configs/keylayout/gpio-keys.kl deleted file mode 100644 index 7d5afc3..0000000 --- a/configs/keylayout/gpio-keys.kl +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2013, 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. - -key 115 VOLUME_UP -key 114 VOLUME_DOWN -key 102 HOME -key 528 FOCUS -key 766 CAMERA diff --git a/configs/keylayout/uinput-goodix.kl b/configs/keylayout/uinput-goodix.kl deleted file mode 100644 index 016c6b6..0000000 --- a/configs/keylayout/uinput-goodix.kl +++ /dev/null @@ -1,19 +0,0 @@ -# -# FPC1020 Touch sensor driver -# -# Copyright (c) 2013,2014 Fingerprint Cards AB -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License Version 2 -# as published by the Free Software Foundation. -# - -#single click -key 353 DPAD_CENTER VIRTUAL -#double click -key 306 BUTTON_C VIRTUAL -# HOME --> DPAD_CENTER -key 102 DPAD_CENTER VIRTUAL -#key 105 DPAD_LEFT VIRTUAL -#key 106 DPAD_RIGHT VIRTUAL - diff --git a/configs/miuicamera-hiddenapi-package-allowlist.xml b/configs/miuicamera-hiddenapi-package-allowlist.xml deleted file mode 100644 index b8ed90d..0000000 --- a/configs/miuicamera-hiddenapi-package-allowlist.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/configs/privapp-permissions-miuicamera.xml b/configs/privapp-permissions-miuicamera.xml deleted file mode 100644 index 418bf90..0000000 --- a/configs/privapp-permissions-miuicamera.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/configs/public.libraries-xiaomi.txt b/configs/public.libraries-xiaomi.txt deleted file mode 100644 index 6f2f063..0000000 --- a/configs/public.libraries-xiaomi.txt +++ /dev/null @@ -1,2 +0,0 @@ -libcamera_algoup_jni.xiaomi.so -libcamera_mianode_jni.xiaomi.so \ No newline at end of file diff --git a/device.mk b/device.mk index e32b955..73f979b 100644 --- a/device.mk +++ b/device.mk @@ -17,6 +17,9 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk) # Inherit proprietary targets $(call inherit-product, vendor/xiaomi/taoyao/taoyao-vendor.mk) +# Inherit camera proprietary targets +$(call inherit-product-if-exists, device/xiaomi/taoyao-camera/device.mk) + # Setup dalvik vm configs $(call inherit-product, frameworks/native/build/phone-xhdpi-6144-dalvik-heap.mk) @@ -119,11 +122,7 @@ PRODUCT_PACKAGES += \ android.hardware.graphics.common-V4-ndk PRODUCT_COPY_FILES += \ - $(LOCAL_PATH)/configs/camera_cnf.txt:$(TARGET_COPY_OUT_VENDOR)/etc/camera/camera_cnf.txt \ - $(LOCAL_PATH)/configs/privapp-permissions-miuicamera.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/privapp-permissions-miuicamera.xml \ - $(LOCAL_PATH)/configs/public.libraries-xiaomi.txt:$(TARGET_COPY_OUT_SYSTEM)/etc/public.libraries-xiaomi.txt \ - $(LOCAL_PATH)/configs/miuicamera-hiddenapi-package-allowlist.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/sysconfig/miuicamera-hiddenapi-package-allowlist.xml \ - $(LOCAL_PATH)/configs/default-permissions-miuicamera.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/default-permissions/default-permissions-miuicamera.xml + $(LOCAL_PATH)/configs/camera_cnf.txt:$(TARGET_COPY_OUT_VENDOR)/etc/camera/camera_cnf.txt PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \ @@ -260,12 +259,6 @@ PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/rootdir/bin/init.qcom.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qcom.sh \ $(LOCAL_PATH)/rootdir/bin/vendor_modprobe.sh:$(TARGET_COPY_OUT_VENDOR)/bin/vendor_modprobe.sh -# Input -PRODUCT_COPY_FILES += \ - $(LOCAL_PATH)/configs/idc/uinput-goodix.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/uinput-goodix.idc \ - $(LOCAL_PATH)/configs/keylayout/uinput-goodix.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/uinput-goodix.kl \ - $(LOCAL_PATH)/configs/keylayout/gpio-keys.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/gpio-keys.kl - # IFAA manager PRODUCT_PACKAGES += \ IFAAService @@ -284,7 +277,7 @@ PRODUCT_COPY_FILES += \ # Kernel PRODUCT_ENABLE_UFFD_GC := true -$(call inherit-product, device/xiaomi/taoyao-kernel/device.mk) +$(call inherit-product-if-exists, device/xiaomi/taoyao-kernel/device.mk) # Lineage Health PRODUCT_PACKAGES += \ @@ -349,7 +342,6 @@ DEVICE_PACKAGE_OVERLAYS += \ PRODUCT_ENFORCE_RRO_TARGETS := * PRODUCT_PACKAGES += \ - NfcOverlay \ SettingsProviderOverlay \ DeviceAsWebcamOverlaySM8350 diff --git a/extract-files.py b/extract-files.py index eb4b5f8..600ea59 100755 --- a/extract-files.py +++ b/extract-files.py @@ -97,13 +97,6 @@ blob_fixups: blob_fixups_user_type = { .binary_regex_replace(b'system/lib64/libion.so', b'vendor/lib64/libion.so'), 'vendor/etc/camera/taoyao_motiontuning.xml': blob_fixup() .regex_replace('xml=version', 'xml version'), - 'system/lib64/libmicampostproc_client.so': blob_fixup() - .remove_needed('libhidltransport.so'), - 'system/lib64/libcamera_algoup_jni.xiaomi.so': blob_fixup() - .add_needed('libcamera_shim.so') - .sig_replace('08 AD 40 F9', '08 A9 40 F9'), - 'system/lib64/libcamera_mianode_jni.xiaomi.so': blob_fixup() - .add_needed('libcamera_shim.so'), ('vendor/lib/hw/audio.primary.lahaina.so', 'vendor/lib/libaudioroute_ext.so'): blob_fixup() .replace_needed('libaudioroute.so', 'libaudioroute-v34.so'), # Dolby START diff --git a/product.prop b/product.prop deleted file mode 100644 index 6a9ae23..0000000 --- a/product.prop +++ /dev/null @@ -1,2 +0,0 @@ -# Camera -ro.product.mod_device=taoyao_global \ No newline at end of file diff --git a/proprietary-files.txt b/proprietary-files.txt index 14afa74..7a4b01e 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -166,11 +166,6 @@ vendor/lib64/libjnihelper.so vendor/lib64/vendor.qti.hardware.cacert@1.0.so # Camera -product/priv-app/MiuiCamera/MiuiCamera.apk:system/priv-app/MiuiCamera/MiuiCamera.apk;OVERRIDES=Aperture,Camera2 -system_ext/lib64/libcamera_algoup_jni.xiaomi.so:system/lib64/libcamera_algoup_jni.xiaomi.so -system_ext/lib64/libcamera_mianode_jni.xiaomi.so:system/lib64/libcamera_mianode_jni.xiaomi.so -system_ext/lib64/libmicampostproc_client.so:system/lib64/libmicampostproc_client.so -system_ext/lib64/vendor.xiaomi.hardware.campostproc@1.0.so:system/lib64/vendor.xiaomi.hardware.campostproc@1.0.so vendor/bin/loadalgo vendor/lib/libcamxexternalformatutils.so vendor/lib/libcom.xiaomi.debug.so diff --git a/sepolicy/vendor/cameraserver.te b/sepolicy/vendor/cameraserver.te index 2392411..77a9c6d 100644 --- a/sepolicy/vendor/cameraserver.te +++ b/sepolicy/vendor/cameraserver.te @@ -2,5 +2,3 @@ allow cameraserver property_socket:sock_file { write }; allow cameraserver sysfs_leds:dir r_dir_perms; allow cameraserver sysfs_torch:file rw_file_perms; - -allow cameraserver vendor_default_prop:file { getattr open read map }; diff --git a/sepolicy/vendor/hal_camera_default.te b/sepolicy/vendor/hal_camera_default.te index 3469ee9..e9320c6 100644 --- a/sepolicy/vendor/hal_camera_default.te +++ b/sepolicy/vendor/hal_camera_default.te @@ -18,9 +18,3 @@ allow hal_camera_client vendor_hal_cameraperf_hwservice:hwservice_manager find; allow hal_camera_client vendor_hal_camerapostproc_xiaomi_hwservice:hwservice_manager find; allow hal_camera_default public_adsprpcd_file:file r_file_perms; - -allow hal_camera_default proc_stat:file { open read }; -allow hal_camera_default system_data_file:dir { add_name search write }; -allow hal_camera_default system_data_file:file { create write setattr open read getattr }; -allow hal_camera_default vendor_hal_qspmhal_hwservice:hwservice_manager find; -binder_call(hal_camera_default, platform_app); diff --git a/sepolicy/vendor/vendor_init.te b/sepolicy/vendor/vendor_init.te index d4ab3b0..05476e9 100644 --- a/sepolicy/vendor/vendor_init.te +++ b/sepolicy/vendor/vendor_init.te @@ -1,6 +1 @@ set_prop(vendor_init, vendor_zram_prop); - -allow vendor_init vendor_camera_prop:property_service set; - -allow vendor_init default_prop:property_service set; -allow vendor_init tmpfs:dir rw_dir_perms; diff --git a/shims/Android.bp b/shims/Android.bp index 3c1e888..d317599 100644 --- a/shims/Android.bp +++ b/shims/Android.bp @@ -4,11 +4,6 @@ // SPDX-License-Identifier: Apache-2.0 // -cc_library { - name: "libcamera_shim", - srcs: ["libcamera.c"], -} - cc_library { name: "citsensorservice_shim", srcs: ["citsensorservice.c"], diff --git a/shims/libcamera.c b/shims/libcamera.c deleted file mode 100644 index 24a73e7..0000000 --- a/shims/libcamera.c +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (C) 2023 The LineageOS Project - * - * SPDX-License-Identifier: Apache-2.0 - */ - -void _ZN7android18BnProducerListener16onBufferDetachedEi() { - return; -} \ No newline at end of file diff --git a/system.prop b/system.prop index 64b1226..8fa1298 100644 --- a/system.prop +++ b/system.prop @@ -1,12 +1,6 @@ # Bluetooth vendor.bluetooth.soc=hastings -# Camera -persist.vendor.camera.privapp.list=com.android.camera -ro.com.google.lens.oem_camera_package=com.android.camera -ro.miui.notch=1 -vendor.camera.aux.packagelist=com.android.camera - # CNE persist.vendor.cne.feature=1