From c6646c9ac41122ecc022102efdcceb890a0ca529 Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Fri, 28 Aug 2009 10:00:12 -0400 Subject: [PATCH] Introduce a default density ('mdpi') for all device builds. This is done by appending "mdpi" (medium density or 160 dpi, which is what we've been using so far on dream etc.) to PRODUCT_LOCALES if no other dpi is found there. (PRODUCT_LOCALES is then sent as a configuration parameter to aapt to determine which resources should be included in the build.) With this change, each build will now include only one density of any given asset. For example, if there exists drawable-hdpi/foo.png drawable-mdpi/foo.png ...then the build will include *only* drawable-mdpi/foo.png, unless the density is overridden in the build's own device spec: PRODUCT_LOCALES += hdpi ...in which case the build will include only drawable-hdpi/foo.png. --- core/product_config.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/product_config.mk b/core/product_config.mk index 3237801556..0a693f4fb6 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -193,6 +193,12 @@ ifneq (,$(extra_locales)) extra_locales := endif +# Default to medium-density assets. +# (Can be overridden in the device config, e.g.: PRODUCT_LOCALES += hdpi) +PRODUCT_LOCALES := $(strip \ + $(PRODUCT_LOCALES) \ + $(if $(filter %dpi,$(PRODUCT_LOCALES)),,mdpi)) + # Assemble the list of options. PRODUCT_AAPT_CONFIG := $(PRODUCT_LOCALES)