Finish attach appliation before creating app context
Creating the app context involves getting app resources from the app's apk. This operation could be blocked on an incremental fs and trigger the proc start timeout. While fixing this, I noticed that apps could also run code and block in AppComponentFactory#instantiateClassLoader, so moved the call to finishAttachApplication even earlier. It's probably worth re-thinking the AnR timeouts around proc starts, because currently, if the app blocks in instantiateClassLoader for instance, neither AnR timeout nor proc start timeout will trigger. For now, this fixes the test and keeps the behavior as close to the old behavior as possible. Test: atest CtsPackageManagerStatsHostTestCases:com.android.cts.packagemanager.stats.host.IncrementalAppErrorStatsTests#testAppCrashOnIncremental Bug: 261009296 Change-Id: Ic75a4e9d38a7c21d4a0b948d6fb26389723a80f6
Loading
Please register or sign in to comment