From 02c9b63356e70eba99b30128f25a8bd54773206a Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Wed, 3 Jun 2020 16:52:59 +0200 Subject: [PATCH] Fix mediacodec on vndk-27 Since android-10.0.0_r37, mediacodec seccomp policy now has two includes. In AOSP 8.1, minijail is vendor-side. AOSP 8.1's minijail has a bug, which can't read multiple includes. All of this together means mediacodec is broken. This fixes it by overriding vendor's minijail to a working one, in the hope that vendors didn't change anything in their own minijail https://issuetracker.google.com/issues/158068181 --- phh-on-boot.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/phh-on-boot.sh b/phh-on-boot.sh index ffca3de..e17b871 100644 --- a/phh-on-boot.sh +++ b/phh-on-boot.sh @@ -1,5 +1,8 @@ #!/system/bin/sh +vndk="$(getprop persist.sys.vndk)" +[ -z "$vndk" ] && vndk="$(getprop ro.vndk.version |grep -oE '^[0-9]+')" + [ "$(getprop vold.decrypt)" = "trigger_restart_min_framework" ] && exit 0 setprop ctl.start media.swcodec @@ -31,6 +34,12 @@ fi setprop ctl.stop storageproxyd +sleep 10 +if [ "$vndk" = 27 ] && getprop init.svc.mediacodec |grep -q restarting;then + mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail_vendor.so + mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail_vendor.so +fi + #Clear looping services sleep 30 getprop | \