diff --git a/camera/Android.bp b/camera/Android.bp new file mode 100644 index 0000000..61d5bbe --- /dev/null +++ b/camera/Android.bp @@ -0,0 +1,21 @@ +// +// Copyright (C) 2020 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. + +cc_library_shared { + name: "libshim_megvii", + + proprietary: true, + srcs: ["megvii_shim.cpp"], +} diff --git a/camera/megvii_shim.cpp b/camera/megvii_shim.cpp new file mode 100644 index 0000000..02e05dc --- /dev/null +++ b/camera/megvii_shim.cpp @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2020 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. + */ + +namespace android { + extern "C" void mg_facepp() {} +} diff --git a/device.mk b/device.mk index 6907c2c..6183ed0 100644 --- a/device.mk +++ b/device.mk @@ -105,6 +105,9 @@ PRODUCT_PACKAGES += \ android.hardware.camera.provider@2.4-service_64 \ libdng_sdk.vendor +PRODUCT_PACKAGES += \ + libshim_megvii + PRODUCT_PACKAGES += \ Snap diff --git a/extract-files.sh b/extract-files.sh index bd51207..adb83bd 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -67,6 +67,11 @@ function blob_fixup() { lib64/libfm-hci.so) patchelf --remove-needed "android.hidl.base@1.0.so" "${2}" ;; + vendor/lib64/hw/camera.qcom.so) + patchelf --remove-needed "libMegviiFacepp-0.5.2.so" "${2}" + patchelf --remove-needed "libmegface.so" "${2}" + patchelf --add-needed "libshim_megvii.so" "${2}" + ;; esac } diff --git a/proprietary-files.txt b/proprietary-files.txt index 4fc2bfe..cc4e70f 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -124,8 +124,6 @@ vendor/lib64/libFaceGrade.so vendor/lib64/libft2vendor.so vendor/lib64/libHalSuperSensorServer.so vendor/lib64/libhexagon_nn_stub.so -vendor/lib64/libmegface.so -vendor/lib64/libMegviiFacepp-0.5.2.so vendor/lib64/libmialgo_basic.so vendor/lib64/libmialgo_fs.so vendor/lib64/libmialgo_rfs.so @@ -237,7 +235,6 @@ vendor/etc/camera/LDC_PACKDATA_VENDORID_0x07.bin vendor/etc/camera/LDC_table_src1.dat vendor/etc/camera/LDC_table_src2.dat vendor/etc/camera/lf_facerank_model.bin -vendor/etc/camera/megviifacepp_0_5_2_model vendor/etc/camera/sdm_ys_32p_120_21_5_perturb50.bin # Camera sensors