diff --git a/base.mk b/base.mk index 7f9a8c9..ce89e0b 100644 --- a/base.mk +++ b/base.mk @@ -119,3 +119,7 @@ PRODUCT_PACKAGES += \ PRODUCT_COPY_FILES += \ device/phh/treble/files/adbd.rc:system/etc/init/adbd.rc + +#MTK incoming SMS fix +PRODUCT_PACKAGES += \ + mtk-sms-fwk-ready diff --git a/cmds/Android.bp b/cmds/Android.bp index c65f4cc..79514b6 100644 --- a/cmds/Android.bp +++ b/cmds/Android.bp @@ -48,3 +48,18 @@ cc_binary { "libhidlbase", ], } + +cc_binary { + name: "mtk-sms-fwk-ready", + srcs: [ + "mtk-sms-fwk-ready.cpp", + ], + shared_libs: [ + "vendor.mediatek.hardware.radio@2.6", + "libutils", + "libhidlbase", + ], + init_rc: [ + "mtk-sms-fwk-ready.rc" + ], +} diff --git a/cmds/mtk-sms-fwk-ready.cpp b/cmds/mtk-sms-fwk-ready.cpp new file mode 100644 index 0000000..e55f55a --- /dev/null +++ b/cmds/mtk-sms-fwk-ready.cpp @@ -0,0 +1,12 @@ +#include +#include +#include + +using ::vendor::mediatek::hardware::radio::V2_6::IRadio; +using ::android::sp; + +int main(int argc, char **argv) { + auto svc = IRadio::getService(argv[1]); + + svc->setSmsFwkReady(1); +} diff --git a/cmds/mtk-sms-fwk-ready.rc b/cmds/mtk-sms-fwk-ready.rc new file mode 100644 index 0000000..e82e0a9 --- /dev/null +++ b/cmds/mtk-sms-fwk-ready.rc @@ -0,0 +1,3 @@ +on property:sys.boot_completed=1 + exec u:r:phhsu_daemon:s0 root -- /system/bin/mtk-sms-fwk-ready slot1 + exec u:r:phhsu_daemon:s0 root -- /system/bin/mtk-sms-fwk-ready slot2 diff --git a/rw-system.sh b/rw-system.sh index f833369..209ef85 100644 --- a/rw-system.sh +++ b/rw-system.sh @@ -199,6 +199,8 @@ for f in /vendor/lib/mtk-ril.so /vendor/lib64/mtk-ril.so /vendor/lib/libmtk-ril. /mnt/phh/$b chcon "$ctxt" /mnt/phh/$b mount -o bind /mnt/phh/$b $f + + setprop persist.sys.phh.radio.force_cognitive true done mount -o bind /system/phh/empty /vendor/overlay/SysuiDarkTheme/SysuiDarkTheme.apk || true