Choose the Tether help file based on device config
Don't show wifi Tethering help on devices that don't support it, etc. bug:2520021 Change-Id: I905d1b66fc239d5a5f5028715623d8781041f9ca
This commit is contained in:
27
assets/html/en_us/tethering_usb_help.html
Normal file
27
assets/html/en_us/tethering_usb_help.html
Normal file
@@ -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>
|
27
assets/html/en_us/tethering_wifi_help.html
Normal file
27
assets/html/en_us/tethering_wifi_help.html
Normal file
@@ -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>
|
@@ -46,7 +46,9 @@ public class TetherSettings extends PreferenceActivity {
|
|||||||
private static final String ENABLE_WIFI_AP = "enable_wifi_ap";
|
private static final String ENABLE_WIFI_AP = "enable_wifi_ap";
|
||||||
private static final String WIFI_AP_SETTINGS = "wifi_ap_settings";
|
private static final String WIFI_AP_SETTINGS = "wifi_ap_settings";
|
||||||
private static final String TETHERING_HELP = "tethering_help";
|
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;
|
private CheckBoxPreference mUsbTether;
|
||||||
|
|
||||||
@@ -245,6 +247,16 @@ public class TetherSettings extends PreferenceActivity {
|
|||||||
Locale locale = Locale.getDefault();
|
Locale locale = Locale.getDefault();
|
||||||
String url = HELP_URL.replace("%y", locale.getLanguage().toLowerCase());
|
String url = HELP_URL.replace("%y", locale.getLanguage().toLowerCase());
|
||||||
url = url.replace("%z", locale.getCountry().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);
|
WebView view = new WebView(this);
|
||||||
view.loadUrl(url);
|
view.loadUrl(url);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user