Add settings for persisting the mobile data connection.
Change-Id: I9b92104893e860e2beb63ac86d417419699c085b
This commit is contained in:
@@ -155,6 +155,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
||||
private static final String USB_CONFIGURATION_KEY = "select_usb_configuration";
|
||||
private static final String SELECT_USB_CONFIGURATION_PROPERTY = "sys.usb.config";
|
||||
private static final String WIFI_LEGACY_DHCP_CLIENT_KEY = "legacy_dhcp_client";
|
||||
private static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
|
||||
|
||||
private static final String OPENGL_TRACES_KEY = "enable_opengl_traces";
|
||||
|
||||
@@ -208,6 +209,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
||||
private SwitchPreference mWifiVerboseLogging;
|
||||
private SwitchPreference mWifiAggressiveHandover;
|
||||
private SwitchPreference mLegacyDhcpClient;
|
||||
private SwitchPreference mMobileDataAlwaysOn;
|
||||
|
||||
private SwitchPreference mWifiAllowScansWithTraffic;
|
||||
private SwitchPreference mStrictMode;
|
||||
@@ -353,6 +355,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
||||
mWifiAggressiveHandover = findAndInitSwitchPref(WIFI_AGGRESSIVE_HANDOVER_KEY);
|
||||
mWifiAllowScansWithTraffic = findAndInitSwitchPref(WIFI_ALLOW_SCAN_WITH_TRAFFIC_KEY);
|
||||
mLegacyDhcpClient = findAndInitSwitchPref(WIFI_LEGACY_DHCP_CLIENT_KEY);
|
||||
mMobileDataAlwaysOn = findAndInitSwitchPref(MOBILE_DATA_ALWAYS_ON);
|
||||
mLogdSize = addListPreference(SELECT_LOGD_SIZE_KEY);
|
||||
mUsbConfiguration = addListPreference(USB_CONFIGURATION_KEY);
|
||||
|
||||
@@ -586,6 +589,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
||||
updateWifiAggressiveHandoverOptions();
|
||||
updateWifiAllowScansWithTrafficOptions();
|
||||
updateLegacyDhcpClientOptions();
|
||||
updateMobileDataAlwaysOnOptions();
|
||||
updateSimulateColorSpace();
|
||||
updateUseNuplayerOptions();
|
||||
updateUSBAudioOptions();
|
||||
@@ -1152,6 +1156,18 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
||||
mLegacyDhcpClient.isChecked() ? 1 : 0);
|
||||
}
|
||||
|
||||
private void updateMobileDataAlwaysOnOptions() {
|
||||
updateSwitchPreference(mMobileDataAlwaysOn, Settings.Global.getInt(
|
||||
getActivity().getContentResolver(),
|
||||
Settings.Global.MOBILE_DATA_ALWAYS_ON, 0) != 0);
|
||||
}
|
||||
|
||||
private void writeMobileDataAlwaysOnOptions() {
|
||||
Settings.Global.putInt(getActivity().getContentResolver(),
|
||||
Settings.Global.MOBILE_DATA_ALWAYS_ON,
|
||||
mMobileDataAlwaysOn.isChecked() ? 1 : 0);
|
||||
}
|
||||
|
||||
private void updateLogdSizeValues() {
|
||||
if (mLogdSize != null) {
|
||||
String currentValue = SystemProperties.get(SELECT_LOGD_SIZE_PROPERTY);
|
||||
@@ -1592,6 +1608,8 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
||||
writeWifiAllowScansWithTrafficOptions();
|
||||
} else if (preference == mLegacyDhcpClient) {
|
||||
writeLegacyDhcpClientOptions();
|
||||
} else if (preference == mMobileDataAlwaysOn) {
|
||||
writeMobileDataAlwaysOnOptions();
|
||||
} else if (preference == mUseAwesomePlayer) {
|
||||
writeUseAwesomePlayerOptions();
|
||||
} else if (preference == mUSBAudio) {
|
||||
|
Reference in New Issue
Block a user