[core] DO NOT call pm when pm is not yet fully ready (#1038)

Fix #1034
This commit is contained in:
LoveSy 2021-09-03 02:17:53 +08:00 committed by GitHub
parent 71780b4b70
commit a42d1223be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -94,6 +94,11 @@ public class ServiceManager {
DdmHandleAppName.setAppName("lspd", 0);
// get config before package service is started
// otherwise getInstance will trigger module/scope cache
var configManager = ConfigManager.getInstance();
// --- DO NOT call ConfigManager.getInstance later!!! ---
waitSystemService("package");
waitSystemService("activity");
waitSystemService(Context.USER_SERVICE);
@ -122,7 +127,7 @@ public class ServiceManager {
});
// Force logging on boot, now let's see if we need to stop logging
if (!ConfigManager.getInstance().verboseLog()) {
if (!configManager.verboseLog()) {
logcatService.stopVerbose();
}