Compare commits

3 Commits
Author SHA1 Message Date
probaero b1e1c098c6 rosemary: Build bluetooth A2DP stack from source 2026-04-11 21:33:26 +07:00
Arianandprobaero a61b6fd7ac rosemary: Patch a few camera blobs to allocate GraphicBuffer with new size
Commit [1] ("Introduce a dependency monitor for fences") has added new
members to the GraphicBuffer struct, increasing the size from 0x100 to
0xd30. camera.xiaomi.so creates GraphicBuffer in its constructors using
"new GraphicBuffer(..)" which encodes the size to allocate at compile
time. Then, on destruction of the object, the implicit destructor will
try to destruct the new members, but, since this memory was not
allocated for the object, this leads to memory access of unallocated
storage.

F DEBUG   : backtrace:
F DEBUG   :       #00 pc 000000000003ba00  /vendor/lib64/libui.so (__aarch64_ldadd8_acq_rel+16) (BuildId: b577faa139eb3404c7d3a674b147634c)
F DEBUG   :       #01 pc 0000000000051364  /vendor/lib64/libui.so (android::GraphicBuffer::~GraphicBuffer()+248) (BuildId: b577faa139eb3404c7d3a674b147634c)
F DEBUG   :       #02 pc 0000000000051698  /vendor/lib64/libui.so (android::GraphicBuffer::~GraphicBuffer()+20) (BuildId: b577faa139eb3404c7d3a674b147634c)
F DEBUG   :       #03 pc 0000000000011064  /vendor/lib64/libutils.so (android::RefBase::decStrong(void const*) const+164) (BuildId: 99d1ab745e7b73420d8d2b397483ef54)
F DEBUG   :       #04 pc 00000000000cd538  /vendor/lib64/hw/camera.xiaomi.so (mihal::GraBuffer::~GraBuffer()+236) (BuildId: a4c59705588bd26d407f0ab181902baf)

[1]: https://github.com/LineageOS/android_frameworks_native/commit/df868baf2abefbb45341530d20a948ffd6b2c304

