Enable aapt2 packaging action to use compiled resources for merging rather than parsed resources.
RELNOTES: none
@@ -103,10 +103,16 @@ public class Aapt2ResourcePackagingAction {
profiler.recordEndOf("setup").startTask("merging");
+ AndroidDataDeserializer dataDeserializer =
+ aaptConfigOptions.useCompiledResourcesForMerge
+ ? AndroidCompiledDataDeserializer.withFilteredResources(options.prefilteredResources)
+ : AndroidParsedDataDeserializer.withFilteredResources(options.prefilteredResources);
+
// Checks for merge conflicts.
MergedAndroidData mergedAndroidData =
AndroidResourceMerger.mergeData(
- options.primaryData,
+ ParsedAndroidData.from(options.primaryData),
+ options.primaryData.getManifest(),
options.directData,
options.transitiveData,
mergedResources,
@@ -114,8 +120,9 @@ public class Aapt2ResourcePackagingAction {
null /* cruncher. Aapt2 automatically chooses to crunch or not. */,
options.packageType,
options.symbolsOut,
- options.prefilteredResources,
- false /* throwOnResourceConflict */)
+ null /* rclassWriter */,
+ dataDeserializer,
+ options.throwOnResourceConflict)
.filter(
new DensitySpecificResourceFilter(
densitiesToFilter, filteredResources, mergedResources),
