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

Commit 82bbb652 authored by JW Wang's avatar JW Wang Committed by Chun-Wei Wang
Browse files

Group final fields together

Address the review comment at
https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/9313959/2/services/core/java/com/android/server/PackageWatchdog.java#143

Bug: 140358475
Test: atest PackageWatchdogTest

Change-Id: I0aae51cd064531afbb8286c132885ff99f535727
parent cc9543c7
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -116,6 +116,10 @@ public class PackageWatchdog {
    private final AtomicFile mPolicyFile;
    private final ExplicitHealthCheckController mHealthCheckController;
    private final ConnectivityModuleConnector mConnectivityModuleConnector;
    private final Runnable mSyncRequests = this::syncRequests;
    private final Runnable mSyncStateWithScheduledReason = this::syncStateWithScheduledReason;
    private final Runnable mSaveToFile = this::saveToFile;
    private final SystemClock mSystemClock;
    @GuardedBy("mLock")
    private boolean mIsPackagesReady;
    // Flag to control whether explicit health checks are supported or not
@@ -130,18 +134,12 @@ public class PackageWatchdog {
    @GuardedBy("mLock")
    private long mUptimeAtLastStateSync;

    private final Runnable mSyncRequests = this::syncRequests;
    private final Runnable mSyncStateWithScheduledReason = this::syncStateWithScheduledReason;
    private final Runnable mSaveToFile = this::saveToFile;

    @FunctionalInterface
    @VisibleForTesting
    interface SystemClock {
        long uptimeMillis();
    }

    private final SystemClock mSystemClock;

    private PackageWatchdog(Context context) {
        // Needs to be constructed inline
        this(context, new AtomicFile(