Skip to content

Commit

Permalink
davinci: Get rid of megvii dependencies in camera.qcom.so
Browse files Browse the repository at this point in the history
Change-Id: I97058c320d06819a468ebe38e2704360e9aa91db
Signed-off-by: Arian <[email protected]>
Signed-off-by: adi8900 <[email protected]>
  • Loading branch information
kazerine authored and adi8900 committed Feb 7, 2021
1 parent 47ec9ab commit 333c63a
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 4 deletions.
21 changes: 21 additions & 0 deletions camera/Android.bp
Original file line number Diff line number Diff line change
@@ -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"],
}
19 changes: 19 additions & 0 deletions camera/megvii_shim.cpp
Original file line number Diff line number Diff line change
@@ -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() {}
}
3 changes: 3 additions & 0 deletions device.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ PRODUCT_COPY_FILES += \
PRODUCT_PACKAGES += \
[email protected]

PRODUCT_PACKAGES += \
libshim_megvii

# Fingerprint
PRODUCT_PACKAGES += \
vendor.lineage.biometrics.fingerprint.inscreen@1.0-service.xiaomi_sm6150
Expand Down
12 changes: 11 additions & 1 deletion extract-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,14 @@ export VENDOR=xiaomi

export DEVICE_BRINGUP_YEAR=2019

"./../../${VENDOR}/${DEVICE_COMMON}/extract-files.sh" "$@"
function blob_fixup() {
case "${1}" in
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
}

"./../../${VENDOR}/${DEVICE_COMMON}/extract-files.sh" "$@"
3 changes: 0 additions & 3 deletions proprietary-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ vendor/etc/camera/LDC_table_src2.dat
vendor/etc/camera/lf_facerank_model.bin
vendor/etc/camera/male_bg.png
vendor/etc/camera/male_icon.png
vendor/etc/camera/megviifacepp_0_5_2_model
vendor/etc/camera/mibokeh_712_opencl.bin
vendor/etc/camera/mibokeh_712_parameter.bin
vendor/etc/camera/Roboto-Thin.ttf
Expand Down Expand Up @@ -158,7 +157,6 @@ vendor/lib64/hw/camera.qcom.so
vendor/lib64/hw/com.qti.chi.override.so
vendor/lib64/libFaceGrade.so
vendor/lib64/libHalSuperSensorServer.so
vendor/lib64/libMegviiFacepp-0.5.2.so
vendor/lib64/libSuperSensor.so
vendor/lib64/libSuperSensorCPU.so
vendor/lib64/libVDClearShot.so
Expand Down Expand Up @@ -199,7 +197,6 @@ vendor/lib64/libcapiv2svacnn.so
vendor/lib64/libcapiv2vop.so
vendor/lib64/libcom.qti.chinodeutils.so
vendor/lib64/libft2vendor.so
vendor/lib64/libmegface.so
vendor/lib64/libmialgoengine.so
vendor/lib64/libmialgo_fs.so
vendor/lib64/libmialgo_rfs.so
Expand Down

0 comments on commit 333c63a

Please sign in to comment.