Restructure to vendor/xiaomi/camera
Import from device/xiaomi/lisa-miuicamera: commit 33f736aa61e224998d5c121f6c38c944e49fea8d Author: Adithya R <gh0strider.2k18.reborn@gmail.com> Date: Fri Apr 21 16:54:19 2023 +0530 lisa-miuicamera: Update to V14.0.3.0.TKOMIXM commit 569341615b88bf864c135356a11a5338e058c9d4 Author: Adithya R <gh0strider.2k18.reborn@gmail.com> Date: Tue Jan 31 10:00:48 2023 +0530 lisa-miuicamera: Label libSNPE and deps as sphal We already have these in public.libraries.txt, just needs to be labeled as sphal so that Miui Camera can load it for clone mode. 01-30 23:10:20.988 5067 5067 I auditd : type=1400 audit(0.0:2944): avc: denied { read } for comm="CameraSetup" name="libSNPE.so" dev="dm-4" ino=2242 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:vendor_file:s0 tclass=file permissive=0 app=com.android.camera 01-30 23:10:20.988 5067 5067 W CameraSetup: type=1400 audit(0.0:2944): avc: denied { read } for name="libSNPE.so" dev="dm-4" ino=2242 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:vendor_file:s0 tclass=file permissive=0 app=com.android.camera 01-30 23:10:20.992 5067 5121 E CloneSDK: Load native library failed: java.lang.UnsatisfiedLinkError: dlopen failed: library "libSNPE.so" not found: needed by /data/user/0/com.android.camera/app_qigsaw/5.0.0.0/movielens/31.0.0@31/nativeLib/arm64-v8a/libfenshen_snpe.so in namespace classloader-namespace-shared commit d1ad3e40dd5c00fb97bb12d02668978698339599 Author: Adithya R <gh0strider.2k18.reborn@gmail.com> Date: Mon Jan 23 22:21:23 2023 +0530 lisa-miuicamera: Initial commit
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
// Automatically generated file. DO NOT MODIFY
|
// Automatically generated file. DO NOT MODIFY
|
||||||
//
|
//
|
||||||
// This file is generated by device/xiaomi/lisa-miuicamera/setup-makefiles.sh
|
// This file is generated by vendor/xiaomi/camera/setup-makefiles.sh
|
||||||
|
|
||||||
soong_namespace {
|
soong_namespace {
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-2
@@ -1,9 +1,20 @@
|
|||||||
# Automatically generated file. DO NOT MODIFY
|
# Automatically generated file. DO NOT MODIFY
|
||||||
#
|
#
|
||||||
# This file is generated by device/xiaomi/lisa-miuicamera/setup-makefiles.sh
|
# This file is generated by vendor/xiaomi/camera/setup-makefiles.sh
|
||||||
|
|
||||||
LOCAL_PATH := $(call my-dir)
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
|
||||||
ifeq ($(TARGET_DEVICE),lisa-miuicamera)
|
ifneq ($(filter lisa,$(TARGET_DEVICE)),)
|
||||||
|
|
||||||
|
CAMERA_LIBRARIES := libcamera_algoup_jni.xiaomi.so libcamera_mianode_jni.xiaomi.so
|
||||||
|
|
||||||
|
CAMERA_SYMLINKS := $(addprefix $(TARGET_OUT_APPS_PRIVILEGED)/MiuiCamera/lib/arm64/,$(notdir $(CAMERA_LIBRARIES)))
|
||||||
|
$(CAMERA_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||||
|
@echo "MiuiCamera lib link: $@"
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
@rm -rf $@
|
||||||
|
$(hide) ln -sf /system/lib64/$(notdir $@) $@
|
||||||
|
|
||||||
|
ALL_DEFAULT_INSTALLED_MODULES += $(CAMERA_SYMLINKS)
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Automatically generated file. DO NOT MODIFY
|
# Automatically generated file. DO NOT MODIFY
|
||||||
#
|
#
|
||||||
# This file is generated by device/xiaomi/lisa-miuicamera/setup-makefiles.sh
|
# This file is generated by vendor/xiaomi/camera/setup-makefiles.sh
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
# proprietary_vendor_xiaomi_camera
|
||||||
|
|
||||||
|
Prebuilt stock MIUI Camera to include in custom ROM builds.
|
||||||
|
|
||||||
|
Extracted from lisa MIUI package (refer proprietary-files.txt for version).
|
||||||
|
|
||||||
|
### Supported devices
|
||||||
|
* Xiaomi 11 Lite NE (lisa)
|
||||||
|
|
||||||
|
### How to use?
|
||||||
|
|
||||||
|
1. Clone this repo to `vendor/xiaomi/camera`
|
||||||
|
|
||||||
|
2. Inherit it from `device.mk` in device tree:
|
||||||
|
|
||||||
|
```
|
||||||
|
# Camera
|
||||||
|
$(call inherit-product-if-exists, vendor/xiaomi/camera/miuicamera.mk)
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Set `ro.product.mod_device` according to stock, and `ro.miui.notch=1` if the device has a display cutout, for example:
|
||||||
|
|
||||||
|
```
|
||||||
|
PRODUCT_SYSTEM_PROPERTIES += \
|
||||||
|
ro.miui.notch=1 \
|
||||||
|
ro.product.mod_device=lisa
|
||||||
|
```
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
# Automatically generated file. DO NOT MODIFY
|
||||||
|
#
|
||||||
|
# This file is generated by vendor/xiaomi/camera/setup-makefiles.sh
|
||||||
|
|
||||||
|
PRODUCT_SOONG_NAMESPACES += \
|
||||||
|
vendor/xiaomi/camera
|
||||||
|
|
||||||
|
PRODUCT_COPY_FILES += \
|
||||||
|
vendor/xiaomi/camera/proprietary/system/lib64/libcamera_algoup_jni.xiaomi.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/libcamera_algoup_jni.xiaomi.so \
|
||||||
|
vendor/xiaomi/camera/proprietary/system/lib64/libcamera_mianode_jni.xiaomi.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/libcamera_mianode_jni.xiaomi.so \
|
||||||
|
vendor/xiaomi/camera/proprietary/system/lib64/libgui-xiaomi.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/libgui-xiaomi.so \
|
||||||
|
vendor/xiaomi/camera/proprietary/system/lib64/libmicampostproc_client.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/libmicampostproc_client.so \
|
||||||
|
vendor/xiaomi/camera/proprietary/system/lib64/vendor.xiaomi.hardware.campostproc@1.0.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/vendor.xiaomi.hardware.campostproc@1.0.so
|
||||||
|
|
||||||
|
PRODUCT_PACKAGES += \
|
||||||
|
MiuiCamera
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<exceptions>
|
||||||
|
<exception package="com.android.camera">
|
||||||
|
<!-- Camera -->
|
||||||
|
<permission name="android.permission.CAMERA"
|
||||||
|
fixed="true" />
|
||||||
|
<!-- Location -->
|
||||||
|
<permission name="android.permission.ACCESS_FINE_LOCATION"
|
||||||
|
fixed="true" />
|
||||||
|
<permission name="android.permission.ACCESS_COARSE_LOCATION"
|
||||||
|
fixed="true" />
|
||||||
|
<!-- Microphone -->
|
||||||
|
<permission name="android.permission.RECORD_AUDIO"
|
||||||
|
fixed="true" />
|
||||||
|
<!-- Phone -->
|
||||||
|
<permission name="android.permission.READ_PHONE_STATE"
|
||||||
|
fixed="true" />
|
||||||
|
<!-- Storage -->
|
||||||
|
<permission name="android.permission.READ_EXTERNAL_STORAGE"
|
||||||
|
fixed="true" />
|
||||||
|
<permission name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||||
|
fixed="true" />
|
||||||
|
<permission name="android.permission.ACCESS_MEDIA_LOCATION"
|
||||||
|
fixed="true" />
|
||||||
|
<permission name="android.permission.WRITE_MEDIA_STORAGE"
|
||||||
|
fixed="true" />
|
||||||
|
<!-- Omni -->
|
||||||
|
<permission name="android.permission.INTERACT_ACROSS_USERS"
|
||||||
|
fixed="true" />
|
||||||
|
<permission name="android.permission.WRITE_SECURE_SETTINGS"
|
||||||
|
fixed="true" />
|
||||||
|
<permission name="android.permission.PACKAGE_USAGE_STATS"
|
||||||
|
fixed="true" />
|
||||||
|
<permission name="android.permission.POST_NOTIFICATIONS"
|
||||||
|
fixed="false"/>
|
||||||
|
</exception>
|
||||||
|
</exceptions>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<config>
|
||||||
|
<hidden-api-whitelisted-app package="com.android.camera" />
|
||||||
|
</config>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<permissions>
|
||||||
|
<privapp-permissions package="com.android.camera">
|
||||||
|
<permission name="android.permission.WRITE_MEDIA_STORAGE" />
|
||||||
|
<permission name="android.permission.WRITE_SECURE_SETTINGS" />
|
||||||
|
<permission name="android.permission.INTERACT_ACROSS_USERS" />
|
||||||
|
<permission name="android.permission.LOG_COMPAT_CHANGE" />
|
||||||
|
<permission name="android.permission.READ_COMPAT_CHANGE_CONFIG" />
|
||||||
|
<permission name="android.permission.START_ACTIVITIES_FROM_BACKGROUND" />
|
||||||
|
<permission name="android.permission.SYSTEM_CAMERA" />
|
||||||
|
</privapp-permissions>
|
||||||
|
</permissions>
|
||||||
Executable
+72
@@ -0,0 +1,72 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright (C) 2016 The CyanogenMod Project
|
||||||
|
# Copyright (C) 2017-2020 The LineageOS Project
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
DEVICE=camera
|
||||||
|
VENDOR=xiaomi
|
||||||
|
|
||||||
|
# Load extract_utils and do some sanity checks
|
||||||
|
MY_DIR="${BASH_SOURCE%/*}"
|
||||||
|
if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
|
||||||
|
|
||||||
|
ANDROID_ROOT="${MY_DIR}/../../.."
|
||||||
|
|
||||||
|
HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
|
||||||
|
if [ ! -f "${HELPER}" ]; then
|
||||||
|
echo "Unable to find helper script at ${HELPER}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
source "${HELPER}"
|
||||||
|
|
||||||
|
# Default to sanitizing the vendor folder before extraction
|
||||||
|
CLEAN_VENDOR=true
|
||||||
|
|
||||||
|
KANG=
|
||||||
|
SECTION=
|
||||||
|
|
||||||
|
while [ "${#}" -gt 0 ]; do
|
||||||
|
case "${1}" in
|
||||||
|
-n | --no-cleanup )
|
||||||
|
CLEAN_VENDOR=false
|
||||||
|
;;
|
||||||
|
-k | --kang )
|
||||||
|
KANG="--kang"
|
||||||
|
;;
|
||||||
|
-s | --section )
|
||||||
|
SECTION="${2}"; shift
|
||||||
|
CLEAN_VENDOR=false
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
SRC="${1}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z "${SRC}" ]; then
|
||||||
|
SRC="adb"
|
||||||
|
fi
|
||||||
|
|
||||||
|
function blob_fixup() {
|
||||||
|
case "${1}" in
|
||||||
|
system/lib64/libgui-xiaomi.so)
|
||||||
|
patchelf --set-soname libgui-xiaomi.so "${2}"
|
||||||
|
;;
|
||||||
|
system/lib64/libcamera_algoup_jni.xiaomi.so|system/lib64/libcamera_mianode_jni.xiaomi.so)
|
||||||
|
patchelf --replace-needed libgui.so libgui-xiaomi.so "${2}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
# Initialize the helper
|
||||||
|
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}"
|
||||||
|
|
||||||
|
extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"
|
||||||
|
|
||||||
|
"${MY_DIR}/setup-makefiles.sh"
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
# Automatically generated file. DO NOT MODIFY
|
|
||||||
#
|
|
||||||
# This file is generated by device/xiaomi/lisa-miuicamera/setup-makefiles.sh
|
|
||||||
|
|
||||||
PRODUCT_SOONG_NAMESPACES += \
|
|
||||||
vendor/xiaomi/lisa-miuicamera
|
|
||||||
|
|
||||||
PRODUCT_COPY_FILES += \
|
|
||||||
vendor/xiaomi/lisa-miuicamera/proprietary/system/lib64/libcamera_algoup_jni.xiaomi.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/libcamera_algoup_jni.xiaomi.so \
|
|
||||||
vendor/xiaomi/lisa-miuicamera/proprietary/system/lib64/libcamera_mianode_jni.xiaomi.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/libcamera_mianode_jni.xiaomi.so \
|
|
||||||
vendor/xiaomi/lisa-miuicamera/proprietary/system/lib64/libgui-xiaomi.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/libgui-xiaomi.so \
|
|
||||||
vendor/xiaomi/lisa-miuicamera/proprietary/system/lib64/libmicampostproc_client.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/libmicampostproc_client.so \
|
|
||||||
vendor/xiaomi/lisa-miuicamera/proprietary/system/lib64/vendor.xiaomi.hardware.campostproc@1.0.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/vendor.xiaomi.hardware.campostproc@1.0.so
|
|
||||||
|
|
||||||
PRODUCT_PACKAGES += \
|
|
||||||
MiuiCamera
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2023 Paranoid Android
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
|
# Permissions
|
||||||
|
PRODUCT_COPY_FILES += \
|
||||||
|
vendor/xiaomi/camera/configs/permissions/default-permissions-miuicamera.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/default-permissions/default-permissions-miuicamera.xml \
|
||||||
|
vendor/xiaomi/camera/configs/permissions/miuicamera-hiddenapi-package-whitelist.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/sysconfig/miuicamera-hiddenapi-package-whitelist.xml \
|
||||||
|
vendor/xiaomi/camera/configs/permissions/privapp-permissions-miuicamera.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/privapp-permissions-miuicamera.xml
|
||||||
|
|
||||||
|
# Properties
|
||||||
|
PRODUCT_SYSTEM_PROPERTIES += \
|
||||||
|
persist.vendor.camera.privapp.list=org.codeaurora.snapcam,com.android.camera \
|
||||||
|
ro.com.google.lens.oem_camera_package=com.android.camera \
|
||||||
|
vendor.camera.aux.packagelist=org.codeaurora.snapcam,com.android.camera
|
||||||
|
|
||||||
|
# Sepolicy
|
||||||
|
BOARD_VENDOR_SEPOLICY_DIRS += \
|
||||||
|
vendor/xiaomi/camera/sepolicy/vendor
|
||||||
|
|
||||||
|
$(call inherit-product, vendor/xiaomi/camera/camera-vendor.mk)
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# From lisa MIUI V14.0.3.0.TKOMIXM package
|
||||||
|
-product/priv-app/MiuiCamera/MiuiCamera.apk:system/priv-app/MiuiCamera/MiuiCamera.apk;OVERRIDES=Camera,Camera2,GoogleCameraGo
|
||||||
|
system/lib64/libcamera_algoup_jni.xiaomi.so
|
||||||
|
system/lib64/libcamera_mianode_jni.xiaomi.so
|
||||||
|
system/lib64/libgui.so:system/lib64/libgui-xiaomi.so
|
||||||
|
system/lib64/libmicampostproc_client.so
|
||||||
|
system/lib64/vendor.xiaomi.hardware.campostproc@1.0.so
|
||||||
Vendored
+8
@@ -0,0 +1,8 @@
|
|||||||
|
/vendor/lib(64)?/libSNPE\.so u:object_r:same_process_hal_file:s0
|
||||||
|
/vendor/lib(64)?/libc\+\+_shared\.so u:object_r:same_process_hal_file:s0
|
||||||
|
/vendor/lib(64)?/libhta\.so u:object_r:same_process_hal_file:s0
|
||||||
|
/vendor/lib(64)?/libsnpe_dsp_domains_v2\.so u:object_r:same_process_hal_file:s0
|
||||||
|
/vendor/lib(64)?/libsnpe_dsp_domains_v3\.so u:object_r:same_process_hal_file:s0
|
||||||
|
/vendor/lib(64)?/rfsa/adsp/libsnpe_htp_v65_skel\.so u:object_r:same_process_hal_file:s0
|
||||||
|
/vendor/lib(64)?/rfsa/adsp/libsnpe_htp_v66_skel\.so u:object_r:same_process_hal_file:s0
|
||||||
|
/vendor/lib(64)?/rfsa/adsp/libsnpe_htp_v68_skel\.so u:object_r:same_process_hal_file:s0
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
binder_call(hal_camera_default, platform_app)
|
||||||
Vendored
+7
@@ -0,0 +1,7 @@
|
|||||||
|
allow platform_app app_data_file:file execute;
|
||||||
|
allow platform_app hal_xiaomi_camera_hwservice:hwservice_manager find;
|
||||||
|
|
||||||
|
binder_call(platform_app, hal_camera_default)
|
||||||
|
|
||||||
|
get_prop(platform_app, vendor_camera_prop)
|
||||||
|
get_prop(platform_app, vendor_fp_prop)
|
||||||
Executable
+52
@@ -0,0 +1,52 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright (C) 2016 The CyanogenMod Project
|
||||||
|
# Copyright (C) 2017-2020 The LineageOS Project
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
DEVICE=camera
|
||||||
|
DEVICE_COMMON=camera
|
||||||
|
VENDOR=xiaomi
|
||||||
|
|
||||||
|
# Load extract_utils and do some sanity checks
|
||||||
|
MY_DIR="${BASH_SOURCE%/*}"
|
||||||
|
if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
|
||||||
|
|
||||||
|
ANDROID_ROOT="${MY_DIR}/../../.."
|
||||||
|
|
||||||
|
HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
|
||||||
|
if [ ! -f "${HELPER}" ]; then
|
||||||
|
echo "Unable to find helper script at ${HELPER}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
source "${HELPER}"
|
||||||
|
|
||||||
|
# Initialize the helper
|
||||||
|
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" true
|
||||||
|
|
||||||
|
# Warning headers and guards
|
||||||
|
write_headers "lisa"
|
||||||
|
sed -i 's|device/|vendor/|g' "$ANDROIDBP" "$ANDROIDMK" "$BOARDMK" "$PRODUCTMK"
|
||||||
|
|
||||||
|
cat << 'EOF' >> "$ANDROIDMK"
|
||||||
|
CAMERA_LIBRARIES := libcamera_algoup_jni.xiaomi.so libcamera_mianode_jni.xiaomi.so
|
||||||
|
|
||||||
|
CAMERA_SYMLINKS := $(addprefix $(TARGET_OUT_APPS_PRIVILEGED)/MiuiCamera/lib/arm64/,$(notdir $(CAMERA_LIBRARIES)))
|
||||||
|
$(CAMERA_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||||
|
@echo "MiuiCamera lib link: $@"
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
@rm -rf $@
|
||||||
|
$(hide) ln -sf /system/lib64/$(notdir $@) $@
|
||||||
|
|
||||||
|
ALL_DEFAULT_INSTALLED_MODULES += $(CAMERA_SYMLINKS)
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
write_makefiles "${MY_DIR}/proprietary-files.txt" true
|
||||||
|
|
||||||
|
# Finish
|
||||||
|
write_footers
|
||||||
Reference in New Issue
Block a user