Merge "Add a system property support to disable background dexopt job"
This commit is contained in:
committed by
Android (Google) Code Review
commit
91936a1d06
@@ -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 */);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user