diff --git a/api/current.txt b/api/current.txt index 7828f2a60217e..bedf7ac1ba8db 100644 --- a/api/current.txt +++ b/api/current.txt @@ -1361,6 +1361,7 @@ package android { field public static final int useIntrinsicSizeAsMinimum = 16843536; // 0x1010310 field public static final int useLevel = 16843167; // 0x101019f field public static final int userVisible = 16843409; // 0x1010291 + field public static final int usesCleartextTraffic = 16844009; // 0x10104e9 field public static final int value = 16842788; // 0x1010024 field public static final int valueFrom = 16843486; // 0x10102de field public static final int valueTo = 16843487; // 0x10102df @@ -8728,6 +8729,7 @@ package android.content.pm { field public static final int FLAG_SYSTEM = 1; // 0x1 field public static final int FLAG_TEST_ONLY = 256; // 0x100 field public static final int FLAG_UPDATED_SYSTEM_APP = 128; // 0x80 + field public static final int FLAG_USES_CLEARTEXT_TRAFFIC = 134217728; // 0x8000000 field public static final int FLAG_VM_SAFE_MODE = 16384; // 0x4000 field public java.lang.String backupAgentName; field public java.lang.String className; @@ -27742,6 +27744,11 @@ package android.security { method public android.security.KeyStoreParameter.Builder setEncryptionRequired(boolean); } + public class NetworkSecurityPolicy { + method public static android.security.NetworkSecurityPolicy getInstance(); + method public boolean isCleartextTrafficPermitted(); + } + } package android.service.carrier { diff --git a/api/system-current.txt b/api/system-current.txt index 2cce10fb0bcbb..acefd9d505ea3 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -1436,6 +1436,7 @@ package android { field public static final int useIntrinsicSizeAsMinimum = 16843536; // 0x1010310 field public static final int useLevel = 16843167; // 0x101019f field public static final int userVisible = 16843409; // 0x1010291 + field public static final int usesCleartextTraffic = 16844009; // 0x10104e9 field public static final int value = 16842788; // 0x1010024 field public static final int valueFrom = 16843486; // 0x10102de field public static final int valueTo = 16843487; // 0x10102df @@ -8946,6 +8947,7 @@ package android.content.pm { field public static final int FLAG_SYSTEM = 1; // 0x1 field public static final int FLAG_TEST_ONLY = 256; // 0x100 field public static final int FLAG_UPDATED_SYSTEM_APP = 128; // 0x80 + field public static final int FLAG_USES_CLEARTEXT_TRAFFIC = 134217728; // 0x8000000 field public static final int FLAG_VM_SAFE_MODE = 16384; // 0x4000 field public java.lang.String backupAgentName; field public java.lang.String className; @@ -29613,6 +29615,11 @@ package android.security { method public android.security.KeyStoreParameter.Builder setEncryptionRequired(boolean); } + public class NetworkSecurityPolicy { + method public static android.security.NetworkSecurityPolicy getInstance(); + method public boolean isCleartextTrafficPermitted(); + } + } package android.service.carrier { diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java index 8f17845b3781b..0e43858f20ecd 100644 --- a/core/java/android/content/pm/ApplicationInfo.java +++ b/core/java/android/content/pm/ApplicationInfo.java @@ -340,8 +340,6 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * cleartext network traffic, in which case platform components (e.g., HTTP stacks, * {@code WebView}, {@code MediaPlayer}) will refuse app's requests to use cleartext traffic. * Third-party libraries are encouraged to honor this flag as well. - * - * @hide */ public static final int FLAG_USES_CLEARTEXT_TRAFFIC = 1<<27; @@ -379,7 +377,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * {@link #FLAG_LARGE_HEAP}, {@link #FLAG_STOPPED}, * {@link #FLAG_SUPPORTS_RTL}, {@link #FLAG_INSTALLED}, * {@link #FLAG_IS_DATA_ONLY}, {@link #FLAG_IS_GAME}, - * {@link #FLAG_FULL_BACKUP_ONLY}, {@link #FLAG_MULTIARCH}. + * {@link #FLAG_FULL_BACKUP_ONLY}, {@link #FLAG_USES_CLEARTEXT_TRAFFIC}, + * {@link #FLAG_MULTIARCH}. */ public int flags = 0; diff --git a/core/java/android/security/NetworkSecurityPolicy.java b/core/java/android/security/NetworkSecurityPolicy.java index 0626bbc5fd16a..0b3bf453fd9c6 100644 --- a/core/java/android/security/NetworkSecurityPolicy.java +++ b/core/java/android/security/NetworkSecurityPolicy.java @@ -24,8 +24,6 @@ package android.security; * *
The policy currently consists of a single flag: whether cleartext network traffic is * permitted. See {@link #isCleartextTrafficPermitted()}. - * - * @hide */ public class NetworkSecurityPolicy { @@ -48,9 +46,9 @@ public class NetworkSecurityPolicy { * without TLS or STARTTLS) is permitted for this process. * *
When cleartext network traffic is not permitted, the platform's components (e.g. HTTP and - * FTP stacks, {@code WebView}, {@code MediaPlayer}) will refuse this process's requests to use - * cleartext traffic. Third-party libraries are strongly encouraged to honor this setting as - * well. + * FTP stacks, {@link android.webkit.WebView}, {@link android.media.MediaPlayer}) will refuse + * this process's requests to use cleartext traffic. Third-party libraries are strongly + * encouraged to honor this setting as well. * *
This flag is honored on a best effort basis because it's impossible to prevent all
* cleartext traffic from Android applications given the level of access provided to them. For
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index aefb67c2fe83f..283c237380732 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -389,13 +389,12 @@
with the same {@link android.R.attr#taskAffinity} as it has. -->