diff options
| author | 2023-12-05 10:38:53 +0000 | |
|---|---|---|
| committer | 2023-12-05 10:38:53 +0000 | |
| commit | 08e5de9686f81c5fac702bf72dd7412dba6f1fe1 (patch) | |
| tree | 6d086e5ae7c65f4c3f1dc685d50d3bf7b261f8c0 | |
| parent | b0257997cd56c245454e1c3586a21033231cb194 (diff) | |
| parent | 1884999521bfba34d6bc5f893fc6d207d08b8f11 (diff) | |
Merge "[2/n] Add DisplayMetrics.DENSITY_390 API" into main
| -rw-r--r-- | core/api/current.txt | 1 | ||||
| -rwxr-xr-x | core/java/android/util/DisplayMetrics.java | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/core/api/current.txt b/core/api/current.txt index 5310fdc1d6ab..2ded81094816 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -49273,6 +49273,7 @@ package android.util { field public static final int DENSITY_300 = 300; // 0x12c field public static final int DENSITY_340 = 340; // 0x154 field public static final int DENSITY_360 = 360; // 0x168 + field @FlaggedApi("com.android.window.flags.density_390_api") public static final int DENSITY_390 = 390; // 0x186 field public static final int DENSITY_400 = 400; // 0x190 field public static final int DENSITY_420 = 420; // 0x1a4 field public static final int DENSITY_440 = 440; // 0x1b8 diff --git a/core/java/android/util/DisplayMetrics.java b/core/java/android/util/DisplayMetrics.java index 9148c4a101d7..f14485b09424 100755 --- a/core/java/android/util/DisplayMetrics.java +++ b/core/java/android/util/DisplayMetrics.java @@ -16,6 +16,9 @@ package android.util; +import static com.android.window.flags.Flags.FLAG_DENSITY_390_API; + +import android.annotation.FlaggedApi; import android.annotation.IntDef; import android.annotation.Nullable; import android.compat.annotation.UnsupportedAppUsage; @@ -59,6 +62,7 @@ public class DisplayMetrics { DENSITY_XHIGH, DENSITY_340, DENSITY_360, + DENSITY_390, DENSITY_400, DENSITY_420, DENSITY_440, @@ -182,6 +186,15 @@ public class DisplayMetrics { * This is not a density that applications should target, instead relying * on the system to scale their {@link #DENSITY_XXHIGH} assets for them. */ + @FlaggedApi(FLAG_DENSITY_390_API) + public static final int DENSITY_390 = 390; + + /** + * Intermediate density for screens that sit somewhere between + * {@link #DENSITY_XHIGH} (320 dpi) and {@link #DENSITY_XXHIGH} (480 dpi). + * This is not a density that applications should target, instead relying + * on the system to scale their {@link #DENSITY_XXHIGH} assets for them. + */ public static final int DENSITY_400 = 400; /** |