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

Commit 46220780 authored by Winson's avatar Winson
Browse files

Fix parsing sCachedPackageReadCount

This was moved to PackageCacher, but the old and unused counter
was not removed.

Bug: 154310064

Test: manual device reboots and logs cached count >0

Change-Id: I32fdb4b8fccd281fe61c64f231cb0ba154934679
parent 21ebdf80
Loading
Loading
Loading
Loading
+0 −6
Original line number Original line Diff line number Diff line
@@ -127,7 +127,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.List;
import java.util.Set;
import java.util.Set;
import java.util.UUID;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;


/**
/**
 * Parser for package files (APKs) on disk. This supports apps packaged either
 * Parser for package files (APKs) on disk. This supports apps packaged either
@@ -239,11 +238,6 @@ public class PackageParser {


    public static final boolean LOG_UNSAFE_BROADCASTS = false;
    public static final boolean LOG_UNSAFE_BROADCASTS = false;


    /**
     * Total number of packages that were read from the cache.  We use it only for logging.
     */
    public static final AtomicInteger sCachedPackageReadCount = new AtomicInteger();

    // Set of broadcast actions that are safe for manifest receivers
    // Set of broadcast actions that are safe for manifest receivers
    public static final Set<String> SAFE_BROADCASTS = new ArraySet<>();
    public static final Set<String> SAFE_BROADCASTS = new ArraySet<>();
    static {
    static {
+2 −2
Original line number Original line Diff line number Diff line
@@ -3210,7 +3210,7 @@ public class PackageManagerService extends IPackageManager.Stub
                }
                }
            }
            }
            final int cachedSystemApps = PackageParser.sCachedPackageReadCount.get();
            final int cachedSystemApps = PackageCacher.sCachedPackageReadCount.get();
            // Remove any shared userIDs that have no associated packages
            // Remove any shared userIDs that have no associated packages
            mSettings.pruneSharedUsersLPw();
            mSettings.pruneSharedUsersLPw();
@@ -3344,7 +3344,7 @@ public class PackageManagerService extends IPackageManager.Stub
                // This must be done last to ensure all stubs are replaced or disabled.
                // This must be done last to ensure all stubs are replaced or disabled.
                installSystemStubPackages(stubSystemApps, scanFlags);
                installSystemStubPackages(stubSystemApps, scanFlags);
                final int cachedNonSystemApps = PackageParser.sCachedPackageReadCount.get()
                final int cachedNonSystemApps = PackageCacher.sCachedPackageReadCount.get()
                                - cachedSystemApps;
                                - cachedSystemApps;
                final long dataScanTime = SystemClock.uptimeMillis() - systemScanTime - startTime;
                final long dataScanTime = SystemClock.uptimeMillis() - systemScanTime - startTime;