/**
* Returns whether cleartext network traffic (e.g. HTTP, FTP, WebSockets, XMPP, IMAP, SMTP --
- * without TLS or STARTTLS) is permitted for this process.
+ * without TLS or STARTTLS) is permitted for all network communication from this process.
*
* <p>When cleartext network traffic is not permitted, the platform's components (e.g. HTTP and
* FTP stacks, {@link android.app.DownloadManager}, {@link android.media.MediaPlayer}) will
}
/**
+ * Returns whether cleartext network traffic (e.g. HTTP, FTP, XMPP, IMAP, SMTP -- without
+ * TLS or STARTTLS) is permitted for communicating with {@code hostname} for this process.
+ *
+ * @see #isCleartextTrafficPermitted()
+ * @hide
+ */
+ public boolean isCleartextTrafficPermitted(String hostname) {
+ return libcore.net.NetworkSecurityPolicy.getInstance()
+ .isCleartextTrafficPermitted(hostname);
+ }
+
+ /**
* Sets whether cleartext network traffic is permitted for this process.
*
* <p>This method is used by the platform early on in the application's initialization to set