diff options
author | Steve Howard <showard@google.com> | 2010-09-17 16:45:58 -0700 |
---|---|---|
committer | Steve Howard <showard@google.com> | 2010-09-21 12:43:05 -0700 |
commit | d319729622da1893e895f2e35f41d01ecdca3705 (patch) | |
tree | 02994abdf2725061b798cb32339b044592cbf581 /src/com/android/providers/downloads/RealSystemFacade.java | |
parent | 78f433c68f14dfba605ceb0e5f3dc54243efd2b2 (diff) | |
download | android_packages_providers_DownloadProvider-d319729622da1893e895f2e35f41d01ecdca3705.tar.gz android_packages_providers_DownloadProvider-d319729622da1893e895f2e35f41d01ecdca3705.tar.bz2 android_packages_providers_DownloadProvider-d319729622da1893e895f2e35f41d01ecdca3705.zip |
Implement dialogs for wifi required + recommended limits.
This change extends the original work to add a size limit over which
wifi is required to download a file.
First, this change adds a second size limit, over which wifi is
recommended but not required. The user has the option to bypass this
limit.
Second, this change implements dialogs shown to the user when either
limit is exceeded. These dialogs are shown by the background download
manager service when a download is started and found to be over the
limit (and wifi is not connected).
I'm including one small fix to the unit tests needed from the previous
change.
Change-Id: Ia0f0acaa7b0d00e98355925c3446c0472048df10
Diffstat (limited to 'src/com/android/providers/downloads/RealSystemFacade.java')
-rw-r--r-- | src/com/android/providers/downloads/RealSystemFacade.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/com/android/providers/downloads/RealSystemFacade.java b/src/com/android/providers/downloads/RealSystemFacade.java index 421fc2be..ce86f739 100644 --- a/src/com/android/providers/downloads/RealSystemFacade.java +++ b/src/com/android/providers/downloads/RealSystemFacade.java @@ -71,6 +71,16 @@ class RealSystemFacade implements SystemFacade { } @Override + public Long getRecommendedMaxBytesOverMobile() { + try { + return Settings.Secure.getLong(mContext.getContentResolver(), + Settings.Secure.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE); + } catch (SettingNotFoundException exc) { + return null; + } + } + + @Override public void sendBroadcast(Intent intent) { mContext.sendBroadcast(intent); } |