Class of android.security · NetworkSecurityPolicy.java · Android's reference
public class NetworkSecurityPolicy
The network security policy of the app. Cleartext traffic follows Android's default: permitted when the manifest sets usesCleartextTraffic or the app targets API 27 or lower. The domains of a network security config are not read.
public static NetworkSecurityPolicy getInstance() sourcepublic boolean isCleartextTrafficPermitted() sourcepublic boolean isCleartextTrafficPermitted(String hostname) sourceMade from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.