diff options
author | Dongwon Kang <dwkang@google.com> | 2011-07-20 17:04:42 +0900 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2011-07-20 20:56:14 -0700 |
commit | 715d0c9297bc3d290e983c3f365bf9226e0a7556 (patch) | |
tree | 8c748f58265f5dd4a3b4b87ab075e4d4593e23ff /src | |
parent | b7b4fea0a2e4ef1d43bc9b5240c65875a8219ec5 (diff) | |
download | android_packages_providers_DownloadProvider-715d0c9297bc3d290e983c3f365bf9226e0a7556.tar.gz android_packages_providers_DownloadProvider-715d0c9297bc3d290e983c3f365bf9226e0a7556.tar.bz2 android_packages_providers_DownloadProvider-715d0c9297bc3d290e983c3f365bf9226e0a7556.zip |
Bugfix:5033349
- Checking download data dir instread of /cache.
- Trying to remove stale files regardless of the low space thereshold.
(Note: This bug happens when download dir size is 100mb and there is a
file > 100mb in /cache.)
Change-Id: Iacded74eaadb2aa7f0af8d1b7e0f922e81c7e07c
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/providers/downloads/StorageManager.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/android/providers/downloads/StorageManager.java b/src/com/android/providers/downloads/StorageManager.java index 228f6681..27668601 100644 --- a/src/com/android/providers/downloads/StorageManager.java +++ b/src/com/android/providers/downloads/StorageManager.java @@ -222,16 +222,17 @@ class StorageManager { } if (root.equals(mDownloadDataDir)) { // this download is going into downloads data dir. check space in that specific dir. - bytesAvailable = getAvailableBytesInDownloadsDataDir(mSystemCacheDir); + bytesAvailable = getAvailableBytesInDownloadsDataDir(mDownloadDataDir); if (bytesAvailable < sDownloadDataDirLowSpaceThreshold) { // print a warning Log.w(Constants.TAG, "Downloads data dir: " + root + - " is running low on space. space available (in b): " + bytesAvailable); - } else if (bytesAvailable < targetBytes) { + " is running low on space. space available (in bytes): " + bytesAvailable); + } + if (bytesAvailable < targetBytes) { // Insufficient space; make space. discardPurgeableFiles(destination, sDownloadDataDirLowSpaceThreshold); removeSpuriousFiles(); - bytesAvailable = getAvailableBytesInDownloadsDataDir(mSystemCacheDir); + bytesAvailable = getAvailableBytesInDownloadsDataDir(mDownloadDataDir); } } if (bytesAvailable < targetBytes) { |