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

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

Merge "Add a system property support to disable background dexopt job"

parents 7cb10dd7 3067a1dd
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -99,6 +99,10 @@ public class BackgroundDexOptService extends JobService {
            getDowngradeUnusedAppsThresholdInMillis();

    public static void schedule(Context context) {
        if (isBackgroundDexoptDisabled()) {
            return;
        }

        JobScheduler js = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE);

        // Schedule a one-off job which scans installed packages and updates
@@ -477,4 +481,9 @@ public class BackgroundDexOptService extends JobService {
        }
        return TimeUnit.DAYS.toMillis(Long.parseLong(sysPropValue));
    }

    private static boolean isBackgroundDexoptDisabled() {
        return SystemProperties.getBoolean("pm.dexopt.disable_bg_dexopt" /* key */,
                false /* default */);
    }
}