summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAlex Klyubin <klyubin@google.com>2015-03-19 16:10:20 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-03-19 16:10:20 +0000
commit4177b8cbbfa239d68a9283124638d9399a5dd0de (patch)
tree094a0d811e6fba3054679d77ff18092370828ed9 /core
parente921b8a28f0d5b69fbb30374241c62fa90e92013 (diff)
parent01a959d60a2c5f04ab240513a853d7845b3a309e (diff)
downloadframeworks_base-4177b8cbbfa239d68a9283124638d9399a5dd0de.zip
frameworks_base-4177b8cbbfa239d68a9283124638d9399a5dd0de.tar.gz
frameworks_base-4177b8cbbfa239d68a9283124638d9399a5dd0de.tar.bz2
Merge "Add app-level usesCleartextTraffic manifest attribute."
Diffstat (limited to 'core')
-rw-r--r--core/java/android/content/pm/ApplicationInfo.java12
-rw-r--r--core/java/android/content/pm/PackageParser.java6
-rw-r--r--core/res/res/values/attrs_manifest.xml17
3 files changed, 35 insertions, 0 deletions
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index e1a2aa9..05c19db 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -334,6 +334,18 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
public static final int FLAG_FULL_BACKUP_ONLY = 1<<26;
/**
+ * Value for {@link #flags}: {@code true} if the application may use cleartext network traffic
+ * (e.g., HTTP rather than HTTPS; WebSockets rather than WebSockets Secure; XMPP, IMAP, STMP
+ * without STARTTLS or TLS). If {@code false}, the app declares that it does not intend to use
+ * 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;
+
+ /**
* Value for {@link #flags}: true if code from this application will need to be
* loaded into other applications' processes. On devices that support multiple
* instruction sets, this implies the code might be loaded into a process that's
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 4d9445d..4952ba1 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -2550,6 +2550,12 @@ public class PackageParser {
}
if (sa.getBoolean(
+ com.android.internal.R.styleable.AndroidManifestApplication_usesCleartextTraffic,
+ true)) {
+ ai.flags |= ApplicationInfo.FLAG_USES_CLEARTEXT_TRAFFIC;
+ }
+
+ if (sa.getBoolean(
com.android.internal.R.styleable.AndroidManifestApplication_supportsRtl,
false /* default is no RTL support*/)) {
ai.flags |= ApplicationInfo.FLAG_SUPPORTS_RTL;
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index 0c3fb9a..ea592cf 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -389,6 +389,15 @@
with the same {@link android.R.attr#taskAffinity} as it has. -->
<attr name="allowTaskReparenting" format="boolean" />
+ <!-- Declare that this application may use cleartext traffic (e.g., HTTP rather than HTTPS;
+ WebSockets rather than WebSockets Secure; XMPP, IMAP, STMP without STARTTLS or TLS).
+ Defaults to true. If set to false {@code false}, the app declares that it does not
+ intend to use 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 -->
+ <attr name="usesCleartextTraffic" format="boolean" />
+
<!-- Declare that code from this application will need to be loaded into other
applications' processes. On devices that support multiple instruction sets,
this implies the code might be loaded into a process that's using any of the devices
@@ -1133,6 +1142,14 @@
"com.google". -->
<attr name="requiredAccountType" format="string"/>
<attr name="isGame" />
+ <!-- Declare that this application may use cleartext traffic (e.g., HTTP rather than HTTPS;
+ WebSockets rather than WebSockets Secure; XMPP, IMAP, STMP without STARTTLS or TLS).
+ Defaults to true. If set to false {@code false}, the app declares that it does not
+ intend to use 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 -->
+ <attr name="usesCleartextTraffic" />
<attr name="multiArch" />
</declare-styleable>