Split attachApplication to more accurately identify app startup
Previously, while handling the attachApplication from an app at startup, the system started the broadcast (and service) AnR timeout countdown as soon as it sent async bindApplication request to the app. This increased the likelyhood of AnRs under CPU contention since some fixed process initialization costs were included in the broadcast handling delay. Now, we split the the attachApplication into 2 phases, there's now a new finishAttachApplication which apps call right before they start executing any custom code. This new call unblocks any pending broadcast/service scheduling and starts the appropriate AnR timeout countdowns. Follow ups: 1. Enable the change by default with the device config flag 2. Refactor PROC_START_TIMEOUT as an ANR Test: atest AsyncProcessStartTest Bug: 253908737 Change-Id: Iaa51d310e262d1cf381b7a11a65b650c735448a3
Loading
Please register or sign in to comment