You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
LSPosed 的 daemon 中注册了一系列 BroadcastReceiver ,并且在调用结束后都会调用
AMS.finishReceiver
。阅读 Android 源码得知,
finishReceiver
一般仅当广播接收器收到有序广播 (ordered=true
) 或者广播接收器为 manifest 中声明的时候才调用。事实上,LSPosed 需要接收的广播基本都是无序广播。尽管对无序广播调用
finishReceiver
并不会产生异常,但是在 AMS 中它总会调用 trimApplication。在 Android 11 及以下,这会更新所有进程的 OomAdj ,这个过程可能导致卡顿。从个人体验来看,安装了 LSPosed 的情况下,开机的时候卡顿尤其明显,推测是由于此阶段 LSPosed 接收了大量广播,导致 finishReceiver 被频繁调用。尝试修改 LSPosed 源码,阻止对无序广播调用 finishReceiver ,实测发现不影响正常功能,而开机卡顿感明显减弱。
因此想询问开发者,这个调用是否是不必要的?
Beta Was this translation helpful? Give feedback.
All reactions