Support snapshotting profiles.
Bug: 258486155
Test: atest ArtServiceTests
Test: adb shell pm art snapshot-app-profile /data/system/1.prof com.google.android.youtube
Test: adb shell pm art snapshot-boot-image-profile /data/system/1.prof
Ignore-AOSP-First: ART Services.
Change-Id: I81220ca563ac24100056083bc4a4a8661c0dc1d0
diff --git a/libartservice/service/java/com/android/server/art/DexOptimizer.java b/libartservice/service/java/com/android/server/art/DexOptimizer.java
index 51443c6..13afa0b 100644
--- a/libartservice/service/java/com/android/server/art/DexOptimizer.java
+++ b/libartservice/service/java/com/android/server/art/DexOptimizer.java
@@ -490,8 +490,8 @@
OutputProfile output = buildOutputProfile(dexInfo, false /* isPublic */);
try {
- if (mInjector.getArtd().mergeProfiles(
- getCurProfiles(dexInfo), referenceProfile, output, dexInfo.dexPath())) {
+ if (mInjector.getArtd().mergeProfiles(getCurProfiles(dexInfo), referenceProfile, output,
+ List.of(dexInfo.dexPath()), new MergeProfileOptions())) {
return ProfilePath.tmpProfilePath(output.profilePath);
}
} catch (ServiceSpecificException e) {