Try to fix a race condition where init.svc could /not/ be restarting at the time of checking

This commit is contained in:
Pierre-Hugues Husson 2020-06-18 20:24:21 +02:00
parent 0f3b53a395
commit 2e19ed17dc
2 changed files with 6 additions and 4 deletions

View File

@ -35,12 +35,13 @@ fi
setprop ctl.stop storageproxyd setprop ctl.stop storageproxyd
sleep 10 sleep 10
if [ "$vndk" = 27 ] && getprop init.svc.mediacodec |grep -q restarting;then crashingProcess=$(getprop ro.init.updatable_crashing_process_name |grep media)
if [ "$vndk" = 27 ] && ( getprop init.svc.mediacodec |grep -q restarting || [ -n "$crashingProcess" ]);then
mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail_vendor.so mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail_vendor.so
mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail_vendor.so mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail_vendor.so
fi fi
if [ "$vndk" = 28 ] && getprop |grep init.svc | grep media |grep -q restarting;then if [ "$vndk" = 28 ] && ( getprop |grep init.svc | grep media |grep -q restarting || [ -n "$crashingProcess" ] );then
mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail_vendor.so mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail_vendor.so
mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail_vendor.so mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail_vendor.so
mount /system/lib64/vndk-27/libminijail.so /system/lib64/vndk-28/libminijail.so mount /system/lib64/vndk-27/libminijail.so /system/lib64/vndk-28/libminijail.so

View File

@ -13,12 +13,13 @@ if getprop persist.sys.phh.caf.media_profile |grep -q true;then
setprop media.settings.xml "/vendor/etc/media_profiles_vendor.xml" setprop media.settings.xml "/vendor/etc/media_profiles_vendor.xml"
fi fi
if [ "$vndk" = 27 ] && getprop init.svc.mediacodec |grep -q restarting;then crashingProcess=$(getprop ro.init.updatable_crashing_process_name |grep media)
if [ "$vndk" = 27 ] && ( getprop init.svc.mediacodec |grep -q restarting || [ -n "$crashingProcess" ] );then
mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail_vendor.so mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail_vendor.so
mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail_vendor.so mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail_vendor.so
fi fi
if [ "$vndk" = 28 ] && getprop |grep init.svc | grep media |grep -q restarting;then if [ "$vndk" = 28 ] && ( getprop |grep init.svc | grep media |grep -q restarting || [ -n "$crashingProcess" ] );then
mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail_vendor.so mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail_vendor.so
mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail_vendor.so mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail_vendor.so
mount /system/lib64/vndk-27/libminijail.so /system/lib64/vndk-28/libminijail.so mount /system/lib64/vndk-27/libminijail.so /system/lib64/vndk-28/libminijail.so