背景
在Android12版本上开启USAP功能后,偶现打开应用时出现持续十多秒的黑屏现象,从log中查看,有如下日志
10-30 12:14:18.769 6621 6621 E USAP : Failed to write PID (6621) to pipe (51): write failed: EPIPE (Broken pipe)
10-30 12:14:18.773 561 561 I Zygote : Process 6621 exited due to signal 15 (Terminated)
解决方案
开启USAP:setprop persist.device_config.runtime_native.usap_pool_enabled true
原来这是Android12自身的一个bug,Google在如下的提交中已经修复,按照如下更改即可修复。