summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Download dir: /data/data/com.android.providers.downloads/cache NOT /cacheVasu Nori2010-12-145-25/+62
| | | | | | | | | | bug:3264401 still to do: make sure only N bytes are taken up by downloads dir N = a value specific to each device. default = 100MB. Change-Id: I2a49f4b3831d3a8d7be13b5fd46d85d56e831e38
* manually merging Change-Id: If7dc0f86ea7a3c4394603416ca0fc33847f10fa7Vasu Nori2010-12-031-1/+1
| | | | | | need this CL from GB. without it, downloads are badly broken in master. Change-Id: I82ebc467f877bed50e373c437481ad19e14635bf
* Merge "bug:3144642 fix is to treat empty strings as nulls"Vasu Nori2010-12-021-46/+18
|\
| * bug:3144642 fix is to treat empty strings as nullsVasu Nori2010-12-021-46/+18
| | | | | | | | | | | | | | | | | | | | | | | | in the database, sometimes _data column in downloads is set to null and sometimes to empty string. this is inconsistent and causes bugs such as bug:3144642 aThis bug is caused by line# 793 in DownloadThread. state.mFileName is null sometimes and empty string sometimes - because the correspodning field is set inconsistentlt in downloads.db _data column. Change-Id: Ifea1544737023008eff44aef9acd976902a0c143
* | am 084c3dc3: am 26f86843: Merge "(GB MR) bug:3144642 temporary small fix in ↵Vasu Nori2010-12-021-1/+1
|\ \ | |/ |/| | | | | | | | | GB MR and real fix in HC" into gingerbread * commit '084c3dc34ed9e6ae9ddc471819de0d6d55021dfd': (GB MR) bug:3144642 temporary small fix in GB MR and real fix in HC
| * am 26f86843: Merge "(GB MR) bug:3144642 temporary small fix in GB MR and ↵Vasu Nori2010-12-021-1/+2
| |\ | | | | | | | | | | | | | | | | | | real fix in HC" into gingerbread * commit '26f86843f48b3d7878837a1a9f93865b3eba0aee': (GB MR) bug:3144642 temporary small fix in GB MR and real fix in HC
| | * (GB MR) bug:3144642 temporary small fix in GB MR and real fix in HCVasu Nori2010-12-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Real fix is in Change-Id: Ifea1544737023008eff44aef9acd976902a0c143 In the database, sometimes _data column in downloads is set to null and sometimes to empty string. this is inconsistent and causes bugs such as bug:3144642. This bug is caused by line# 793 in DownloadThread. state.mFileName is null sometimes and empty string sometimes - because the correspodning field is set inconsistentlt in downloads.db _data column. in GB MR, apply a bandaid because real fix could be too risky for GB. Change-Id: I115b3ba6cfe0262269dbbc4c336b9e1d63c618e4
* | | am 5c29cce0: am e1823c84: Don\'t filter by UID for apps with ↵Kenny Root2010-12-011-1/+3
|\| | | | | | | | | | | | | | | | | | | | ACCESS_ALL_DOWNLOADS * commit '5c29cce0bac00a7a32cd92210825a789e140cf94': Don't filter by UID for apps with ACCESS_ALL_DOWNLOADS
| * | am e1823c84: Don\'t filter by UID for apps with ACCESS_ALL_DOWNLOADSKenny Root2010-12-011-1/+3
| |\| | | | | | | | | | | | | * commit 'e1823c84698006aa26a8c5dcfa5c4034858dfbe3': Don't filter by UID for apps with ACCESS_ALL_DOWNLOADS
| | * Don't filter by UID for apps with ACCESS_ALL_DOWNLOADSKenny Root2010-12-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Old platform behavior of DownloadProvider would allow anyone with special access to access all the downloads. New behavior is to return /my_downloads/ on an .insert() call. For things that aren't using the new API where DownloadInfo.getAllDownloadsUri() is accessible, make any application with ACCESS_ALL_DOWNLOADS permission bypass the calling UID check for /my_downloads/ Bug: 3242328 Change-Id: I536fde4525dd74066879f7c7da7fa609ff344645
* | | provider changes due to CL: Ief1693785f0484c1b434fb41a68693f9aff96492Vasu Nori2010-11-121-2/+6
| | | | | | | | | | | | Change-Id: I8940778292d0a9166cfcfb92d37ea568b8f6ceef
* | | when a download fails, store the error msg in dbVasu Nori2010-11-112-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | useful for debugging for bugs like bug:3187299 without this error message, one doesn't know WHY downloads fail. to prevent PII info in database, there is a STOPSHIP comment around storage of this error message in database. Change-Id: I612e383aef8483b68b772f70dff722a5daea2ef5
* | | if any exceptions encountered while trimming downloads db, ignore 'em.Vasu Nori2010-11-091-20/+33
| | | | | | | | | | | | | | | bug:3176990 Change-Id: I182331cbd63b6524a18d19e4d8567210886f8c16
* | | allow the column "scanned" from DownloadManager. bug:3169437Vasu Nori2010-11-051-0/+1
| | | | | | | | | | | | Change-Id: I96f0b51295611b67735c1b726bcd46bbeaa90613
* | | changes to support CL: I1f5dd734e394db0056579a3a0c26862fee27981eVasu Nori2010-11-042-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. if an application designates a downloaded file to be mediascanner scannable or not, store that fact in database. 2. use the above to determine whether a file shoudl be mediascanned or not in DownloadService 3. implement code to return mimetype for the new Uri "/public_downloads" introduced in CL: I1f5dd734e394db0056579a3a0c26862fee27981e Change-Id: I5c062ad6d1b58306044cee49ff3827e908d27fd9
* | | downloadmanager public API usage can cause non-scanning of media filesVasu Nori2010-11-031-1/+2
| | | | | | | | | | | | | | | bug:3162073 Change-Id: I13b80fedd7658c8574f33b43b74b5aa28a2895bc
* | | in DM public API, sending notifications on clicks should include dataVasu Nori2010-11-011-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | receiving application needs to know WHAT items the clicks occurred on - not just the fact that *something* was clicked on. this is duplicating the behavior as it exists today in the non-public API. depends on Change-Id: Ibe53ccd9934c73175459e42e3d417eee69ae6735 Change-Id: I924f85bd5faf443ac5648839b68390ec4de1f677
* | | make sure filename is non-null before delting it.Vasu Nori2010-10-292-26/+24
| | | | | | | | | | | | | | | | | | | | | if a download fails for some reason, then filename could be null. move Helpers.deleteFile() code into private method in DownloadService Change-Id: Ifb12a84b6185e19c70d62392e102950c07f56a01
* | | when using DM public API, allow duplicate downloads of same fileVasu Nori2010-10-281-10/+12
| | | | | | | | | | | | | | | | | | | | | bug:3132790 this mimics the behavior that exists today (in non-public API) Change-Id: I722b3bc23fe8c9b0bf66a088c5f6a3130be2129f
* | | Merge "reduce number of times mediascanner is invoked by downloadservice"Vasu Nori2010-10-271-13/+15
|\ \ \
| * | | reduce number of times mediascanner is invoked by downloadserviceVasu Nori2010-10-261-13/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this is one of the 2 bugs mentioned in bug:3129943 sometimes MediaProvider returns null for returned param Uri. in such cases, mark the file as 'scanned' in the downloads db so that it is NOT scanned again later by DownlaodService. depends on Change-Id: I92514e1a11f5119229c0c7292e410e352a9dbcdd Change-Id: Ie9d839581f656c929a77bd5f244ad6b2fb1585e6
* | | | allow run-time verbose debugging option on downloadmanager code.Vasu Nori2010-10-271-2/+2
|/ / / | | | | | | | | | | | | | | | otherwise, one has to recompile and reflash to get debug output Change-Id: I1d89d7cca3363fa793f74ba805136667e1ce3091
* | | remove usage of hidden public constants.Vasu Nori2010-10-206-11/+9
| | | | | | | | | | | | Change-Id: I2edf1bef5e741de8193cb293807e3ace42003b0c
* | | am 9f6654cf: Merge 216736d2 from gingerbreadJean-Baptiste Queru2010-10-182-54/+73
|\| | | | | | | | | | | | | | | | | | | | Merge commit '9f6654cfec6e6d8d1e3de9a8adeba46137a22105' * commit '9f6654cfec6e6d8d1e3de9a8adeba46137a22105': bug:3099994 NPE in DownloadManager when deleting non-media file
| * | Merge 216736d2 from gingerbreadJean-Baptiste Queru2010-10-152-54/+73
| |\| | | | | | | | | | Change-Id: I404d1a66d337b1dade181ade92dc21fc0e819aa7
| | * bug:3099994 NPE in DownloadManager when deleting non-media fileVasu Nori2010-10-152-54/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DownloadService always scans files and assumes MediaProvider returns a valid Uri. But MediaProvider returns null for return param 'uri' if the file is not audio/video/image etc media type file (for example, pdf) Change-Id: If32bd1895b00b5406973a5e240ad3558d46f9f4a
* | | am 3e759e21: am a53c21ed: fix broken build bug:3095237Vasu Nori2010-10-151-3/+1
|\| | | | | | | | | | | | | | | | | | | | Merge commit '3e759e21291d6ca1a49ded3f24f3be0a26af4e2b' * commit '3e759e21291d6ca1a49ded3f24f3be0a26af4e2b': fix broken build bug:3095237
| * | am a53c21ed: fix broken build bug:3095237Vasu Nori2010-10-131-3/+1
| |\| | | | | | | | | | | | | | | | | | | Merge commit 'a53c21edb5dc57d97dcddd03fbfa2022abf43787' into gingerbread-plus-aosp * commit 'a53c21edb5dc57d97dcddd03fbfa2022abf43787': fix broken build bug:3095237
| | * fix broken build bug:3095237Vasu Nori2010-10-131-3/+1
| | | | | | | | | | | | Change-Id: I7e1fe99cc482fc270894a820049275fc0c64233e
* | | am 57c4e918: am e00c3120: bug:3069735 in Download UI app, handle deletes ↵Vasu Nori2010-10-153-18/+139
|\| | | | | | | | | | | | | | | | | | | | | | | | | | correctly Merge commit '57c4e9180e3a339dba984f1c8dff76ef18443a7a' * commit '57c4e9180e3a339dba984f1c8dff76ef18443a7a': bug:3069735 in Download UI app, handle deletes correctly
| * | am e00c3120: bug:3069735 in Download UI app, handle deletes correctlyVasu Nori2010-10-133-18/+139
| |\| | | | | | | | | | | | | | | | | | | Merge commit 'e00c31208405bd2e4c88e069df7a2b15237f70bf' into gingerbread-plus-aosp * commit 'e00c31208405bd2e4c88e069df7a2b15237f70bf': bug:3069735 in Download UI app, handle deletes correctly
| | * bug:3069735 in Download UI app, handle deletes correctlyVasu Nori2010-10-133-18/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gingerbread. High-level details 1. When a file is downloaded by DownloadManager, metadata about the file is stored in 2 databases: DownloadProvider and MediaProvider. 2. So, when it is to be deleted, its metadata needs to be cleaned up from both the databases. 3. But the 2 databases use differnt content-uri's as "primary keys" and DownloadProvider loses the "primary-key" of the row in MediaProvider database. 4. Easiest thing would have been to have DownloadProvider give filepath to MediaProvider and let MediaProvider linearly scan its database to locate the row and delete it. 5. The other - faster but more coding for now - option is to have DownloadProvider store the "primary-key" of the MediaProvider's row. implemented in this CL. Low-level details 1. add 2 new columns to downloads table in downloads.db: mediaprovider_uri = downloaded file's content_uri in mediaprovider db this column is null for downloads that finished before this column is added to the database. deleted = flag is set to true if a file is to be deleted 2. download UI app shows only those files whose 'deleted' flag is not set. 3. when the user deletes downloads from download UI app, 3.1. if mediaprovider_uri is NOT null, then the row is deleted from downloads table AND from the mediaprovider database. 3.2 if mediaprovider_uri is NULL, then its row in downloads database is marked 'tp be deleted' by setting 'deleted' column to '1'. 4. When DownloadService (in DownloadProvider) processes all rows from downloads table, if it sees any rows wth 'deleted' = 1, then it uses MediaScanner Service to re-scan the file, get the mediaprovider_uri from MediaProvider and update the row in downloads table with this mediaprovider_uri value and then delete the row by doing the following 1. delete it from MediaProvider database using mediaprovider_uri 2. delete it from DownloadProvider database Problem with this solution: There is a small window where it is deleted by the user on the Download app (and the row disappears from the display) but it is still present in Gallery app. Thats due to the following asynchronous operations 1. DownladService which processes rows-to-be-deleted is not always up 2. DownloadService uses asynchronous call to have the file re-scanned by MediaScanner to get mediaprovider_uri Change-Id: Ib90eb9e647f543312c865d3bbf9a06fb867a648b
* | | am 1f262cf3: am cd990514: Merge "Make DownloadProvider use parameterized ↵Steve Howard2010-10-101-39/+57
|\| | | | | | | | | | | | | | | | | | | | | | | | | | queries." into gingerbread Merge commit '1f262cf3af0512e0d621b7818aab9bb79527f01f' * commit '1f262cf3af0512e0d621b7818aab9bb79527f01f': Make DownloadProvider use parameterized queries.
| * | am cd990514: Merge "Make DownloadProvider use parameterized queries." into ↵Steve Howard2010-10-081-39/+57
| |\| | | | | | | | | | | | | | | | | | | | | | | | | gingerbread Merge commit 'cd990514feb2b17848809d9262e0d73a828b2142' into gingerbread-plus-aosp * commit 'cd990514feb2b17848809d9262e0d73a828b2142': Make DownloadProvider use parameterized queries.
| | * Make DownloadProvider use parameterized queries.Steve Howard2010-10-081-39/+57
| | | | | | | | | | | | | | | | | | | | | | | | This avoids filling up the query cache unnecessary, but required some structural changes to ease the passing around of a selection along with its arguments. Change-Id: I724185763b94146d17573cab68f675c24e49634e
* | | am ace1d5da: am d4dc8501: Merge "Seriously improve error reporting in ↵Steve Howard2010-10-014-198/+164
|\| | | | | | | | | | | | | | | | | | | | | | | | | | DownloadThread." into gingerbread Merge commit 'ace1d5da2b288f6166224cf2164731ae0fa2de61' * commit 'ace1d5da2b288f6166224cf2164731ae0fa2de61': Seriously improve error reporting in DownloadThread.
| * | am d4dc8501: Merge "Seriously improve error reporting in DownloadThread." ↵Steve Howard2010-10-014-198/+164
| |\| | | | | | | | | | | | | | | | | | | | | | | | | into gingerbread Merge commit 'd4dc8501ecb89b91f865510207297dd960afe031' into gingerbread-plus-aosp * commit 'd4dc8501ecb89b91f865510207297dd960afe031': Seriously improve error reporting in DownloadThread.
| | * Merge "Seriously improve error reporting in DownloadThread." into gingerbreadSteve Howard2010-10-014-198/+164
| | |\
| | | * Seriously improve error reporting in DownloadThread.Steve Howard2010-09-304-198/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | My old error reporting strategy for DownloadThread was to log the stack trace for the exception, so we'd know exactly what conditions caused the StopRequest. hackbod suggested that we shouldn't log tracebacks as they clutter the log. Instead, we should just always include a little string tag explaining why the request is being stopped -- this is more concise and more useful to developers. There are three main changes here to acheive this goal: * make StopRequest require a short, log-friendly error message upon construction, and add such a message to all construction sites * make a similar change to GenerateSaveFileError, so that the variety of errors that originate with Helpers.generateSaveFile() get similarly fine-grained and concise error reporting * make network usable checking code return a distinct error code for each distinct negative condition, and add a utility to return a log-friendly error message for each such code. Finally, I cleaned up some of the ways errors/exceptions are handled in the process. Change-Id: Ie70cbf3f2960e260e97f8449258e25218d0f900f
* | | | am 42469fa4: am 5d81e244: Avoid NPE when checking file URI in DownloadProviderSteve Howard2010-10-011-1/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Merge commit '42469fa405c7aa891e7c431cd65edd424803979c' * commit '42469fa405c7aa891e7c431cd65edd424803979c': Avoid NPE when checking file URI in DownloadProvider
| * | | am 5d81e244: Avoid NPE when checking file URI in DownloadProviderSteve Howard2010-10-011-1/+2
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | Merge commit '5d81e2447ed77860afecd71583e137178c2c6807' into gingerbread-plus-aosp * commit '5d81e2447ed77860afecd71583e137178c2c6807': Avoid NPE when checking file URI in DownloadProvider
| | * | Avoid NPE when checking file URI in DownloadProviderSteve Howard2010-09-301-1/+2
| | |/ | | | | | | | | | Change-Id: Ic937b05308cecce244725e25767a3a1310a8463d
* | | am ed2f1150: resolved conflicts for merge of b108a273 to gingerbread-plus-aospSteve Howard2010-09-304-96/+58
|\| | | | | | | | | | | | | | | | | | | | Merge commit 'ed2f11502fb02509d9efec1dbda7981c86f37fbd' * commit 'ed2f11502fb02509d9efec1dbda7981c86f37fbd': Improve how the download manager reports paused statuses.
| * | resolved conflicts for merge of b108a273 to gingerbread-plus-aospSteve Howard2010-09-304-96/+58
| |\| | | | | | | | | | Change-Id: Iced3a5360702fdeb299f8b987a353d3aeca7629b
| | * Improve how the download manager reports paused statuses.Steve Howard2010-09-294-96/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes the download manager report more detail when a download is paused. Rather than always reporting status RUNNING_PAUSED, there are now four different statuses: * paused by the app * waiting to retry after a network error * waiting for network connectivity * queued for wifi due to size limits This allows a few improvements: * code deciding when to run a download can be improved and cleaned up (I've taken some extra steps in cleaning up this particular code) * notification code no longer has to rely on the in-memory-only "mPausedReason" member of DownloadInfo; instead, it knows from the status that the download is queued for wifi, and can display the appropriate string. This moves the string fetching out into the UI-specific logic and is a sign that this is really the right way to do things. And finally, the real motivation for this change: I've changed the meaning of "Queued" in the downloads UI so it now means "Queued for WiFi'. This is what was originally intended, I'd misunderstood. What was formerly known as "Queued", a download that hadn't started, is now displayed as "In progress" (it's always a transient state so it's basically meaningless anyway). Otherwise it remains the same (in particular, downloads paused for other reasons are still reported as "In progress"). I've also increased some of the logging in DownloadThread a bit, as this change initally introduced some bugs that were impossible to track down without that logging. There have been other bug reports that were impossible to diagnose and these few extra log statements should really help, without cluttering logs too much. I've taken care to avoid potentially introducing any PII into the logs. Change-Id: Id0b8d65fc8e4406ad7ffa1439ffc22a0281b051f
* | | am fce7a5e8: am d01ccf8e: Merge "Trim the database & check spurious files ↵Brad Fitzpatrick2010-09-281-2/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | off the UI thread." into gingerbread Merge commit 'fce7a5e8547d4ea53700f37b87752e26a39e4cc4' * commit 'fce7a5e8547d4ea53700f37b87752e26a39e4cc4': Trim the database & check spurious files off the UI thread.
| * | am d01ccf8e: Merge "Trim the database & check spurious files off the UI ↵Brad Fitzpatrick2010-09-281-2/+3
| |\| | | | | | | | | | | | | | | | | | | | | | | | | thread." into gingerbread Merge commit 'd01ccf8ef98aba424a49c44ed6db39435c6d6d77' into gingerbread-plus-aosp * commit 'd01ccf8ef98aba424a49c44ed6db39435c6d6d77': Trim the database & check spurious files off the UI thread.
| | * Merge "Trim the database & check spurious files off the UI thread." into ↵Brad Fitzpatrick2010-09-281-2/+3
| | |\ | | | | | | | | | | | | gingerbread
| | | * Trim the database & check spurious files off the UI thread.Brad Fitzpatrick2010-09-281-2/+3
| | | | | | | | | | | | | | | | Change-Id: I92180fc4344579b93361d5584243688a1cfdd091
| * | | am 14961f94: Moved DownloadManager to android.app (DO NOT MERGE)Steve Howard2010-09-282-2/+2
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | Merge commit '14961f94d762e733a733e3268fca1074d8da5f8c' into gingerbread-plus-aosp * commit '14961f94d762e733a733e3268fca1074d8da5f8c': Moved DownloadManager to android.app (DO NOT MERGE)