Skip to content

Commit

Permalink
cepheus: 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]>
  • Loading branch information
kazerine authored and EcrosoftXiao committed Mar 19, 2021
1 parent 69597d7 commit 3484642
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 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 @@ -119,6 +119,9 @@ TARGET_SCREEN_WIDTH := 1080
PRODUCT_PACKAGES += \
libdng_sdk.vendor

PRODUCT_PACKAGES += \
libshim_megvii

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 \
frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \
Expand Down
5 changes: 5 additions & 0 deletions extract-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ function blob_fixup() {
lib64/libfm-hci.so)
patchelf --remove-needed "[email protected]" "${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
}

Expand Down

0 comments on commit 3484642

Please sign in to comment.