Make Settings app not use cleartext network traffic.
This CL switches the only two places which use cleartext HTTP in this
app to HTTPS. It also declares in the AndroidManifest.xml that this
app does not use cleartext network traffic, thus asking the platform
and tools to block any such traffic from this app on best effort
basis.
NOTE: The only test that uses cleartext HTTP traffic is in VpnTests.
This test makes cleartext HTTP requests to a third-party service which
does not appear to support HTTPS. Thus, this CL temporarily relaxes
the cleartext traffic policy during this test to keep it working. The
correct longer-term fix for this test is to use a service that offers
HTTPS.
Bug: 19215516
Change-Id: Idf1ff8c66d43d77ef2114b2f1b676927844150e5
diff --git a/src/com/android/settings/RadioInfo.java b/src/com/android/settings/RadioInfo.java
index 77927d9..fa98bac 100644
--- a/src/com/android/settings/RadioInfo.java
+++ b/src/com/android/settings/RadioInfo.java
@@ -754,7 +754,7 @@
HttpURLConnection urlConnection = null;
try {
// TODO: Hardcoded for now, make it UI configurable
- URL url = new URL("http://www.google.com");
+ URL url = new URL("https://www.google.com");
urlConnection = (HttpURLConnection) url.openConnection();
if (urlConnection.getResponseCode() == 200) {
mHttpClientTestResult = "Pass";
diff --git a/src/com/android/settings/wifi/WifiStatusTest.java b/src/com/android/settings/wifi/WifiStatusTest.java
index 85afb7c..269058c 100644
--- a/src/com/android/settings/wifi/WifiStatusTest.java
+++ b/src/com/android/settings/wifi/WifiStatusTest.java
@@ -396,7 +396,7 @@
HttpURLConnection urlConnection = null;
try {
// TODO: Hardcoded for now, make it UI configurable
- URL url = new URL("http://www.google.com");
+ URL url = new URL("https://www.google.com");
urlConnection = (HttpURLConnection) url.openConnection();
if (urlConnection.getResponseCode() == 200) {
mHttpClientTestResult = "Pass";