diff options
| author | 2019-07-08 17:54:54 -0700 | |
|---|---|---|
| committer | 2019-07-08 17:54:54 -0700 | |
| commit | 8d32fefac4e09a0b7e6b3f9484b12111290f7931 (patch) | |
| tree | 6f2a0ef6d68611f5fcb8e0de5006be988efe1e96 | |
| parent | e270b113754c2108c823ff80bc859cf937491e2f (diff) | |
| parent | 8413d3041b752c64c332197a9bf4756c3b3812e3 (diff) | |
Merge changes I52110b84,I15d10a19,I5f52b832,Ifbaceb47 am: 803648a957 am: d89768f5a2
am: 8413d3041b
Change-Id: I3ee94f84d340c56b15dac6d8e0aa419c9fc41a64
| -rw-r--r-- | services/core/java/com/android/server/pm/BackgroundDexOptService.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/pm/BackgroundDexOptService.java b/services/core/java/com/android/server/pm/BackgroundDexOptService.java index ad9ac1232437..2b33aced7151 100644 --- a/services/core/java/com/android/server/pm/BackgroundDexOptService.java +++ b/services/core/java/com/android/server/pm/BackgroundDexOptService.java @@ -254,9 +254,16 @@ public class BackgroundDexOptService extends JobService { @Override public void run() { int result = idleOptimization(pm, pkgs, BackgroundDexOptService.this); - if (result != OPTIMIZE_ABORT_BY_JOB_SCHEDULER) { + if (result == OPTIMIZE_PROCESSED) { + Log.i(TAG, "Idle optimizations completed."); + } else if (result == OPTIMIZE_ABORT_NO_SPACE_LEFT) { Log.w(TAG, "Idle optimizations aborted because of space constraints."); - // If we didn't abort we ran to completion (or stopped because of space). + } else if (result == OPTIMIZE_ABORT_BY_JOB_SCHEDULER) { + Log.w(TAG, "Idle optimizations aborted by job scheduler."); + } else { + Log.w(TAG, "Idle optimizations ended with unexpected code: " + result); + } + if (result != OPTIMIZE_ABORT_BY_JOB_SCHEDULER) { // Abandon our timeslice and do not reschedule. jobFinished(jobParams, /* reschedule */ false); } @@ -339,6 +346,7 @@ public class BackgroundDexOptService extends JobService { long lowStorageThreshold, boolean isForPrimaryDex) { ArraySet<String> updatedPackages = new ArraySet<>(); Set<String> unusedPackages = pm.getUnusedPackages(mDowngradeUnusedAppsThresholdInMillis); + boolean hadSomeLowSpaceFailure = false; Log.d(TAG, "Unsused Packages " + String.join(",", unusedPackages)); // Only downgrade apps when space is low on device. // Threshold is selected above the lowStorageThreshold so that we can pro-actively clean @@ -359,6 +367,7 @@ public class BackgroundDexOptService extends JobService { } else { if (abort_code == OPTIMIZE_ABORT_NO_SPACE_LEFT) { // can't dexopt because of low space. + hadSomeLowSpaceFailure = true; continue; } dex_opt_performed = optimizePackage(pm, pkg, isForPrimaryDex); @@ -369,7 +378,7 @@ public class BackgroundDexOptService extends JobService { } notifyPinService(updatedPackages); - return OPTIMIZE_PROCESSED; + return hadSomeLowSpaceFailure ? OPTIMIZE_ABORT_NO_SPACE_LEFT : OPTIMIZE_PROCESSED; } |