From 3772908b383404a8262ce5ef18a32d54f6227c56 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Tue, 26 Feb 2019 23:14:06 +0100 Subject: [PATCH] Fix incoming SMS and mobile data on MT6379 --- Android.bp | 1 + base.mk | 4 ++++ cmds/Android.bp | 14 ++++++++++++++ cmds/mtk-sms-fwk-ready.cpp | 12 ++++++++++++ cmds/mtk-sms-fwk-ready.rc | 3 +++ rw-system.sh | 2 ++ 6 files changed, 36 insertions(+) create mode 100644 Android.bp create mode 100644 cmds/Android.bp create mode 100644 cmds/mtk-sms-fwk-ready.cpp create mode 100644 cmds/mtk-sms-fwk-ready.rc diff --git a/Android.bp b/Android.bp new file mode 100644 index 0000000..ce1b186 --- /dev/null +++ b/Android.bp @@ -0,0 +1 @@ +subdirs = [ "cmds" ] diff --git a/base.mk b/base.mk index e5c57ae..d861c6f 100644 --- a/base.mk +++ b/base.mk @@ -75,3 +75,7 @@ PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \ device/phh/treble/files/samsung-gpio_keys.kl:system/phh/samsung-gpio_keys.kl \ device/phh/treble/files/samsung-sec_touchscreen.kl:system/phh/samsung-sec_touchscreen.kl + +#MTK incoming SMS fix +PRODUCT_PACKAGES += \ + mtk-sms-fwk-ready diff --git a/cmds/Android.bp b/cmds/Android.bp new file mode 100644 index 0000000..2ad784f --- /dev/null +++ b/cmds/Android.bp @@ -0,0 +1,14 @@ +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 393ddce..912082b 100644 --- a/rw-system.sh +++ b/rw-system.sh @@ -150,6 +150,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