OSDN Git Service

Change the validation URL for Chinese SIMs
authorRemi NGUYEN VAN <reminv@google.com>
Fri, 12 Apr 2019 12:54:46 +0000 (05:54 -0700)
committerLorenzo Colitti <lorenzo@google.com>
Thu, 18 Apr 2019 13:30:00 +0000 (13:30 +0000)
The default HTTPS and fallback validation URLs are not accessible from
China, so users in China never get a validated network on WiFi with the
default AOSP settings. OEMs selling devices targeting China typically
change the check URLs for that reason.

When the device uses a Chinese SIM card, change the default validation
URLs to URLs accessible accessible from China as of now.

Test: inserted China SIM, WiFi off/on, dumpsys network_stack shows new
      URL used
Bug: 111819230
Change-Id: Ib7f41f470ef1a9c7712f2477ebfab44e915cf1b9
Merged-In: Ib7f41f470ef1a9c7712f2477ebfab44e915cf1b9
(cherry picked from commit 990ea84d2d60256d8c752a4a582de0f5a28932c9)

packages/NetworkStack/res/values-mcc460/config.xml [new file with mode: 0644]

diff --git a/packages/NetworkStack/res/values-mcc460/config.xml b/packages/NetworkStack/res/values-mcc460/config.xml
new file mode 100644 (file)
index 0000000..fd4a848
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <!-- Network validation URL configuration for devices using a Chinese SIM (MCC 460).
+         The below URLs are often whitelisted by captive portals, so they should not be used in the
+         general case as this could degrade the user experience (portals not detected properly).
+         However in China the default URLs are not accessible in general. The below alternatives
+         should allow users to connect to local networks normally. -->
+    <string name="default_captive_portal_https_url" translatable="false">https://connectivitycheck.gstatic.com/generate_204</string>
+    <string-array name="default_captive_portal_fallback_urls" translatable="false">
+        <item>http://www.googleapis.cn/generate_204</item>
+    </string-array>
+</resources>