PMS write settings on shutdown regardless of pending type

Realized that the prior refactor to write out settings is invalid
because if the message type is different, it won't write out settings.
The generic write method serializes everything, so there's just one call
to that.

Bug: 228086624

Test: presubmit

Change-Id: I96f8dda03d7160779aaf30dad75f245eb150ed3c
This commit is contained in:
Winson
2022-04-05 09:00:30 -07:00
committed by Winson Chiu
parent b9d928eae3
commit 31cf7a0193

View File

@@ -2876,8 +2876,9 @@ public class PackageManagerService implements PackageSender, TestUtilityService
synchronized (mLock) {
mPackageUsage.writeNow(mSettings.getPackagesLocked());
if (mHandler.hasMessages(WRITE_SETTINGS)) {
mHandler.removeMessages(WRITE_SETTINGS);
if (mHandler.hasMessages(WRITE_SETTINGS)
|| mHandler.hasMessages(WRITE_PACKAGE_RESTRICTIONS)
|| mHandler.hasMessages(WRITE_PACKAGE_LIST)) {
writeSettings();
}
}