From 7ce90af518de98221787732fd8508abdff32e79e Mon Sep 17 00:00:00 2001 From: John Reck Date: Thu, 5 Mar 2020 16:25:41 -0800 Subject: [PATCH] Deprecate long-obsolete android:anyDensity This API exists for compatibility with pre-Donut applications that were not properly density aware. As such, there's no current reason to use this. So deprecate it. Bug: 150869482 Test: builds Change-Id: Ie12957988d5f5d292277a291a20b565c2e3ef46e --- api/current.txt | 4 ++-- core/java/android/content/pm/ApplicationInfo.java | 4 ++++ core/res/res/values/attrs_manifest.xml | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/api/current.txt b/api/current.txt index 02b87342329c2..e9cb9ee1b759f 100644 --- a/api/current.txt +++ b/api/current.txt @@ -315,7 +315,7 @@ package android { field public static final int animationOrder = 16843214; // 0x10101ce field @Deprecated public static final int animationResolution = 16843546; // 0x101031a field public static final int antialias = 16843034; // 0x101011a - field public static final int anyDensity = 16843372; // 0x101026c + field @Deprecated public static final int anyDensity = 16843372; // 0x101026c field public static final int apduServiceBanner = 16843757; // 0x10103ed field public static final int apiKey = 16843281; // 0x1010211 field public static final int appCategory = 16844101; // 0x1010545 @@ -11469,7 +11469,7 @@ package android.content.pm { field public static final int FLAG_SUPPORTS_LARGE_SCREENS = 2048; // 0x800 field public static final int FLAG_SUPPORTS_NORMAL_SCREENS = 1024; // 0x400 field public static final int FLAG_SUPPORTS_RTL = 4194304; // 0x400000 - field public static final int FLAG_SUPPORTS_SCREEN_DENSITIES = 8192; // 0x2000 + field @Deprecated public static final int FLAG_SUPPORTS_SCREEN_DENSITIES = 8192; // 0x2000 field public static final int FLAG_SUPPORTS_SMALL_SCREENS = 512; // 0x200 field public static final int FLAG_SUPPORTS_XLARGE_SCREENS = 524288; // 0x80000 field public static final int FLAG_SUSPENDED = 1073741824; // 0x40000000 diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java index 4c6fef2e1856e..a15afe04201b0 100644 --- a/core/java/android/content/pm/ApplicationInfo.java +++ b/core/java/android/content/pm/ApplicationInfo.java @@ -247,7 +247,11 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * accommodate different screen densities. Corresponds to * {@link android.R.styleable#AndroidManifestSupportsScreens_anyDensity * android:anyDensity}. + * + * @deprecated Set by default when targeting API 4 or higher and apps + * should not set this to false. */ + @Deprecated public static final int FLAG_SUPPORTS_SCREEN_DENSITIES = 1<<13; /** diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml index 08dca62de6100..c2451319bdc8c 100644 --- a/core/res/res/values/attrs_manifest.xml +++ b/core/res/res/values/attrs_manifest.xml @@ -2266,9 +2266,9 @@ a newer platform that supports more screens. --> + density. This is assumed true if targetSdkVersion is 4 or higher. + @deprecated Should always be true by default and not overridden. + -->