Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 26a949ed authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add missing synchronized block for PackageUsage"

parents b820ccef 4b799bc1
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -1738,6 +1738,7 @@ public class PackageManagerService extends IPackageManager.Stub
    final @Nullable String mOverlayConfigSignaturePackage;
    final @Nullable String mRecentsPackage;
    @GuardedBy("mLock")
    private final PackageUsage mPackageUsage = new PackageUsage();
    private final CompilerStats mCompilerStats = new CompilerStats();
@@ -10630,13 +10631,14 @@ public class PackageManagerService extends IPackageManager.Stub
    }
    public void shutdown() {
        mPackageUsage.writeNow(mSettings.mPackages);
        mCompilerStats.writeNow();
        mDexManager.writePackageDexUsageNow();
        PackageWatchdog.getInstance(mContext).writeNow();
        // This is the last chance to write out pending restriction settings
        synchronized (mLock) {
            mPackageUsage.writeNow(mSettings.mPackages);
            // This is the last chance to write out pending restriction settings
            if (mHandler.hasMessages(WRITE_PACKAGE_RESTRICTIONS)) {
                mHandler.removeMessages(WRITE_PACKAGE_RESTRICTIONS);
                for (int userId : mDirtyUsers) {
@@ -26049,8 +26051,10 @@ public class PackageManagerService extends IPackageManager.Stub
    }
    boolean isHistoricalPackageUsageAvailable() {
        synchronized (mLock) {
            return mPackageUsage.isHistoricalPackageUsageAvailable();
        }
    }
    /**
     * Return a <b>copy</b> of the collection of packages known to the package manager.