Move removePackageData to handler thread.

It does a lot of heavy lifting and should not happen under package lock.

Bug: 245997611
Fixes: 245997611
Test: presubmit + boots
Change-Id: If6c044a31b2d22631a7d0ad57efcb9ea86955aa3
This commit is contained in:
Alex Buynytskyy
2022-09-13 13:03:57 -07:00
parent e4c0e42c12
commit 547578c81e

View File

@@ -3311,7 +3311,8 @@ final class InstallPackageHelper {
if (disabledPs == null) {
logCriticalInfo(Log.WARN, "System package " + packageName
+ " no longer exists; its data will be wiped");
mRemovePackageHelper.removePackageData(ps, userIds, null, 0, false);
mInjector.getHandler().post(
() -> mRemovePackageHelper.removePackageData(ps, userIds, null, 0, false));
} else {
// we still have a disabled system package, but, it still might have
// been removed. check the code path still exists and check there's