Notify IORap without including packages for secondary dex opt.
The current secondary dex opt doesn't distinct between
opt performed and skipped, which causes unnecessary traces
purge for IORap.
Bug:161633001
Test: manually trigger bg-dexopt via 'adb shell cmd jobscheduler run -f
android 800' and check the log.
(cherry picked from commit ff800a363b)
Merged-In: Iae4fc0b6fc73707ada8895b38c3ae3f772ac2cd0
Change-Id: Iae4fc0b6fc73707ada8895b38c3ae3f772ac2cd0
This commit is contained in:
@@ -337,6 +337,7 @@ public class BackgroundDexOptService extends JobService {
|
|||||||
private int idleOptimizePackages(PackageManagerService pm, ArraySet<String> pkgs,
|
private int idleOptimizePackages(PackageManagerService pm, ArraySet<String> pkgs,
|
||||||
long lowStorageThreshold) {
|
long lowStorageThreshold) {
|
||||||
ArraySet<String> updatedPackages = new ArraySet<>();
|
ArraySet<String> updatedPackages = new ArraySet<>();
|
||||||
|
ArraySet<String> updatedPackagesDueToSecondaryDex = new ArraySet<>();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final boolean supportSecondaryDex = supportSecondaryDex();
|
final boolean supportSecondaryDex = supportSecondaryDex();
|
||||||
@@ -391,11 +392,14 @@ public class BackgroundDexOptService extends JobService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int secondaryResult = optimizePackages(pm, pkgs, lowStorageThreshold,
|
int secondaryResult = optimizePackages(pm, pkgs, lowStorageThreshold,
|
||||||
/*isForPrimaryDex*/ false, updatedPackages);
|
/*isForPrimaryDex*/ false, updatedPackagesDueToSecondaryDex);
|
||||||
return secondaryResult;
|
return secondaryResult;
|
||||||
} finally {
|
} finally {
|
||||||
// Always let the pinner service know about changes.
|
// Always let the pinner service know about changes.
|
||||||
notifyPinService(updatedPackages);
|
notifyPinService(updatedPackages);
|
||||||
|
// Only notify IORap the primary dex opt, because we don't want to
|
||||||
|
// invalidate traces unnecessary due to b/161633001 and that it's
|
||||||
|
// better to have a trace than no trace at all.
|
||||||
notifyPackagesUpdated(updatedPackages);
|
notifyPackagesUpdated(updatedPackages);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user