Remove / re-word some settings for WiFi-only devices.
Bug: 3468248 1. Remove Wireless->Mobile networks 2. Remove Wireless->Tethering and WiFi hotspot 3. Remove Wireless->Wi-Fi Settings->Wi-Fi disconnect policy 4. Re-word Network location summary text to not include "mobile network" Change-Id: I84a551a1b63591974731029b0d4b90a85e43a716
This commit is contained in:
@@ -1852,6 +1852,8 @@
|
|||||||
<string name="location_networks_disabled">See location in applications (such as Maps) using wireless networks</string>
|
<string name="location_networks_disabled">See location in applications (such as Maps) using wireless networks</string>
|
||||||
<!-- Security & location settings screen, setting summary when Use wireless networks check box is selected -->
|
<!-- Security & location settings screen, setting summary when Use wireless networks check box is selected -->
|
||||||
<string name="location_neighborhood_level">Location determined by Wi-Fi and/or mobile networks</string>
|
<string name="location_neighborhood_level">Location determined by Wi-Fi and/or mobile networks</string>
|
||||||
|
<!-- Security & location settings screen, setting summary when Use wireless networks check box is selected, for wifi-only devices [CHAR LIMIT=100] -->
|
||||||
|
<string name="location_neighborhood_level_wifi">Location determined by Wi-Fi</string>
|
||||||
<!-- Security & location settings screen, setting check box label if the GPS receiver should be enabled -->
|
<!-- Security & location settings screen, setting check box label if the GPS receiver should be enabled -->
|
||||||
<string name="location_gps">Use GPS satellites</string>
|
<string name="location_gps">Use GPS satellites</string>
|
||||||
<!-- [CHAR LIMIT=100] Security & location settings screen, setting summary when Use GPS satellites check box is selected -->
|
<!-- [CHAR LIMIT=100] Security & location settings screen, setting summary when Use GPS satellites check box is selected -->
|
||||||
|
@@ -72,6 +72,7 @@
|
|||||||
android:persistent="false" />
|
android:persistent="false" />
|
||||||
|
|
||||||
<PreferenceScreen
|
<PreferenceScreen
|
||||||
|
android:key="mobile_network_settings"
|
||||||
android:title="@string/network_settings_title"
|
android:title="@string/network_settings_title"
|
||||||
android:summary="@string/network_settings_summary"
|
android:summary="@string/network_settings_summary"
|
||||||
android:dependency="toggle_airplane">
|
android:dependency="toggle_airplane">
|
||||||
|
@@ -160,6 +160,11 @@ public class SecuritySettings extends SettingsPreferenceFragment
|
|||||||
mUseLocation = useLocation;
|
mUseLocation = useLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Change the summary for wifi-only devices
|
||||||
|
if (Utils.isWifiOnly()) {
|
||||||
|
mNetwork.setSummaryOn(R.string.location_neighborhood_level_wifi);
|
||||||
|
}
|
||||||
|
|
||||||
// Add options for lock/unlock screen
|
// Add options for lock/unlock screen
|
||||||
int resid = 0;
|
int resid = 0;
|
||||||
if (!mLockPatternUtils.isSecure()) {
|
if (!mLockPatternUtils.isSecure()) {
|
||||||
|
@@ -278,4 +278,8 @@ public class Utils {
|
|||||||
(TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
(TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||||
return telephony != null && telephony.isVoiceCapable();
|
return telephony != null && telephony.isVoiceCapable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isWifiOnly() {
|
||||||
|
return "wifi-only".equals(SystemProperties.get("ro.carrier"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -48,6 +48,7 @@ public class WirelessSettings extends SettingsPreferenceFragment {
|
|||||||
private static final String KEY_VPN_SETTINGS = "vpn_settings";
|
private static final String KEY_VPN_SETTINGS = "vpn_settings";
|
||||||
private static final String KEY_TETHER_SETTINGS = "tether_settings";
|
private static final String KEY_TETHER_SETTINGS = "tether_settings";
|
||||||
private static final String KEY_PROXY_SETTINGS = "proxy_settings";
|
private static final String KEY_PROXY_SETTINGS = "proxy_settings";
|
||||||
|
private static final String KEY_MOBILE_NETWORK_SETTINGS = "mobile_network_settings";
|
||||||
|
|
||||||
public static final String EXIT_ECM_RESULT = "exit_ecm_result";
|
public static final String EXIT_ECM_RESULT = "exit_ecm_result";
|
||||||
public static final int REQUEST_CODE_EXIT_ECM = 1;
|
public static final int REQUEST_CODE_EXIT_ECM = 1;
|
||||||
@@ -131,6 +132,11 @@ public class WirelessSettings extends SettingsPreferenceFragment {
|
|||||||
getPreferenceScreen().removePreference(nfc);
|
getPreferenceScreen().removePreference(nfc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove Mobile Network Settings if it's a wifi-only device.
|
||||||
|
if (Utils.isWifiOnly()) {
|
||||||
|
getPreferenceScreen().removePreference(findPreference(KEY_MOBILE_NETWORK_SETTINGS));
|
||||||
|
}
|
||||||
|
|
||||||
// Enable Proxy selector settings if allowed.
|
// Enable Proxy selector settings if allowed.
|
||||||
Preference mGlobalProxy = findPreference(KEY_PROXY_SETTINGS);
|
Preference mGlobalProxy = findPreference(KEY_PROXY_SETTINGS);
|
||||||
DevicePolicyManager mDPM = (DevicePolicyManager)
|
DevicePolicyManager mDPM = (DevicePolicyManager)
|
||||||
@@ -139,10 +145,10 @@ public class WirelessSettings extends SettingsPreferenceFragment {
|
|||||||
getPreferenceScreen().removePreference(mGlobalProxy);
|
getPreferenceScreen().removePreference(mGlobalProxy);
|
||||||
mGlobalProxy.setEnabled(mDPM.getGlobalProxyAdmin() == null);
|
mGlobalProxy.setEnabled(mDPM.getGlobalProxyAdmin() == null);
|
||||||
|
|
||||||
// Disable Tethering if it's not allowed
|
// Disable Tethering if it's not allowed or if it's a wifi-only device
|
||||||
ConnectivityManager cm =
|
ConnectivityManager cm =
|
||||||
(ConnectivityManager) activity.getSystemService(Context.CONNECTIVITY_SERVICE);
|
(ConnectivityManager) activity.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
if (!cm.isTetheringSupported()) {
|
if (!cm.isTetheringSupported() || Utils.isWifiOnly()) {
|
||||||
getPreferenceScreen().removePreference(findPreference(KEY_TETHER_SETTINGS));
|
getPreferenceScreen().removePreference(findPreference(KEY_TETHER_SETTINGS));
|
||||||
} else {
|
} else {
|
||||||
String[] usbRegexs = cm.getTetherableUsbRegexs();
|
String[] usbRegexs = cm.getTetherableUsbRegexs();
|
||||||
|
@@ -21,6 +21,7 @@ import static android.net.wifi.WifiConfiguration.INVALID_NETWORK_ID;
|
|||||||
import com.android.settings.ProgressCategoryBase;
|
import com.android.settings.ProgressCategoryBase;
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.SettingsPreferenceFragment;
|
import com.android.settings.SettingsPreferenceFragment;
|
||||||
|
import com.android.settings.Utils;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
@@ -211,12 +212,16 @@ public class WifiSettings extends SettingsPreferenceFragment
|
|||||||
|
|
||||||
ListPreference pref = (ListPreference) findPreference(KEY_SLEEP_POLICY);
|
ListPreference pref = (ListPreference) findPreference(KEY_SLEEP_POLICY);
|
||||||
if (pref != null) {
|
if (pref != null) {
|
||||||
|
if (Utils.isWifiOnly()) {
|
||||||
|
getPreferenceScreen().removePreference(pref);
|
||||||
|
} else {
|
||||||
pref.setOnPreferenceChangeListener(this);
|
pref.setOnPreferenceChangeListener(this);
|
||||||
int value = Settings.System.getInt(getContentResolver(),
|
int value = Settings.System.getInt(getContentResolver(),
|
||||||
Settings.System.WIFI_SLEEP_POLICY,
|
Settings.System.WIFI_SLEEP_POLICY,
|
||||||
Settings.System.WIFI_SLEEP_POLICY_NEVER);
|
Settings.System.WIFI_SLEEP_POLICY_NEVER);
|
||||||
pref.setValue(String.valueOf(value));
|
pref.setValue(String.valueOf(value));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
registerForContextMenu(getListView());
|
registerForContextMenu(getListView());
|
||||||
setHasOptionsMenu(true);
|
setHasOptionsMenu(true);
|
||||||
|
Reference in New Issue
Block a user