Add settings for persisting the mobile data connection.
Change-Id: I9b92104893e860e2beb63ac86d417419699c085b
This commit is contained in:
@@ -3557,6 +3557,8 @@
|
|||||||
<string name="wifi_allow_scan_with_traffic">Always allow Wi\u2011Fi Roam Scans</string>
|
<string name="wifi_allow_scan_with_traffic">Always allow Wi\u2011Fi Roam Scans</string>
|
||||||
<!-- Setting Checkbox title whether to enable WiFi Scanning in the presence of traffic. [CHAR LIMIT=80] -->
|
<!-- Setting Checkbox title whether to enable WiFi Scanning in the presence of traffic. [CHAR LIMIT=80] -->
|
||||||
<string name="legacy_dhcp_client">Use legacy DHCP client</string>
|
<string name="legacy_dhcp_client">Use legacy DHCP client</string>
|
||||||
|
<!-- Setting Checkbox title whether to always keep cellular data active. [CHAR LIMIT=80] -->
|
||||||
|
<string name="mobile_data_always_on">Cellular data always active</string>
|
||||||
|
|
||||||
<!-- setting Checkbox summary whether to show options for wireless display certification -->
|
<!-- setting Checkbox summary whether to show options for wireless display certification -->
|
||||||
<string name="wifi_display_certification_summary">Show options for wireless display certification</string>
|
<string name="wifi_display_certification_summary">Show options for wireless display certification</string>
|
||||||
@@ -3583,6 +3585,7 @@
|
|||||||
<!-- Title of warning dialog about the implications of enabling USB debugging -->
|
<!-- Title of warning dialog about the implications of enabling USB debugging -->
|
||||||
<!-- Setting Checkbox summary whether to use DHCP client from Lollipop (Android 5.0) [CHAR LIMIT=130] -->
|
<!-- Setting Checkbox summary whether to use DHCP client from Lollipop (Android 5.0) [CHAR LIMIT=130] -->
|
||||||
<string name="legacy_dhcp_client_summary">Use the DHCP client from Lollipop instead of the new Android DHCP client.</string>
|
<string name="legacy_dhcp_client_summary">Use the DHCP client from Lollipop instead of the new Android DHCP client.</string>
|
||||||
|
<string name="mobile_data_always_on_summary">Always keep mobile data active, even when Wi\u2011Fi is active (for fast network switching).</string>
|
||||||
<string name="adb_warning_title">Allow USB debugging?</string>
|
<string name="adb_warning_title">Allow USB debugging?</string>
|
||||||
<!-- Warning text to user about the implications of enabling USB debugging -->
|
<!-- Warning text to user about the implications of enabling USB debugging -->
|
||||||
<string name="adb_warning_message">USB debugging is intended for development purposes only. Use it to copy data between your computer and your device, install apps on your device without notification, and read log data.</string>
|
<string name="adb_warning_message">USB debugging is intended for development purposes only. Use it to copy data between your computer and your device, install apps on your device without notification, and read log data.</string>
|
||||||
|
@@ -137,9 +137,14 @@
|
|||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:key="legacy_dhcp_client"
|
android:key="legacy_dhcp_client"
|
||||||
android:title="@string/legacy_dhcp_client" />
|
android:title="@string/legacy_dhcp_client"
|
||||||
android:summary="@string/legacy_dhcp_client_summary"/>
|
android:summary="@string/legacy_dhcp_client_summary"/>
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="mobile_data_always_on"
|
||||||
|
android:title="@string/mobile_data_always_on"
|
||||||
|
android:summary="@string/mobile_data_always_on_summary"/>
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:key="select_usb_configuration"
|
android:key="select_usb_configuration"
|
||||||
android:title="@string/select_usb_configuration_title"
|
android:title="@string/select_usb_configuration_title"
|
||||||
|
@@ -155,6 +155,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
private static final String USB_CONFIGURATION_KEY = "select_usb_configuration";
|
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 SELECT_USB_CONFIGURATION_PROPERTY = "sys.usb.config";
|
||||||
private static final String WIFI_LEGACY_DHCP_CLIENT_KEY = "legacy_dhcp_client";
|
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";
|
private static final String OPENGL_TRACES_KEY = "enable_opengl_traces";
|
||||||
|
|
||||||
@@ -208,6 +209,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
private SwitchPreference mWifiVerboseLogging;
|
private SwitchPreference mWifiVerboseLogging;
|
||||||
private SwitchPreference mWifiAggressiveHandover;
|
private SwitchPreference mWifiAggressiveHandover;
|
||||||
private SwitchPreference mLegacyDhcpClient;
|
private SwitchPreference mLegacyDhcpClient;
|
||||||
|
private SwitchPreference mMobileDataAlwaysOn;
|
||||||
|
|
||||||
private SwitchPreference mWifiAllowScansWithTraffic;
|
private SwitchPreference mWifiAllowScansWithTraffic;
|
||||||
private SwitchPreference mStrictMode;
|
private SwitchPreference mStrictMode;
|
||||||
@@ -353,6 +355,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
mWifiAggressiveHandover = findAndInitSwitchPref(WIFI_AGGRESSIVE_HANDOVER_KEY);
|
mWifiAggressiveHandover = findAndInitSwitchPref(WIFI_AGGRESSIVE_HANDOVER_KEY);
|
||||||
mWifiAllowScansWithTraffic = findAndInitSwitchPref(WIFI_ALLOW_SCAN_WITH_TRAFFIC_KEY);
|
mWifiAllowScansWithTraffic = findAndInitSwitchPref(WIFI_ALLOW_SCAN_WITH_TRAFFIC_KEY);
|
||||||
mLegacyDhcpClient = findAndInitSwitchPref(WIFI_LEGACY_DHCP_CLIENT_KEY);
|
mLegacyDhcpClient = findAndInitSwitchPref(WIFI_LEGACY_DHCP_CLIENT_KEY);
|
||||||
|
mMobileDataAlwaysOn = findAndInitSwitchPref(MOBILE_DATA_ALWAYS_ON);
|
||||||
mLogdSize = addListPreference(SELECT_LOGD_SIZE_KEY);
|
mLogdSize = addListPreference(SELECT_LOGD_SIZE_KEY);
|
||||||
mUsbConfiguration = addListPreference(USB_CONFIGURATION_KEY);
|
mUsbConfiguration = addListPreference(USB_CONFIGURATION_KEY);
|
||||||
|
|
||||||
@@ -586,6 +589,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
updateWifiAggressiveHandoverOptions();
|
updateWifiAggressiveHandoverOptions();
|
||||||
updateWifiAllowScansWithTrafficOptions();
|
updateWifiAllowScansWithTrafficOptions();
|
||||||
updateLegacyDhcpClientOptions();
|
updateLegacyDhcpClientOptions();
|
||||||
|
updateMobileDataAlwaysOnOptions();
|
||||||
updateSimulateColorSpace();
|
updateSimulateColorSpace();
|
||||||
updateUseNuplayerOptions();
|
updateUseNuplayerOptions();
|
||||||
updateUSBAudioOptions();
|
updateUSBAudioOptions();
|
||||||
@@ -1152,6 +1156,18 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
mLegacyDhcpClient.isChecked() ? 1 : 0);
|
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() {
|
private void updateLogdSizeValues() {
|
||||||
if (mLogdSize != null) {
|
if (mLogdSize != null) {
|
||||||
String currentValue = SystemProperties.get(SELECT_LOGD_SIZE_PROPERTY);
|
String currentValue = SystemProperties.get(SELECT_LOGD_SIZE_PROPERTY);
|
||||||
@@ -1592,6 +1608,8 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
writeWifiAllowScansWithTrafficOptions();
|
writeWifiAllowScansWithTrafficOptions();
|
||||||
} else if (preference == mLegacyDhcpClient) {
|
} else if (preference == mLegacyDhcpClient) {
|
||||||
writeLegacyDhcpClientOptions();
|
writeLegacyDhcpClientOptions();
|
||||||
|
} else if (preference == mMobileDataAlwaysOn) {
|
||||||
|
writeMobileDataAlwaysOnOptions();
|
||||||
} else if (preference == mUseAwesomePlayer) {
|
} else if (preference == mUseAwesomePlayer) {
|
||||||
writeUseAwesomePlayerOptions();
|
writeUseAwesomePlayerOptions();
|
||||||
} else if (preference == mUSBAudio) {
|
} else if (preference == mUSBAudio) {
|
||||||
|
Reference in New Issue
Block a user