diff options
-rw-r--r-- | api/current.txt | 1 | ||||
-rw-r--r-- | core/java/android/util/DisplayMetrics.java | 9 | ||||
-rw-r--r-- | include/androidfw/ResourceTypes.h | 1 | ||||
-rw-r--r-- | tools/aapt/AaptAssets.cpp | 5 |
4 files changed, 16 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt index c8f999f..3f1d1a7 100644 --- a/api/current.txt +++ b/api/current.txt @@ -23278,6 +23278,7 @@ package android.util { field public static final int DENSITY_TV = 213; // 0xd5 field public static final int DENSITY_XHIGH = 320; // 0x140 field public static final int DENSITY_XXHIGH = 480; // 0x1e0 + field public static final int DENSITY_XXXHIGH = 640; // 0x280 field public float density; field public int densityDpi; field public int heightPixels; diff --git a/core/java/android/util/DisplayMetrics.java b/core/java/android/util/DisplayMetrics.java index e856501..dae47b8 100644 --- a/core/java/android/util/DisplayMetrics.java +++ b/core/java/android/util/DisplayMetrics.java @@ -74,6 +74,15 @@ public class DisplayMetrics { public static final int DENSITY_XXHIGH = 480; /** + * Standard quantized DPI for extra-extra-extra-high-density screens. Applications + * should not generally worry about this density; relying on XHIGH graphics + * being scaled up to it should be sufficient for almost all cases. A typical + * use of this density would be 4K television screens -- 3840x2160, which + * is 2x a traditional HD 1920x1080 screen which runs at DENSITY_XHIGH. + */ + public static final int DENSITY_XXXHIGH = 640; + + /** * The reference density used throughout the system. */ public static final int DENSITY_DEFAULT = DENSITY_MEDIUM; diff --git a/include/androidfw/ResourceTypes.h b/include/androidfw/ResourceTypes.h index 48f5bf3..5b45d70 100644 --- a/include/androidfw/ResourceTypes.h +++ b/include/androidfw/ResourceTypes.h @@ -855,6 +855,7 @@ struct ResTable_config DENSITY_HIGH = ACONFIGURATION_DENSITY_HIGH, DENSITY_XHIGH = ACONFIGURATION_DENSITY_XHIGH, DENSITY_XXHIGH = ACONFIGURATION_DENSITY_XXHIGH, + DENSITY_XXXHIGH = ACONFIGURATION_DENSITY_XXXHIGH, DENSITY_NONE = ACONFIGURATION_DENSITY_NONE }; diff --git a/tools/aapt/AaptAssets.cpp b/tools/aapt/AaptAssets.cpp index 5b71adc..2149190 100644 --- a/tools/aapt/AaptAssets.cpp +++ b/tools/aapt/AaptAssets.cpp @@ -1185,6 +1185,11 @@ bool AaptGroupEntry::getDensityName(const char* name, return true; } + if (strcmp(name, "xxxhdpi") == 0) { + if (out) out->density = ResTable_config::DENSITY_XXXHIGH; + return true; + } + char* c = (char*)name; while (*c >= '0' && *c <= '9') { c++; |