diff options
author | Paul Westbrook <pwestbro@google.com> | 2011-02-01 14:26:16 -0800 |
---|---|---|
committer | Paul Westbrook <pwestbro@google.com> | 2011-02-01 14:36:24 -0800 |
commit | d99d0dc43a3c26c77dd22e405efbdf0753d8309e (patch) | |
tree | f3ccc6dc108dfd468d893a92eb27136a9bf03fbd /packages/SettingsProvider | |
parent | 22ad6243d7c9081e4f1a13097cfa4638cf42c3fe (diff) | |
download | frameworks_base-d99d0dc43a3c26c77dd22e405efbdf0753d8309e.zip frameworks_base-d99d0dc43a3c26c77dd22e405efbdf0753d8309e.tar.gz frameworks_base-d99d0dc43a3c26c77dd22e405efbdf0753d8309e.tar.bz2 |
Enable retrieving default download manager settings
Enable retrieving the default download manager settings from
a resource, when the SettingsProvider database is created
The default setting for these values is -1, which will cause
DownloadManger to not enforce a limit.
Bug: 3341145
Change-Id: I25294d0f75fb0bdf20d4bef54457056c25c31add
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r-- | packages/SettingsProvider/res/values/defaults.xml | 5 | ||||
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java | 14 |
2 files changed, 19 insertions, 0 deletions
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index 27c8aea..2df6d68 100644 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -116,4 +116,9 @@ <!-- Default for Settings.System.USER_ROTATION --> <integer name="def_user_rotation">0</integer> + + <!-- Default for Settings.Secure.DOWNLOAD_MAX_BYTES_OVER_MOBILE. <=0 if no limit --> + <integer name="def_download_manager_max_bytes_over_mobile">-1</integer> + <!-- Default for Settings.Secure.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE. <=0 if no limit --> + <integer name="def_download_manager_recommended_max_bytes_over_mobile">-1</integer> </resources> diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index 580113c..49b71e2 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -1295,6 +1295,20 @@ public class DatabaseHelper extends SQLiteOpenHelper { loadStringSetting(stmt, Settings.Secure.ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS, R.string.def_accessibility_web_content_key_bindings); + + final int maxBytes = mContext.getResources().getInteger( + R.integer.def_download_manager_max_bytes_over_mobile); + if (maxBytes > 0) { + loadSetting(stmt, Settings.Secure.DOWNLOAD_MAX_BYTES_OVER_MOBILE, + Integer.toString(maxBytes)); + } + + final int recommendedMaxBytes = mContext.getResources().getInteger( + R.integer.def_download_manager_recommended_max_bytes_over_mobile); + if (recommendedMaxBytes > 0) { + loadSetting(stmt, Settings.Secure.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE, + Integer.toString(recommendedMaxBytes)); + } } finally { if (stmt != null) stmt.close(); } |