use of com.android.bundle.Targeting.ScreenDensityTargeting in project bundletool by google.
the class AbstractSizeAggregator method getSizesPerConfiguration.
protected ConfigurationSizes getSizesPerConfiguration(ImmutableSet<SdkVersionTargeting> sdkTargetingOptions, ImmutableSet<AbiTargeting> abiTargetingOptions, ImmutableSet<LanguageTargeting> languageTargetingOptions, ImmutableSet<ScreenDensityTargeting> screenDensityTargetingOptions, ImmutableSet<TextureCompressionFormatTargeting> textureCompressionFormatTargetingOptions, ImmutableSet<DeviceTierTargeting> deviceTierTargetingOptions) {
Map<SizeConfiguration, Long> minSizeByConfiguration = new HashMap<>();
Map<SizeConfiguration, Long> maxSizeByConfiguration = new HashMap<>();
for (SdkVersionTargeting sdkVersionTargeting : sdkTargetingOptions) {
for (AbiTargeting abiTargeting : abiTargetingOptions) {
for (ScreenDensityTargeting screenDensityTargeting : screenDensityTargetingOptions) {
for (LanguageTargeting languageTargeting : languageTargetingOptions) {
for (TextureCompressionFormatTargeting textureCompressionFormatTargeting : textureCompressionFormatTargetingOptions) {
for (DeviceTierTargeting deviceTierTargeting : deviceTierTargetingOptions) {
SizeConfiguration configuration = mergeWithDeviceSpec(getSizeConfiguration(sdkVersionTargeting, abiTargeting, screenDensityTargeting, languageTargeting, textureCompressionFormatTargeting, deviceTierTargeting), getSizeRequest.getDeviceSpec());
long compressedSize = getCompressedSize(getMatchingApks(sdkVersionTargeting, abiTargeting, screenDensityTargeting, languageTargeting, textureCompressionFormatTargeting, deviceTierTargeting));
minSizeByConfiguration.merge(configuration, compressedSize, Math::min);
maxSizeByConfiguration.merge(configuration, compressedSize, Math::max);
}
}
}
}
}
}
return ConfigurationSizes.create(/* minSizeConfigurationMap= */
ImmutableMap.copyOf(minSizeByConfiguration), /* maxSizeConfigurationMap= */
ImmutableMap.copyOf(maxSizeByConfiguration));
}
Aggregations