Change-Id: I239c31b6ea5a7813abc3e9cfbefb6d2bdcc1a9e0
Signed-off-by: therealmharc <therealmharc@gmail.com>
Signed-off-by: Ido <dev.xyzuniverse@gmail.com>
2026-04-11 21:30:48 +07:00
probaero 4c7d15345f rosemary: drop lfs config 2026-03-27 22:44:50 +07:00
28 changed files with 80 additions and 361 deletions
+75 -342
View File
@@ -2186,6 +2186,36 @@ cc_prebuilt_library_shared {
soc_specific: true, soc_specific: true,
} }
cc_prebuilt_library_shared {
name: "audio.r_submix.mt6785",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm: {
srcs: [
"proprietary/vendor/lib/hw/audio.r_submix.mt6785.so",
],
shared_libs: [
"liblog",
"libcutils",
"libmedia_helper",
"libutils",
"libnbaio_mono",
"libc++",
"libc",
"libm",
"libdl",
],
},
},
compile_multilib: "32",
relative_install_path: "hw",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared { cc_prebuilt_library_shared {
name: "sound_trigger.primary.default", name: "sound_trigger.primary.default",
owner: "xiaomi", owner: "xiaomi",
@@ -19661,170 +19691,6 @@ cc_prebuilt_library_shared {
soc_specific: true, soc_specific: true,
} }
cc_prebuilt_library_shared {
name: "libcodec2_hidl@1.0-v31",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: [
"proprietary/vendor/lib64/libcodec2_hidl@1.0-v31.so",
],
shared_libs: [
"libbase_shim",
"android.hardware.graphics.bufferqueue@1.0",
"android.hardware.graphics.bufferqueue@2.0",
"android.hardware.graphics.common@1.0",
"android.hardware.media@1.0",
"android.hardware.media.bufferpool@2.0",
"android.hardware.media.c2@1.0",
"android.hardware.media.omx@1.0",
"libbase",
"libcodec2",
"libcodec2_vndk-v31",
"libcutils",
"libhidlbase",
"liblog",
"libstagefright_bufferpool@2.0.1",
"libui-v34",
"libutils",
"libstagefright_bufferqueue_helper-v33",
"libcodec2_hidl_plugin-v31",
"libc++",
"libc",
"libm",
"libdl",
],
},
},
compile_multilib: "64",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared {
name: "libcodec2_hidl@1.1-v31",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: [
"proprietary/vendor/lib64/libcodec2_hidl@1.1-v31.so",
],
shared_libs: [
"libbase_shim",
"android.hardware.graphics.bufferqueue@1.0",
"android.hardware.graphics.bufferqueue@2.0",
"android.hardware.graphics.common@1.0",
"android.hardware.media@1.0",
"android.hardware.media.bufferpool@2.0",
"android.hardware.media.c2@1.0",
"android.hardware.media.c2@1.1",
"android.hardware.media.omx@1.0",
"libbase",
"libcodec2",
"libcodec2_hidl@1.0-v31",
"libcodec2_vndk-v31",
"libcutils",
"libhidlbase",
"liblog",
"libstagefright_bufferpool@2.0.1",
"libui-v34",
"libutils",
"libstagefright_bufferqueue_helper-v33",
"libcodec2_hidl_plugin-v31",
"libc++",
"libc",
"libm",
"libdl",
],
},
},
compile_multilib: "64",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared {
name: "libcodec2_hidl@1.2-v31",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: [
"proprietary/vendor/lib64/libcodec2_hidl@1.2-v31.so",
],
shared_libs: [
"libbase_shim",
"android.hardware.graphics.bufferqueue@1.0",
"android.hardware.graphics.bufferqueue@2.0",
"android.hardware.graphics.common@1.0",
"android.hardware.media@1.0",
"android.hardware.media.bufferpool@2.0",
"android.hardware.media.c2@1.0",
"android.hardware.media.c2@1.1",
"android.hardware.media.c2@1.2",
"android.hardware.media.omx@1.0",
"libbase",
"libcodec2",
"libcodec2_hidl@1.0-v31",
"libcodec2_hidl@1.1-v31",
"libcodec2_vndk-v31",
"libcutils",
"libhidlbase",
"liblog",
"libstagefright_bufferpool@2.0.1",
"libui-v34",
"libutils",
"libstagefright_bufferqueue_helper-v33",
"libcodec2_hidl_plugin-v31",
"libc++",
"libc",
"libm",
"libdl",
],
},
},
compile_multilib: "64",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared {
name: "libcodec2_hidl_plugin-v31",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: [
"proprietary/vendor/lib64/libcodec2_hidl_plugin-v31.so",
],
shared_libs: [
"libbase",
"libcodec2",
"libcodec2_vndk-v31",
"liblog",
"libutils",
"libc++",
"libc",
"libm",
"libdl",
],
},
},
compile_multilib: "64",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared { cc_prebuilt_library_shared {
name: "libcodec2_mtk_c2store", name: "libcodec2_mtk_c2store",
owner: "xiaomi", owner: "xiaomi",
@@ -19837,14 +19703,14 @@ cc_prebuilt_library_shared {
"proprietary/vendor/lib64/libcodec2_mtk_c2store.so", "proprietary/vendor/lib64/libcodec2_mtk_c2store.so",
], ],
shared_libs: [ shared_libs: [
"libcodec2_soft_common-v31", "libcodec2_soft_common",
"libcutils", "libcutils",
"liblog", "liblog",
"libsfplugin_ccodec_utils-v31", "libsfplugin_ccodec_utils",
"libstagefright_foundation-v33", "libstagefright_foundation",
"libbase", "libbase",
"libcodec2", "libcodec2",
"libcodec2_vndk-v31", "libcodec2_vndk",
"libutils", "libutils",
"libion", "libion",
"libion_mtk", "libion_mtk",
@@ -19876,21 +19742,21 @@ cc_prebuilt_library_shared {
"libformatter", "libformatter",
"libdpframework", "libdpframework",
"android.hardware.graphics.bufferqueue@2.0", "android.hardware.graphics.bufferqueue@2.0",
"libui-v34", "libui",
"libgralloc_extra", "libgralloc_extra",
"libexpat", "libexpat",
"libsync", "libsync",
"libhidlbase", "libhidlbase",
"libhwbinder", "libhwbinder",
"libged", "libged",
"libcodec2_soft_common-v31", "libcodec2_soft_common",
"libcutils", "libcutils",
"liblog", "liblog",
"libsfplugin_ccodec_utils-v31", "libsfplugin_ccodec_utils",
"libstagefright_foundation-v33", "libstagefright_foundation",
"libbase", "libbase",
"libcodec2", "libcodec2",
"libcodec2_vndk-v31", "libcodec2_vndk",
"libutils", "libutils",
"libion", "libion",
"libdmabufheap", "libdmabufheap",
@@ -19925,21 +19791,21 @@ cc_prebuilt_library_shared {
"libformatter", "libformatter",
"libdpframework", "libdpframework",
"android.hardware.graphics.bufferqueue@2.0", "android.hardware.graphics.bufferqueue@2.0",
"libui-v34", "libui",
"libgralloc_extra", "libgralloc_extra",
"libexpat", "libexpat",
"libsync", "libsync",
"libhidlbase", "libhidlbase",
"libhwbinder", "libhwbinder",
"libged", "libged",
"libcodec2_soft_common-v31", "libcodec2_soft_common",
"libcutils", "libcutils",
"liblog", "liblog",
"libsfplugin_ccodec_utils-v31", "libsfplugin_ccodec_utils",
"libstagefright_foundation-v33", "libstagefright_foundation",
"libbase", "libbase",
"libcodec2", "libcodec2",
"libcodec2_vndk-v31", "libcodec2_vndk",
"libutils", "libutils",
"libion", "libion",
"libdmabufheap", "libdmabufheap",
@@ -19957,38 +19823,6 @@ cc_prebuilt_library_shared {
soc_specific: true, soc_specific: true,
} }
cc_prebuilt_library_shared {
name: "libcodec2_soft_common-v31",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: [
"proprietary/vendor/lib64/libcodec2_soft_common-v31.so",
],
shared_libs: [
"libbase",
"libcodec2",
"libcodec2_vndk-v31",
"libutils",
"libcutils",
"liblog",
"libsfplugin_ccodec_utils-v31",
"libstagefright_foundation-v33",
"libc++",
"libc",
"libm",
"libdl",
],
},
},
compile_multilib: "64",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared { cc_prebuilt_library_shared {
name: "libcodec2_soft_mtk_alacdec", name: "libcodec2_soft_mtk_alacdec",
owner: "xiaomi", owner: "xiaomi",
@@ -20161,46 +19995,6 @@ cc_prebuilt_library_shared {
soc_specific: true, soc_specific: true,
} }
cc_prebuilt_library_shared {
name: "libcodec2_vndk-v31",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: [
"proprietary/vendor/lib64/libcodec2_vndk-v31.so",
],
shared_libs: [
"android.hardware.graphics.bufferqueue@2.0",
"android.hardware.graphics.common@1.2",
"android.hardware.media.bufferpool@2.0",
"libbase",
"libcutils",
"libhardware",
"libhidlbase",
"libion",
"libdmabufheap",
"libfmq",
"liblog",
"libnativewindow",
"libstagefright_foundation-v33",
"libstagefright_bufferpool@2.0.1",
"libui-v34",
"libutils",
"libc++",
"libc",
"libm",
"libdl",
],
},
},
compile_multilib: "64",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared { cc_prebuilt_library_shared {
name: "libcodec2_vpp_qt_plugin", name: "libcodec2_vpp_qt_plugin",
owner: "xiaomi", owner: "xiaomi",
@@ -20213,11 +20007,11 @@ cc_prebuilt_library_shared {
"proprietary/vendor/lib64/libcodec2_vpp_qt_plugin.so", "proprietary/vendor/lib64/libcodec2_vpp_qt_plugin.so",
], ],
shared_libs: [ shared_libs: [
"libcodec2_soft_common-v31", "libcodec2_soft_common",
"libsfplugin_ccodec_utils-v31", "libsfplugin_ccodec_utils",
"libstagefright_foundation-v33", "libstagefright_foundation",
"libcodec2", "libcodec2",
"libcodec2_vndk-v31", "libcodec2_vndk",
"liblog", "liblog",
"libbase", "libbase",
"libutils", "libutils",
@@ -20246,11 +20040,11 @@ cc_prebuilt_library_shared {
"proprietary/vendor/lib64/libcodec2_vpp_rs_plugin.so", "proprietary/vendor/lib64/libcodec2_vpp_rs_plugin.so",
], ],
shared_libs: [ shared_libs: [
"libcodec2_soft_common-v31", "libcodec2_soft_common",
"libsfplugin_ccodec_utils-v31", "libsfplugin_ccodec_utils",
"libstagefright_foundation-v33", "libstagefright_foundation",
"libcodec2", "libcodec2",
"libcodec2_vndk-v31", "libcodec2_vndk",
"liblog", "liblog",
"libbase", "libbase",
"libutils", "libutils",
@@ -25461,38 +25255,6 @@ cc_prebuilt_library_shared {
soc_specific: true, soc_specific: true,
} }
cc_prebuilt_library_shared {
name: "libsfplugin_ccodec_utils-v31",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: [
"proprietary/vendor/lib64/libsfplugin_ccodec_utils-v31.so",
],
shared_libs: [
"libbase",
"libcodec2",
"libcodec2_vndk-v31",
"libcutils",
"liblog",
"libnativewindow",
"libstagefright_foundation",
"libutils",
"libc++",
"libc",
"libm",
"libdl",
],
},
},
compile_multilib: "64",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared { cc_prebuilt_library_shared {
name: "libsimaka", name: "libsimaka",
owner: "xiaomi", owner: "xiaomi",
@@ -25596,41 +25358,6 @@ cc_prebuilt_library_shared {
soc_specific: true, soc_specific: true,
} }
cc_prebuilt_library_shared {
name: "libstagefright_bufferqueue_helper-v33",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: [
"proprietary/vendor/lib64/libstagefright_bufferqueue_helper-v33.so",
],
shared_libs: [
"libbase",
"libcutils",
"libhidlbase",
"libhidlmemory",
"liblog",
"libstagefright_foundation",
"libui",
"libutils",
"android.hardware.graphics.bufferqueue@1.0",
"android.hardware.graphics.bufferqueue@2.0",
"libgui",
"libc++",
"libc",
"libm",
"libdl",
],
},
},
compile_multilib: "64",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared { cc_prebuilt_library_shared {
name: "libstereoinfoaccessor_vsdof", name: "libstereoinfoaccessor_vsdof",
owner: "xiaomi", owner: "xiaomi",
@@ -29359,17 +29086,6 @@ android_app_import {
privileged: true, privileged: true,
} }
android_app_import {
name: "MtkGbaService",
owner: "xiaomi",
apk: "proprietary/system/priv-app/MtkGbaService/MtkGbaService.apk",
certificate: "platform",
dex_preopt: {
enabled: false,
},
privileged: true,
}
android_app_import { android_app_import {
name: "HotwordEnrollmentOKGoogleCORTEXM4", name: "HotwordEnrollmentOKGoogleCORTEXM4",
owner: "xiaomi", owner: "xiaomi",
@@ -29394,6 +29110,22 @@ android_app_import {
product_specific: true, product_specific: true,
} }
dex_import {
name: "mediatek-common",
owner: "xiaomi",
jars: [
"proprietary/system/framework/mediatek-common.jar",
],
}
dex_import {
name: "mediatek-framework",
owner: "xiaomi",
jars: [
"proprietary/system/framework/mediatek-framework.jar",
],
}
dex_import { dex_import {
name: "mediatek-ims-base", name: "mediatek-ims-base",
owner: "xiaomi", owner: "xiaomi",
@@ -29506,9 +29238,9 @@ prebuilt_etc_xml {
} }
prebuilt_etc_xml { prebuilt_etc_xml {
name: "manifest_media_c2_V1_2_default.xml", name: "manifest_media_c2_V1_1_default.xml",
owner: "xiaomi", owner: "xiaomi",
src: "proprietary/vendor/etc/vintf/manifest/manifest_media_c2_V1_2_default.xml", src: "proprietary/vendor/etc/vintf/manifest/manifest_media_c2_V1_1_default.xml",
filename_from_src: true, filename_from_src: true,
sub_dir: "vintf/manifest", sub_dir: "vintf/manifest",
soc_specific: true, soc_specific: true,
@@ -30008,6 +29740,7 @@ cc_prebuilt_binary {
"proprietary/vendor/bin/hw/android.hardware.media.c2@1.2-mediatek-64b", "proprietary/vendor/bin/hw/android.hardware.media.c2@1.2-mediatek-64b",
], ],
shared_libs: [ shared_libs: [
"libstagefright_foundation-v33",
"libbase", "libbase",
"liblog", "liblog",
"libcodec2", "libcodec2",
@@ -30015,10 +29748,10 @@ cc_prebuilt_binary {
"android.hardware.media.c2@1.0", "android.hardware.media.c2@1.0",
"android.hardware.media.c2@1.1", "android.hardware.media.c2@1.1",
"android.hardware.media.c2@1.2", "android.hardware.media.c2@1.2",
"libcodec2_hidl@1.0-v31", "libcodec2_hidl@1.0",
"libcodec2_hidl@1.1-v31", "libcodec2_hidl@1.1",
"libcodec2_hidl@1.2-v31", "libcodec2_hidl@1.2",
"libcodec2_vndk-v31", "libcodec2_vndk",
"libhidlbase", "libhidlbase",
"libavservices_minijail", "libavservices_minijail",
"libbinder", "libbinder",
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2,7 +2,7 @@
<hal> <hal>
<name>android.hardware.media.c2</name> <name>android.hardware.media.c2</name>
<transport>hwbinder</transport> <transport>hwbinder</transport>
<version>1.2</version> <version>1.1</version>
<interface> <interface>
<name>IComponentStore</name> <name>IComponentStore</name>
<instance>default</instance> <instance>default</instance>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+4 -18
View File
@@ -613,6 +613,7 @@ PRODUCT_PACKAGES += \
vendor.mediatek.hardware.nvram@1.0 \ vendor.mediatek.hardware.nvram@1.0 \
vendor.mediatek.hardware.nvram@1.1 \ vendor.mediatek.hardware.nvram@1.1 \
audio.primary.mt6785 \ audio.primary.mt6785 \
audio.r_submix.mt6785 \
sound_trigger.primary.default \ sound_trigger.primary.default \
libHEVCdec_sa.ca7.android \ libHEVCdec_sa.ca7.android \
libMtkSpeechEnh \ libMtkSpeechEnh \
@@ -1279,20 +1280,14 @@ PRODUCT_PACKAGES += \
libccci_util \ libccci_util \
libcharon-ss \ libcharon-ss \
libchromanr \ libchromanr \
libcodec2_hidl@1.0-v31 \
libcodec2_hidl@1.1-v31 \
libcodec2_hidl@1.2-v31 \
libcodec2_hidl_plugin-v31 \
libcodec2_mtk_c2store \ libcodec2_mtk_c2store \
libcodec2_mtk_vdec \ libcodec2_mtk_vdec \
libcodec2_mtk_venc \ libcodec2_mtk_venc \
libcodec2_soft_common-v31 \
libcodec2_soft_mtk_alacdec \ libcodec2_soft_mtk_alacdec \
libcodec2_soft_mtk_apedec \ libcodec2_soft_mtk_apedec \
libcodec2_soft_mtk_imaadpcmdec \ libcodec2_soft_mtk_imaadpcmdec \
libcodec2_soft_mtk_mp3dec \ libcodec2_soft_mtk_mp3dec \
libcodec2_soft_mtk_msadpcmdec \ libcodec2_soft_mtk_msadpcmdec \
libcodec2_vndk-v31 \
libcodec2_vpp_qt_plugin \ libcodec2_vpp_qt_plugin \
libcodec2_vpp_rs_plugin \ libcodec2_vpp_rs_plugin \
libcomposer_ext \ libcomposer_ext \
@@ -1452,12 +1447,10 @@ PRODUCT_PACKAGES += \
librpc \ librpc \
libsdk_sr \ libsdk_sr \
libsensor_custom \ libsensor_custom \
libsfplugin_ccodec_utils-v31 \
libsimaka \ libsimaka \
libsimlock \ libsimlock \
libsimmelock \ libsimmelock \
libssl-md \ libssl-md \
libstagefright_bufferqueue_helper-v33 \
libstereoinfoaccessor_vsdof \ libstereoinfoaccessor_vsdof \
libstorage_otp \ libstorage_otp \
libstrongswan \ libstrongswan \
@@ -1575,9 +1568,10 @@ PRODUCT_PACKAGES += \
vendor.mediatek.hardware.videotelephony-V1-ndk \ vendor.mediatek.hardware.videotelephony-V1-ndk \
vendor.mediatek.hardware.videotelephony@1.0 \ vendor.mediatek.hardware.videotelephony@1.0 \
ImsService \ ImsService \
MtkGbaService \
HotwordEnrollmentOKGoogleCORTEXM4 \ HotwordEnrollmentOKGoogleCORTEXM4 \
HotwordEnrollmentXGoogleCORTEXM4 \ HotwordEnrollmentXGoogleCORTEXM4 \
mediatek-common \
mediatek-framework \
mediatek-ims-base \ mediatek-ims-base \
mediatek-ims-common \ mediatek-ims-common \
mediatek-ims-extension-plugin \ mediatek-ims-extension-plugin \
@@ -1591,7 +1585,7 @@ PRODUCT_PACKAGES += \
lbs_hidl_service@1.0.xml \ lbs_hidl_service@1.0.xml \
manifest_android.hardware.drm@1.4-service.widevine.xml \ manifest_android.hardware.drm@1.4-service.widevine.xml \
manifest_hwcomposer.xml \ manifest_hwcomposer.xml \
manifest_media_c2_V1_2_default.xml \ manifest_media_c2_V1_1_default.xml \
SoterProvisioningTool \ SoterProvisioningTool \
batterysecret \ batterysecret \
bip \ bip \
@@ -1667,11 +1661,3 @@ PRODUCT_PACKAGES += \
vendor_lib64_libneuron_runtime_so \ vendor_lib64_libneuron_runtime_so \
vendor_lib64_libnir_neon_driver_so \ vendor_lib64_libnir_neon_driver_so \
vendor_lib64_libpq_prot_so vendor_lib64_libpq_prot_so
PRODUCT_BOOT_JARS += \
mediatek-ims-base \
mediatek-ims-common \
mediatek-ims-extension-plugin \
mediatek-telecom-common \
mediatek-telephony-base \
mediatek-telephony-common