diff options
-rw-r--r-- | assets/html/en_us/tethering_usb_help.html | 27 | ||||
-rw-r--r-- | assets/html/en_us/tethering_wifi_help.html | 27 | ||||
-rw-r--r-- | src/com/android/settings/TetherSettings.java | 14 |
3 files changed, 67 insertions, 1 deletions
diff --git a/assets/html/en_us/tethering_usb_help.html b/assets/html/en_us/tethering_usb_help.html new file mode 100644 index 0000000..143a09f --- /dev/null +++ b/assets/html/en_us/tethering_usb_help.html @@ -0,0 +1,27 @@ +<html> +<head> +<style> +P { + font-size: 14 px; + } +B { + font-size: 16px; +} +A { + color: #OOC; +} +.style1 { + font-size: 16px; +} +</style> +</head> +<body> +<p><b>USB tethering</b></p> +<span class="style1">You can tether your phone to your computer with a USB cable, to share your phone's internet connection with your computer</span> +<ul> +<li>Tethering works with Windows Vista, Windows 7, and Linux</li><br> +<li>You can't mount your phone's SD card on your computer when USB tethered</li><br> +<li>For more information, including using USB tethering with other OSs, see <a href="http://www.google.com/phone/tether#usb">http://www.google.com/phone/tether#usb</a></li><br> +</ul> +</body> +</html> diff --git a/assets/html/en_us/tethering_wifi_help.html b/assets/html/en_us/tethering_wifi_help.html new file mode 100644 index 0000000..9519e9a --- /dev/null +++ b/assets/html/en_us/tethering_wifi_help.html @@ -0,0 +1,27 @@ +<html> +<head> +<style> +P { + font-size: 14 px; + } +B { + font-size: 16px; +} +A { + color: #OOC; +} +.style1 { + font-size: 16px; +} +</style> +</head> +<body> +<p><b>Wi-Fi tethering</b></p> +<span class="style1">You can turn your phone into a Wi-Fi access point, to share your phone's internet connection with one or more computers or other devices</span> +<ul> +<li>When your phone is acting as an access point, you can't use your phone's applications to access the internet via its Wi-Fi connection</li><br> +<li>You configure a Wi-Fi access point in Wi-Fi tethering settings</li><br> +<li>For more information, visit <a href="http://www.google.com/phone/tether#wifi">http://www.google.com/phone/tether#wifi</a></li><br> +</ul> +</body> +</html> diff --git a/src/com/android/settings/TetherSettings.java b/src/com/android/settings/TetherSettings.java index 4095e86..049f912 100644 --- a/src/com/android/settings/TetherSettings.java +++ b/src/com/android/settings/TetherSettings.java @@ -46,7 +46,9 @@ public class TetherSettings extends PreferenceActivity { private static final String ENABLE_WIFI_AP = "enable_wifi_ap"; private static final String WIFI_AP_SETTINGS = "wifi_ap_settings"; private static final String TETHERING_HELP = "tethering_help"; - private static final String HELP_URL = "file:///android_asset/html/%y_%z/tethering_help.html"; + private static final String USB_HELP_MODIFIER = "usb_"; + private static final String WIFI_HELP_MODIFIER = "wifi_"; + private static final String HELP_URL = "file:///android_asset/html/%y_%z/tethering_%xhelp.html"; private CheckBoxPreference mUsbTether; @@ -245,6 +247,16 @@ public class TetherSettings extends PreferenceActivity { Locale locale = Locale.getDefault(); String url = HELP_URL.replace("%y", locale.getLanguage().toLowerCase()); url = url.replace("%z", locale.getCountry().toLowerCase()); + + if ((mUsbRegexs.length != 0) && (mWifiRegexs.length == 0)) { + url = url.replace("%x", USB_HELP_MODIFIER); + } else if ((mWifiRegexs.length != 0) && (mUsbRegexs.length == 0)) { + url = url.replace("%x", WIFI_HELP_MODIFIER); + } else { + // could assert that both wifi and usb have regexs, but the default + // is to use this anyway so no check is needed + url = url.replace("%x", ""); + } WebView view = new WebView(this); view.loadUrl(url); |