summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/util/DisplayMetrics.java9
-rw-r--r--include/utils/ResourceTypes.h1
-rw-r--r--native/include/android/configuration.h1
-rw-r--r--tools/aapt/AaptAssets.cpp5
4 files changed, 16 insertions, 0 deletions
diff --git a/core/java/android/util/DisplayMetrics.java b/core/java/android/util/DisplayMetrics.java
index 60a4ef21c440..d594567d09d2 100644
--- a/core/java/android/util/DisplayMetrics.java
+++ b/core/java/android/util/DisplayMetrics.java
@@ -38,6 +38,15 @@ public class DisplayMetrics {
public static final int DENSITY_MEDIUM = 160;
/**
+ * Standard quantized DPI for 720p TV screens. Applications should
+ * generally not worry about this density, instead targeting
+ * {@link #DENSITY_XHIGH} for 1080p TV screens. For situations where
+ * output is needed for a 720p screen, the UI elements can be scaled
+ * automatically by the platform.
+ */
+ public static final int DENSITY_TV = 213;
+
+ /**
* Standard quantized DPI for high-density screens.
*/
public static final int DENSITY_HIGH = 240;
diff --git a/include/utils/ResourceTypes.h b/include/utils/ResourceTypes.h
index 7d3fc061176c..8a92cd6e18f7 100644
--- a/include/utils/ResourceTypes.h
+++ b/include/utils/ResourceTypes.h
@@ -841,6 +841,7 @@ struct ResTable_config
DENSITY_DEFAULT = ACONFIGURATION_DENSITY_DEFAULT,
DENSITY_LOW = ACONFIGURATION_DENSITY_LOW,
DENSITY_MEDIUM = ACONFIGURATION_DENSITY_MEDIUM,
+ DENSITY_TV = ACONFIGURATION_DENSITY_TV,
DENSITY_HIGH = ACONFIGURATION_DENSITY_HIGH,
DENSITY_NONE = ACONFIGURATION_DENSITY_NONE
};
diff --git a/native/include/android/configuration.h b/native/include/android/configuration.h
index 39fef21ba0cb..2444c4bbda6d 100644
--- a/native/include/android/configuration.h
+++ b/native/include/android/configuration.h
@@ -40,6 +40,7 @@ enum {
ACONFIGURATION_DENSITY_DEFAULT = 0,
ACONFIGURATION_DENSITY_LOW = 120,
ACONFIGURATION_DENSITY_MEDIUM = 160,
+ ACONFIGURATION_DENSITY_TV = 213,
ACONFIGURATION_DENSITY_HIGH = 240,
ACONFIGURATION_DENSITY_NONE = 0xffff,
diff --git a/tools/aapt/AaptAssets.cpp b/tools/aapt/AaptAssets.cpp
index 48941961ccb9..29d2b872eadd 100644
--- a/tools/aapt/AaptAssets.cpp
+++ b/tools/aapt/AaptAssets.cpp
@@ -969,6 +969,11 @@ bool AaptGroupEntry::getDensityName(const char* name,
return true;
}
+ if (strcmp(name, "tvdpi") == 0) {
+ if (out) out->density = ResTable_config::DENSITY_TV;
+ return true;
+ }
+
if (strcmp(name, "hdpi") == 0) {
if (out) out->density = ResTable_config::DENSITY_HIGH;
return true;