From 15fb2d1096ecd9ced547682f0c1b3e185ed5f437 Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Fri, 3 Mar 2017 16:17:15 +0900 Subject: [PATCH] Display the correct default for mobile data always on. Mobile data always on was enabled by changing the default in ConnectivityService to 1. However, the default value in the developer options setting was left at 0. This means that by default (i.e., when the setting is empty), mobile data always on is enabled but appears in developer options as disabled. Fix this by changing the default in developer options. This is simpler than the other options (adding database upgrade code to settings, making the default be controlled by config.xml and ensuring that when a config changed broadcast is received the value is re-rease, hardcoding a default value as an @hide constant in Settings, etc.) Bug: 23113288 Test: setting is off after "adb shell settings delete global mobile_data_always_on" Change-Id: I27e2c0af7a03e510e640dbcfa281449d00385154 --- src/com/android/settings/DevelopmentSettings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java index e6bb8fb34ae..c96ca61e342 100644 --- a/src/com/android/settings/DevelopmentSettings.java +++ b/src/com/android/settings/DevelopmentSettings.java @@ -1515,7 +1515,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment private void updateMobileDataAlwaysOnOptions() { updateSwitchPreference(mMobileDataAlwaysOn, Settings.Global.getInt( getActivity().getContentResolver(), - Settings.Global.MOBILE_DATA_ALWAYS_ON, 0) != 0); + Settings.Global.MOBILE_DATA_ALWAYS_ON, 1) != 0); } private void writeMobileDataAlwaysOnOptions() {