diff options
author | 2015-04-02 13:32:22 -0700 | |
---|---|---|
committer | 2015-04-02 13:32:22 -0700 | |
commit | 24a9683ac9fc1b6d3ac49de449ea4b2f155f26a9 (patch) | |
tree | 0c79bbcf135b1581e290fd1364e77c5ac68ce5b9 | |
parent | 1a58c47ebe137ee1d5b3a2567b97802946945d38 (diff) | |
download | latinime-24a9683ac9fc1b6d3ac49de449ea4b2f155f26a9.tar.gz latinime-24a9683ac9fc1b6d3ac49de449ea4b2f155f26a9.tar.xz latinime-24a9683ac9fc1b6d3ac49de449ea4b2f155f26a9.zip |
Declare that LatinIME does not use cleartext network traffic.
This declares to the platform and tools that this app does not use
cleartext network traffic. The platform and tools will be blocking
(on best effort basis) attempts to use such traffic by this app.
For example, attempts to use HTTP (rather than HTTPS) will be blocked.
Bug: 19215516
Change-Id: I4c933a214457025797e077b72d8daf8a0c876923
-rw-r--r-- | java/AndroidManifest.xml | 3 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/network/HttpUrlConnectionBuilderTests.java | 10 |
2 files changed, 7 insertions, 6 deletions
diff --git a/java/AndroidManifest.xml b/java/AndroidManifest.xml index f58c401c7..7e77e77d1 100644 --- a/java/AndroidManifest.xml +++ b/java/AndroidManifest.xml @@ -38,7 +38,8 @@ <application android:label="@string/english_ime_name" android:icon="@drawable/ic_launcher_keyboard" android:supportsRtl="true" - android:allowBackup="true"> + android:allowBackup="true" + android:usesCleartextTraffic="false"> <!-- Services --> <service android:name="LatinIME" diff --git a/tests/src/com/android/inputmethod/latin/network/HttpUrlConnectionBuilderTests.java b/tests/src/com/android/inputmethod/latin/network/HttpUrlConnectionBuilderTests.java index 5b3e78eaf..54808b793 100644 --- a/tests/src/com/android/inputmethod/latin/network/HttpUrlConnectionBuilderTests.java +++ b/tests/src/com/android/inputmethod/latin/network/HttpUrlConnectionBuilderTests.java @@ -87,7 +87,7 @@ public class HttpUrlConnectionBuilderTests extends AndroidTestCase { public void testAddHeader() throws IOException { HttpUrlConnectionBuilder builder = new HttpUrlConnectionBuilder(); - builder.setUrl("http://www.example.com"); + builder.setUrl("https://www.example.com"); builder.addHeader("some-random-key", "some-random-value"); HttpURLConnection connection = builder.build(); assertEquals("some-random-value", connection.getRequestProperty("some-random-key")); @@ -95,14 +95,14 @@ public class HttpUrlConnectionBuilderTests extends AndroidTestCase { public void testSetUseCache_notSet() throws IOException { HttpUrlConnectionBuilder builder = new HttpUrlConnectionBuilder(); - builder.setUrl("http://www.example.com"); + builder.setUrl("https://www.example.com"); HttpURLConnection connection = builder.build(); assertFalse(connection.getUseCaches()); } public void testSetUseCache_false() throws IOException { HttpUrlConnectionBuilder builder = new HttpUrlConnectionBuilder(); - builder.setUrl("http://www.example.com"); + builder.setUrl("https://www.example.com"); HttpURLConnection connection = builder.build(); connection.setUseCaches(false); assertFalse(connection.getUseCaches()); @@ -110,7 +110,7 @@ public class HttpUrlConnectionBuilderTests extends AndroidTestCase { public void testSetUseCache_true() throws IOException { HttpUrlConnectionBuilder builder = new HttpUrlConnectionBuilder(); - builder.setUrl("http://www.example.com"); + builder.setUrl("https://www.example.com"); HttpURLConnection connection = builder.build(); connection.setUseCaches(true); assertTrue(connection.getUseCaches()); @@ -118,7 +118,7 @@ public class HttpUrlConnectionBuilderTests extends AndroidTestCase { public void testSetMode_uploadOnly() throws IOException { HttpUrlConnectionBuilder builder = new HttpUrlConnectionBuilder(); - builder.setUrl("http://www.example.com"); + builder.setUrl("https://www.example.com"); builder.setMode(MODE_UPLOAD_ONLY); HttpURLConnection connection = builder.build(); assertTrue(connection.getDoInput()); |