diff options
author | Danesh M <daneshm90@gmail.com> | 2016-01-11 11:29:59 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-02-05 11:29:45 -0800 |
commit | faf68427a20c930acf5e2a1fda892eeeb21de43a (patch) | |
tree | 4b0fb59bc8a3abfe86a73ac6d5bf463f916477cc /packages | |
parent | a8533527366d17e9fe8a528b0b405ceaf87b45d3 (diff) | |
download | frameworks_base-faf68427a20c930acf5e2a1fda892eeeb21de43a.zip frameworks_base-faf68427a20c930acf5e2a1fda892eeeb21de43a.tar.gz frameworks_base-faf68427a20c930acf5e2a1fda892eeeb21de43a.tar.bz2 |
SettingsProvider : Make WIFI_IDLE_MS into an overlay
Change-Id: I327696a8cfb2a25ed7ef6adf65d36981253e2866
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SettingsProvider/res/values/defaults.xml | 3 | ||||
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java | 18 |
2 files changed, 20 insertions, 1 deletions
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index 1346788..490618f 100644 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -234,4 +234,7 @@ <!-- Default for Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED --> <integer name="def_captive_portal_detection_enabled" translatable="false">1</integer> + + <!-- Default for Settings.Global.WIFI_IDLE_MS (15 minutes) --> + <integer name="default_wifi_idle_ms">900000</integer> </resources> diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java index f55cead..66d0d8c 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java @@ -1986,7 +1986,7 @@ public class SettingsProvider extends ContentProvider { } private final class UpgradeController { - private static final int SETTINGS_VERSION = 122; + private static final int SETTINGS_VERSION = 123; /** * This is the 12.1 database version (DO NOT INCREMENT) */ @@ -2170,6 +2170,22 @@ public class SettingsProvider extends ContentProvider { } currentVersion = 122; } + + if (currentVersion == 122) { + if (userId == UserHandle.USER_OWNER) { + final SettingsState globalSettings = getGlobalSettingsLocked(); + Setting currentSetting = globalSettings.getSettingLocked( + Settings.Global.WIFI_IDLE_MS); + int defaultComponent = getContext().getResources().getInteger( + R.integer.default_wifi_idle_ms); + if (currentSetting == null) { + globalSettings.insertSettingLocked(Settings.Global.WIFI_IDLE_MS, + Integer.toString(defaultComponent), + SettingsState.SYSTEM_PACKAGE_NAME); + } + } + currentVersion = 123; + } // vXXX: Add new settings above this point. // Return the current version. |