summaryrefslogtreecommitdiffstats
path: root/src/com
Commit message (Collapse)AuthorAgeFilesLines
* 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)
| | * | Moved DownloadManager to android.app (DO NOT MERGE)Steve Howard2010-09-272-2/+2
| | |/ | | | | | | | | | | | | | | | | | | I'll merge this manually, as there's some additional master-only code that will be to be simultaneously changed. Change-Id: Ifdb1740f32e228bc07f266585737b98a7b794685
* | | Manual merge: Moved DownloadManager to android.appSteve Howard2010-09-282-2/+2
| | | | | | | | | | | | Change-Id: Id1de44459ec1bf53e928cae826047467b355823d
* | | am 04d70252: am 36f06f4c: Merge "DB migration to eliminate some null fields ↵Steve Howard2010-09-231-1/+28
|\| | | | | | | | | | | | | | | | | | | | | | | | | | in old downloads" into gingerbread Merge commit '04d7025262d7f6c5c372ec699d78b18d05b0400b' * commit '04d7025262d7f6c5c372ec699d78b18d05b0400b': DB migration to eliminate some null fields in old downloads
| * | am 36f06f4c: Merge "DB migration to eliminate some null fields in old ↵Steve Howard2010-09-231-1/+28
| |\| | | | | | | | | | | | | | | | | | | | | | | | | downloads" into gingerbread Merge commit '36f06f4c8497ab47e64bcc5d8cea12a109fede5e' into gingerbread-plus-aosp * commit '36f06f4c8497ab47e64bcc5d8cea12a109fede5e': DB migration to eliminate some null fields in old downloads
| | * Merge "DB migration to eliminate some null fields in old downloads" into ↵Steve Howard2010-09-231-1/+28
| | |\ | | | | | | | | | | | | gingerbread
| | | * DB migration to eliminate some null fields in old downloadsSteve Howard2010-09-221-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DownloadProvider now ensures that current bytes, total bytes, title and description are never null in the DB. Some new code relies on this assumption for simplicity. That means we need to ensure this invariant is true for pre-existing downloads as well. Change-Id: Iea2289516d2636edf3394678ab08aa9cea31dc69
* | | | am 5dbaa73a: am ebb555c0: Support multi-valued HTTP headers, handle new API ↵Steve Howard2010-09-232-15/+17
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | changes Merge commit '5dbaa73a7f356f67810becbf3ad258a7dd765e59' * commit '5dbaa73a7f356f67810becbf3ad258a7dd765e59': Support multi-valued HTTP headers, handle new API changes
| * | | am ebb555c0: Support multi-valued HTTP headers, handle new API changesSteve Howard2010-09-232-15/+17
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | Merge commit 'ebb555c0687061993dd6a22d15f6aab2437ee8c5' into gingerbread-plus-aosp * commit 'ebb555c0687061993dd6a22d15f6aab2437ee8c5': Support multi-valued HTTP headers, handle new API changes
| | * | Support multi-valued HTTP headers, handle new API changesSteve Howard2010-09-222-15/+17
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | * backend support for multiple values for the same HTTP headers, for corresponding API changes * other minor changes in response to DownloadManager API changes Change-Id: I7c595e94a60ed7afaca6cc3fb4c05aaeeff20c2a
* | | am 7b96b251: am d3197296: Implement dialogs for wifi required + recommended ↵Steve Howard2010-09-216-25/+240
|\| | | | | | | | | | | | | | | | | | | | | | | | | | limits. Merge commit '7b96b251c0404ed3f05652bd7d5209910fb999cc' * commit '7b96b251c0404ed3f05652bd7d5209910fb999cc': Implement dialogs for wifi required + recommended limits.