diff --git a/common/Android.bp b/common/Android.bp index a0f133c..9a5a4b5 100644 --- a/common/Android.bp +++ b/common/Android.bp @@ -4,9 +4,129 @@ soong_namespace { imports: [ + "vendor/xiaomi/miuicamera", ], } +cc_prebuilt_library_shared { + name: "libOpenCL_system", + stem: "libOpenCL", + owner: "xiaomi/miuicamera", + strip: { + none: true, + }, + target: { + android_arm64: { + srcs: ["proprietary/system/lib64/libOpenCL.so"], + shared_libs: ["libcutils", "libvndksupport", "libc++", "libc", "libm", "libdl", ], + }, + }, + compile_multilib: "64", + prefer: true, +} + +cc_prebuilt_library_shared { + name: "libarcsoft_dualcam_refocus_system", + stem: "libarcsoft_dualcam_refocus", + owner: "xiaomi/miuicamera", + strip: { + none: true, + }, + target: { + android_arm64: { + srcs: ["proprietary/system/lib64/libarcsoft_dualcam_refocus.so"], + shared_libs: ["libarcsoft_dualcam_refocus_rear_t_system", "libarcsoft_dualcam_refocus_rear_w_system", "libarcsoft_dualcam_refocus_front_system", "libmpbase_system", "liblog", "libc", "libm", "libdl", ], + }, + }, + compile_multilib: "64", + prefer: true, +} + +cc_prebuilt_library_shared { + name: "libarcsoft_dualcam_refocus_front_system", + stem: "libarcsoft_dualcam_refocus_front", + owner: "xiaomi/miuicamera", + strip: { + none: true, + }, + target: { + android_arm64: { + srcs: ["proprietary/system/lib64/libarcsoft_dualcam_refocus_front.so"], + shared_libs: ["libmpbase_system", "libOpenCL_system", "liblog", "libc", "libm", "libdl", ], + }, + }, + compile_multilib: "64", + prefer: true, +} + +cc_prebuilt_library_shared { + name: "libarcsoft_dualcam_refocus_rear_t_system", + stem: "libarcsoft_dualcam_refocus_rear_t", + owner: "xiaomi/miuicamera", + strip: { + none: true, + }, + target: { + android_arm64: { + srcs: ["proprietary/system/lib64/libarcsoft_dualcam_refocus_rear_t.so"], + shared_libs: ["libmpbase_system", "libOpenCL_system", "liblog", "libc", "libm", "libdl", ], + }, + }, + compile_multilib: "64", + prefer: true, +} + +cc_prebuilt_library_shared { + name: "libarcsoft_dualcam_refocus_rear_w_system", + stem: "libarcsoft_dualcam_refocus_rear_w", + owner: "xiaomi/miuicamera", + strip: { + none: true, + }, + target: { + android_arm64: { + srcs: ["proprietary/system/lib64/libarcsoft_dualcam_refocus_rear_w.so"], + shared_libs: ["libmpbase_system", "libOpenCL_system", "liblog", "libc", "libm", "libdl", ], + }, + }, + compile_multilib: "64", + prefer: true, +} + +cc_prebuilt_library_shared { + name: "libarcsoft_portrait_lighting_system", + stem: "libarcsoft_portrait_lighting", + owner: "xiaomi/miuicamera", + strip: { + none: true, + }, + target: { + android_arm64: { + srcs: ["proprietary/system/lib64/libarcsoft_portrait_lighting.so"], + shared_libs: ["libmpbase_system", "libarcsoft_portrait_lighting_c_system", "liblog", "libc", "libm", "libdl", ], + }, + }, + compile_multilib: "64", + prefer: true, +} + +cc_prebuilt_library_shared { + name: "libarcsoft_portrait_lighting_c_system", + stem: "libarcsoft_portrait_lighting_c", + owner: "xiaomi/miuicamera", + strip: { + none: true, + }, + target: { + android_arm64: { + srcs: ["proprietary/system/lib64/libarcsoft_portrait_lighting_c.so"], + shared_libs: ["libOpenCL_system", "liblog", "libdl", "libc", "libm", ], + }, + }, + compile_multilib: "64", + prefer: true, +} + cc_prebuilt_library_shared { name: "libcamera_algoup_jni.xiaomi", owner: "xiaomi/miuicamera", @@ -48,7 +168,7 @@ cc_prebuilt_library_shared { target: { android_arm64: { srcs: ["proprietary/system/lib64/libdoc_photo.so"], - shared_libs: ["liblog", "libOpenCL", "libjnigraphics", "libc", "libz", "libdl", "libm", ], + shared_libs: ["liblog", "libOpenCL_system", "libjnigraphics", "libc", "libz", "libdl", "libm", ], }, }, compile_multilib: "64", @@ -80,7 +200,7 @@ cc_prebuilt_library_shared { target: { android_arm64: { srcs: ["proprietary/system/lib64/libgallery_arcsoft_dualcam_refocus.so"], - shared_libs: ["libmpbase", "liblog", "libc", "libm", "libdl", ], + shared_libs: ["libmpbase_system", "liblog", "libc", "libm", "libdl", ], }, }, compile_multilib: "64", @@ -96,7 +216,7 @@ cc_prebuilt_library_shared { target: { android_arm64: { srcs: ["proprietary/system/lib64/libgallery_arcsoft_portrait_lighting.so"], - shared_libs: ["libmpbase", "libarcsoft_portrait_lighting_c", "liblog", "libc", "libm", "libdl", ], + shared_libs: ["libmpbase_system", "libarcsoft_portrait_lighting_c_system", "liblog", "libc", "libm", "libdl", ], }, }, compile_multilib: "64", @@ -112,7 +232,7 @@ cc_prebuilt_library_shared { target: { android_arm64: { srcs: ["proprietary/system/lib64/libgallery_arcsoft_portrait_lighting_c.so"], - shared_libs: ["libOpenCL", "liblog", "libdl", "libc", "libm", ], + shared_libs: ["libOpenCL_system", "liblog", "libdl", "libc", "libm", ], }, }, compile_multilib: "64", @@ -144,7 +264,24 @@ cc_prebuilt_library_shared { target: { android_arm64: { srcs: ["proprietary/system/lib64/libmibokeh_gallery.so"], - shared_libs: ["libOpenCL", "liblog", "libz", "libm", "libdl", "libc", ], + shared_libs: ["libOpenCL_system", "liblog", "libz", "libm", "libdl", "libc", ], + }, + }, + compile_multilib: "64", + prefer: true, +} + +cc_prebuilt_library_shared { + name: "libmpbase_system", + stem: "libmpbase", + owner: "xiaomi/miuicamera", + strip: { + none: true, + }, + target: { + android_arm64: { + srcs: ["proprietary/system/lib64/libmpbase.so"], + shared_libs: ["libc", ], }, }, compile_multilib: "64", diff --git a/common/common-vendor.mk b/common/common-vendor.mk index 6bef645..0b9e1c2 100644 --- a/common/common-vendor.mk +++ b/common/common-vendor.mk @@ -12,6 +12,13 @@ PRODUCT_COPY_FILES += \ vendor/xiaomi/miuicamera/common/proprietary/vendor/etc/init/vendor.xiaomi.hardware.misys@3.0-service.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/vendor.xiaomi.hardware.misys@3.0-service.rc PRODUCT_PACKAGES += \ + libOpenCL_system \ + libarcsoft_dualcam_refocus_system \ + libarcsoft_dualcam_refocus_front_system \ + libarcsoft_dualcam_refocus_rear_t_system \ + libarcsoft_dualcam_refocus_rear_w_system \ + libarcsoft_portrait_lighting_system \ + libarcsoft_portrait_lighting_c_system \ libcamera_algoup_jni.xiaomi \ libcamera_mianode_jni.xiaomi \ libdoc_photo \ @@ -21,6 +28,7 @@ PRODUCT_PACKAGES += \ libgallery_arcsoft_portrait_lighting_c \ libgallery_mpbase \ libmibokeh_gallery \ + libmpbase_system \ librefocus \ librefocus_mibokeh \ vendor.xiaomi.hardware.misys@1.0-impl \ diff --git a/common/proprietary/system/lib64/libOpenCL.so b/common/proprietary/system/lib64/libOpenCL.so new file mode 100644 index 0000000..75cd4dc Binary files /dev/null and b/common/proprietary/system/lib64/libOpenCL.so differ diff --git a/common/proprietary/system/lib64/libarcsoft_dualcam_refocus.so b/common/proprietary/system/lib64/libarcsoft_dualcam_refocus.so new file mode 100644 index 0000000..96da575 Binary files /dev/null and b/common/proprietary/system/lib64/libarcsoft_dualcam_refocus.so differ diff --git a/common/proprietary/system/lib64/libarcsoft_dualcam_refocus_front.so b/common/proprietary/system/lib64/libarcsoft_dualcam_refocus_front.so new file mode 100644 index 0000000..2e967cb Binary files /dev/null and b/common/proprietary/system/lib64/libarcsoft_dualcam_refocus_front.so differ diff --git a/common/proprietary/system/lib64/libarcsoft_dualcam_refocus_rear_t.so b/common/proprietary/system/lib64/libarcsoft_dualcam_refocus_rear_t.so new file mode 100644 index 0000000..74f629d Binary files /dev/null and b/common/proprietary/system/lib64/libarcsoft_dualcam_refocus_rear_t.so differ diff --git a/common/proprietary/system/lib64/libarcsoft_dualcam_refocus_rear_w.so b/common/proprietary/system/lib64/libarcsoft_dualcam_refocus_rear_w.so new file mode 100644 index 0000000..1c5a674 Binary files /dev/null and b/common/proprietary/system/lib64/libarcsoft_dualcam_refocus_rear_w.so differ diff --git a/common/proprietary/system/lib64/libarcsoft_portrait_lighting.so b/common/proprietary/system/lib64/libarcsoft_portrait_lighting.so new file mode 100644 index 0000000..13bf64f Binary files /dev/null and b/common/proprietary/system/lib64/libarcsoft_portrait_lighting.so differ diff --git a/common/proprietary/system/lib64/libarcsoft_portrait_lighting_c.so b/common/proprietary/system/lib64/libarcsoft_portrait_lighting_c.so new file mode 100644 index 0000000..0922410 Binary files /dev/null and b/common/proprietary/system/lib64/libarcsoft_portrait_lighting_c.so differ diff --git a/common/proprietary/system/lib64/libmpbase.so b/common/proprietary/system/lib64/libmpbase.so new file mode 100644 index 0000000..9561793 Binary files /dev/null and b/common/proprietary/system/lib64/libmpbase.so differ diff --git a/proprietary-files.txt b/proprietary-files.txt index 2e6d25b..e54941f 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -1,5 +1,15 @@ # All unpinned blobs below are extracted from V14.0.4.0.SJWMIXM (CURTANAGlobal) +# Dependencies +vendor/lib64/libmpbase.so:system/lib64/libmpbase.so;MODULE_SUFFIX=_system +vendor/lib64/libOpenCL.so:system/lib64/libOpenCL.so;MODULE_SUFFIX=_system +vendor/lib64/libarcsoft_dualcam_refocus.so:system/lib64/libarcsoft_dualcam_refocus.so;MODULE_SUFFIX=_system +vendor/lib64/libarcsoft_dualcam_refocus_front.so:system/lib64/libarcsoft_dualcam_refocus_front.so;MODULE_SUFFIX=_system +vendor/lib64/libarcsoft_dualcam_refocus_rear_t.so:system/lib64/libarcsoft_dualcam_refocus_rear_t.so;MODULE_SUFFIX=_system +vendor/lib64/libarcsoft_dualcam_refocus_rear_w.so:system/lib64/libarcsoft_dualcam_refocus_rear_w.so;MODULE_SUFFIX=_system +vendor/lib64/libarcsoft_portrait_lighting.so:system/lib64/libarcsoft_portrait_lighting.so;MODULE_SUFFIX=_system +vendor/lib64/libarcsoft_portrait_lighting_c.so:system/lib64/libarcsoft_portrait_lighting_c.so;MODULE_SUFFIX=_system + # MiSys vendor/bin/hw/vendor.xiaomi.hardware.misys@1.0-service vendor/bin/hw/vendor.xiaomi.hardware.misys@2.0-service diff --git a/setup-makefiles.sh b/setup-makefiles.sh index bd733f7..d87f531 100755 --- a/setup-makefiles.sh +++ b/setup-makefiles.sh @@ -23,6 +23,39 @@ if [ ! -f "${HELPER}" ]; then fi source "${HELPER}" +function vendor_imports() { + cat << EOF >> "$1" + "vendor/xiaomi/miuicamera", +EOF +} + +function lib_to_package_fixup_system_variants() { + if [ "$2" != "system" ]; then + return 1 + fi + case "$1" in + libmpbase | \ + libOpenCL | \ + libarcsoft_dualcam_refocus | \ + libarcsoft_dualcam_refocus_front | \ + libarcsoft_dualcam_refocus_rear_t | \ + libarcsoft_dualcam_refocus_rear_w | \ + libarcsoft_portrait_lighting | \ + libarcsoft_portrait_lighting_c) + echo "$1_system" + ;; + *) + return 1 + ;; + esac +} + +function lib_to_package_fixup() { + lib_to_package_fixup_clang_rt_ubsan_standalone "$1" || + lib_to_package_fixup_proto_3_9_1 "$1" || + lib_to_package_fixup_system_variants "$@" +} + # Initialize the helper setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" true