Add an extra debug flag to BackgroundDexOptimizer
am: 3a2b7f7d59
Change-Id: I309923c247bef67ffbdba56955582f6decde3800
This commit is contained in:
@@ -42,12 +42,18 @@ import java.util.concurrent.TimeUnit;
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
public class BackgroundDexOptService extends JobService {
|
public class BackgroundDexOptService extends JobService {
|
||||||
static final String TAG = "BackgroundDexOptService";
|
private static final String TAG = "BackgroundDexOptService";
|
||||||
|
|
||||||
static final long RETRY_LATENCY = 4 * AlarmManager.INTERVAL_HOUR;
|
private static final boolean DEBUG = false;
|
||||||
|
|
||||||
static final int JOB_IDLE_OPTIMIZE = 800;
|
private static final long RETRY_LATENCY = 4 * AlarmManager.INTERVAL_HOUR;
|
||||||
static final int JOB_POST_BOOT_UPDATE = 801;
|
|
||||||
|
private static final int JOB_IDLE_OPTIMIZE = 800;
|
||||||
|
private static final int JOB_POST_BOOT_UPDATE = 801;
|
||||||
|
|
||||||
|
private static final long IDLE_OPTIMIZATION_PERIOD = DEBUG
|
||||||
|
? TimeUnit.MINUTES.toMillis(1)
|
||||||
|
: TimeUnit.DAYS.toMillis(1);
|
||||||
|
|
||||||
private static ComponentName sDexoptServiceName = new ComponentName(
|
private static ComponentName sDexoptServiceName = new ComponentName(
|
||||||
"android",
|
"android",
|
||||||
@@ -86,7 +92,7 @@ public class BackgroundDexOptService extends JobService {
|
|||||||
js.schedule(new JobInfo.Builder(JOB_IDLE_OPTIMIZE, sDexoptServiceName)
|
js.schedule(new JobInfo.Builder(JOB_IDLE_OPTIMIZE, sDexoptServiceName)
|
||||||
.setRequiresDeviceIdle(true)
|
.setRequiresDeviceIdle(true)
|
||||||
.setRequiresCharging(true)
|
.setRequiresCharging(true)
|
||||||
.setPeriodic(TimeUnit.DAYS.toMillis(1))
|
.setPeriodic(IDLE_OPTIMIZATION_PERIOD)
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
if (DEBUG_DEXOPT) {
|
if (DEBUG_DEXOPT) {
|
||||||
@@ -208,6 +214,7 @@ public class BackgroundDexOptService extends JobService {
|
|||||||
|
|
||||||
private void idleOptimization(JobParameters jobParams, PackageManagerService pm,
|
private void idleOptimization(JobParameters jobParams, PackageManagerService pm,
|
||||||
ArraySet<String> pkgs) {
|
ArraySet<String> pkgs) {
|
||||||
|
Log.i(TAG, "Performing idle optimizations");
|
||||||
// If post-boot update is still running, request that it exits early.
|
// If post-boot update is still running, request that it exits early.
|
||||||
mExitPostBootUpdate.set(true);
|
mExitPostBootUpdate.set(true);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user