aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNolen Johnson <johnsonnolen@gmail.com>2021-01-10 15:23:33 -0500
committerJoshua Blanchard <joshua.lee.bbg@gmail.com>2021-04-03 20:24:22 -0400
commitcf0009937bcf552c53d63d9fb74e81c7d79b4b73 (patch)
tree28235b6d9678442bde7ee4528c582bf3e60b3bf5
parentf32e129486de9944a05309294f15a1e9a6bd34c3 (diff)
beckham: Move MotCamera2 back to Android.mk [1/2]
- To pull this off using common tree setup, we create a custom function in target device tree that achieves the desired result and then call that function during vendor makefile generation. Original commit description: "I hate this as much as any of you, but Android.bp has no native way to tell the build system to literally just copy the APK without messing unnecessarily with JNI dependencies." Signed-off-by: Joshua Blanchard <joshua.lee.bbg@gmail.com> Change-Id: I5efd9534fc3721061e249e2a5545a14e707538d2
-rwxr-xr-xsetup-makefiles.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/setup-makefiles.sh b/setup-makefiles.sh
index 5ac575d..762c776 100755
--- a/setup-makefiles.sh
+++ b/setup-makefiles.sh
@@ -6,8 +6,33 @@
# SPDX-License-Identifier: Apache-2.0
#
+function write_motcam_androidmk() {
+ # Move MotCamera2 back to Android.mk to prevent JNI build-system from
+ # messing with pre-packed JNI dependencies
+ cat << EOF >> "$ANDROIDMK"
+include \$(CLEAR_VARS)
+LOCAL_MODULE := MotCamera2
+LOCAL_MODULE_OWNER := motorola
+LOCAL_SRC_FILES := proprietary/system/priv-app/MotCamera2/MotCamera2.apk
+LOCAL_CERTIFICATE := PRESIGNED
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := APPS
+LOCAL_DEX_PREOPT := false
+LOCAL_MODULE_SUFFIX := .apk
+LOCAL_PRIVILEGED_MODULE := true
+LOCAL_REPLACE_PREBUILT_APK_INSTALLED := \$(LOCAL_PATH)/\$(LOCAL_SRC_FILES)
+include \$(BUILD_PREBUILT)
+
+EOF
+
+ sed -i '/MotCamera2/,+10d' "${ANDROID_ROOT}/vendor/${VENDOR}/${DEVICE}/Android.bp"
+}
+
set -e
+export -f write_motcam_androidmk
+export USES_MOTCAMERA=true
+
export DEVICE=beckham
export DEVICE_COMMON=sdm660-common
export VENDOR=motorola