summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Show remaining time in download notifications.Jeff Sharkey2012-11-144-16/+82
| | | | | | | | | | Calculate speed of in-progress downloads and estimate time remaining until completion. Uses a moving average that is weighted 1:1 with the most recent 500ms sample. Funnels timing data to notifications through DownloadHandler. Bug: 6777872 Change-Id: I9155f2979aa330bd1172f63bbfca1d053815cee5
* Rewrite of download notifications.Jeff Sharkey2012-11-095-396/+426
| | | | | | | | | | | | | | | | | | Switch to using new inbox-style notifications when collapsing multiple downloads. Correctly handles clustering, including cancellation of stale notifications. All notifications are now handled in a single class, making it easier to reason about correctness. Fixed bugs around handling of visibility flags. Move away from using "int" as internal keys, since they can overflow. Started work for time estimates, will finish in a future CL. Explicitly pass all relevant IDs to DownloadReceiver instead of doing a second racy query. Fix StrictMode warnings when querying in DownloadReceiver. Bug: 6777872, 5463678, 6663547, 6967346, 6634261, 5608365 Change-Id: I5eb47b73b90b6250acec2ce5bf8d7a274ed9d3a9
* Better sanity checking for finished downloads.Jeff Sharkey2012-10-242-2/+35
| | | | | | | | | | | | | | | Downloads in the RUNNING state are considered ready to start so that downloads are correctly resumed when the process crashes. However, this causes a race condition while UpdateThread is processing a Cursor when a DownloadThread finishes. With this change, DownloadThread now skips requests for downloads already marked as finished. Apps listening for the DOWNLOAD_COMPLETE broadcast will no longer see data mutated by the second thread, and will not see the broadcast duplicated. Bug: 6948938, 6970458, 6818900 Change-Id: I35deac3cedbfe7f50091fab5818d85594dba558c
* Bring back DRM mimetypes.Jeff Sharkey2012-10-191-1/+4
| | | | | | | I don't like DRM, but other people do. Bug: 7370549 Change-Id: I44220404eab6e6cc85ea16cfcf58474135c03f83
* Skip scanning a file which will be deleted.Jeff Sharkey2012-10-051-3/+0
| | | | | | | | | When deleting a download, don't bother scanning it, since we'll just delete it moments later. This was already racy since it didn't even wait for the scan to complete. Bug: 7256243 Change-Id: I8c3b96823d94bc1688ef336cb45746ccd35fc760
* Handle not fully connected networks.Jeff Sharkey2012-10-031-1/+1
| | | | | | | | | When checking network status, treat non-connected networks as disconnected. This handles cases like captive portal checks, and slow DHCP servers. Bug: 7264340 Change-Id: I0b466cee5d5cb73037f3fb209c583711b8f9eefd
* Merge "Remove FLAG_ACTIVITY_NEW_TASK from the VIEW intent." into jb-mr1-devRuben Brunk2012-09-282-1/+2
|\
| * Remove FLAG_ACTIVITY_NEW_TASK from the VIEW intent.Ruben Brunk2012-09-262-1/+2
| | | | | | | | | | | | | | | | | | Bug: 7164238 Bug: 7237908 Got rid of FLAG_ACTIVITY_NEW_TASK for proper back behavior Change-Id: I50af9aeafb27d6079bda4f81f4a116b6bb600676
* | Send uid of the application that initiated the downloadBen Gruver2012-09-271-0/+17
|/ | | | | Bug: 6923241 Change-Id: Idf4037b4e360cb6453b315d1cc95608762c9e0c8
* Send ORIGINATING_URI and REFERRER to installer.Jeff Sharkey2012-08-272-17/+110
| | | | | | | | | When building PackageInstaller intents, include ORIGINATING_URI and REFERRER extras. Unify view intent building for both notifications and list UI. Bug: 6900672 Change-Id: I18435e0f8aa549880ec594f82b6a250232706135
* am d7dd6019: Merge "Adds missing Bluetooth as network type."Jean-Baptiste Queru2012-08-081-0/+3
|\ | | | | | | | | * commit 'd7dd6019baf12961dce722d33003e238cdd72f6a': Adds missing Bluetooth as network type.
| * Adds missing Bluetooth as network type.Håkan3 Johansson2012-07-101-0/+3
| | | | | | | | | | | | | | | | The network connection type for Bluetooth is added so that it is possible to use Bluetooth as Hotspot during download from the Internet. Change-Id: Ic32b083068d8316a41f2c31a3575a28163f6c7f3
* | Move notification tests to LittleMock.Jeff Sharkey2012-07-245-55/+50
| | | | | | | | | | | | Directly mock NotificationManager instead of using SystemFacade. Change-Id: If932d26e23816e8674469c275a828701cce5fc2d
* | Reduce deletion logging.Jeff Sharkey2012-07-203-14/+23
|/ | | | | Bug: 6544953 Change-Id: I4157c67b9b9cddab4ade795c328a202f6a230f95
* am f918429d: Uniform "when" to avoid flashing notifications.Jeff Sharkey2012-06-071-1/+16
|\ | | | | | | | | * commit 'f918429d0c1927a19d688baa26a07c2c65765580': Uniform "when" to avoid flashing notifications.
| * Uniform "when" to avoid flashing notifications.Jeff Sharkey2012-06-071-1/+16
| | | | | | | | | | | | | | | | | | | | | | When showing a download, remember the first timestamp when we showed a notification, and use that time as "when" for all future updates to avoid flashing. Also bring back icon animation that had regressed. Bug: 6596416, 6237256 Change-Id: Ifdc5dc6870dac047515151c1b088e6e379b6a063
* | am 0acd13fe: Merge "avoid repetition of retrying download"Jean-Baptiste Queru2012-05-211-5/+2
|\ \ | |/ |/| | | | | * commit '0acd13fed2f4d0857ce89565fe94674c09b1e844': avoid repetition of retrying download
| * Merge "avoid repetition of retrying download"Jean-Baptiste Queru2012-05-211-5/+2
| |\
| | * avoid repetition of retrying downloadHideki Hayami2012-02-141-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If isReadyToStart returns 'true' for STATUS_INSUFFICIENT_SPACE_ERROR, DownloadProvider retries downloading after it gets requests from browser to download contents. The retrying loop won't stop until its completion (recovering from space error), or user stops downloading. This retry loop impacts to network traffic, battery consumption and packet charge. So, change this method to return 'false' for the error in order to stop the loop. Change-Id: Ia3466db60d86c5900842c7c28d294898ae3ff2bc
* | | Only delete spurious files belonging to us.Jeff Sharkey2012-04-242-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | When multiple users are active, this can accidentally delete files belonging to other users. Checking owner also helps us avoid deleting recover and lost+found. Bug: 6362988 Change-Id: Ifc165acc9a9b3ab253a4b6257f370836b98b3a74
* | | Avoid NPE when _DATA column is empty.Jeff Sharkey2012-04-201-1/+5
| | | | | | | | | | | | | | | Bug: 6371718 Change-Id: Id661210101b01daf8f5d46a318c32dbb9de9a4fb
* | | More slogging around download deletion.Jeff Sharkey2012-04-193-3/+16
| | | | | | | | | | | | | | | Bug: 6362988 Change-Id: Iab4b86cfcaa6aeed6466f88ff49eb935f96db495
* | | Report MIME type for individual downloads.Jeff Sharkey2012-04-191-5/+8
| | | | | | | | | | | | | | | Bug: 6358473 Change-Id: Ied4a6c8194d0cbb735e43cf7d7759f4674efe535
* | | Add and enforce ALLOW_METERED column.Jeff Sharkey2012-04-175-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Include flag with each download to indicate if its allowed to proceed over metered networks. Downloads are left in WAITING_FOR_NETWORK state, similar to how ALLOWED_NETWORK_TYPES is handled. Also keep blocked downloads in WAITING_FOR_NETWORK state instead of marking them as failed. Bug: 3001465, 5734560 Change-Id: I80bb9aa9bd25ddf6f7a2472db344b6ba6878bd74
* | | View file downloads through DownloadsProvider.Jeff Sharkey2012-04-171-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | When viewing file://-style downloads, open through DownloadsProvider so that FLAG_GRANT_READ_URI_PERMISSION works. Add support for OpenableColumns to support external apps probing for metadata. Bug: 6343461 Change-Id: I630405406321ea1871c62cbcded55a4ee024ef6e
* | | Locking around downloads, and more dump info.Jeff Sharkey2012-04-132-114/+143
| | | | | | | | | | | | | | | Bug: 4997552 Change-Id: I3c612acb5145a7638c9345a376a99958851a0891
* | | Give DownloadManager a useful user agent.Jeff Sharkey2012-04-092-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | Include platform version, model, and build, when available. Matches current logic used by Browser. Bug: 6257336 Change-Id: I0addfd944aff13bd4ce4226bb8d6328da6b0f5d5
* | | Move to new NetworkPolicyManager accessor.Jeff Sharkey2012-04-051-1/+1
| | | | | | | | | | | | Change-Id: I21e5f6280748529bad881942f8f5534aa374ba55
* | | Migrate to shared MockWebServer.Jeff Sharkey2012-03-291-1/+0
| | | | | | | | | | | | | | | Bug: 4726601 Change-Id: Ibe537bd5c2a092dbf974360cd454751881f7f4ea
* | | Match INetworkPolicyListener changes.Jeff Sharkey2012-02-071-8/+7
| | | | | | | | | | | | Change-Id: I78b6b0380a42b28f42334f93e0538ba7f32bc66d
* | | Move away from deprecated NetworkInfo extra.Jeff Sharkey2012-01-301-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Because the NetworkInfo included in CONNECTIVITY_ACTION broadcast extra does not reflect the state applicable to the calling UID, and the last sticky broadcast may have stale state, transition to calling ConnectivityManager.getActiveNetworkInfo() directly. Change-Id: Ie7a143e621e5a3a013ec6d8b8613709e7787dc0c
* | | Update DownloadProvider for new Intent.normalizeMimeType() API.Nick Pelly2012-01-191-23/+3
| | | | | | | | | | | | Change-Id: Ideeb8cbeaa4b4d82d7c9fc8197a35bf3541a22d7
* | | am 380044a2: am f720bc68: Allow downloads when no network restriction set.Jeff Sharkey2012-01-061-2/+3
|\| | | | | | | | | | | | | | * commit '380044a236ffba16a800cb683fa648860dcfd573': Allow downloads when no network restriction set.
| * | Allow downloads when no network restriction set.Jeff Sharkey2012-01-051-2/+3
| |/ | | | | | | | | | | | | | | | | Fixes bug where DownloadManager would block downloads on WiMAX, bluetooth, and ethernet networks, even when no network restrictions had been set. Bug: 5689335 Change-Id: I6d1bb78cbccb3c5eb1fce40a13b0689be0c3fa13
* / Use UID instead of PID.Jeff Sharkey2011-11-111-1/+1
|/ | | | | Bug: 5606426 Change-Id: I9b9cee142c360da2a30a4bb8be8dcf40b8c7e43e
* Merge remote branch 'goog/ics-mr0' into ics-mr1Ed Heyl2011-10-251-7/+7
|\
| * Merge "Sanity check only after updating from file size." into ics-mr0Jeff Sharkey2011-10-251-7/+7
| |\
| | * Sanity check only after updating from file size.Jeff Sharkey2011-10-241-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Database values can be stale, so delay sanity check until after updating from file size on disk. Bug: 5484249 Change-Id: Ia648a575d4a3a391a1f06a866c8282f2d569f15e
* | | am 3074179d: Merge "add more logging when download manager deletes files" ↵Doug Zongker2011-10-181-6/+6
|\| | | | | | | | | | | | | | | | | | | | into ics-mr0 * commit '3074179d22e9d7e1f506b85dca866301a6206156': add more logging when download manager deletes files
| * | Merge "add more logging when download manager deletes files" into ics-mr0Doug Zongker2011-10-181-6/+6
| |\ \
| | * | add more logging when download manager deletes filesDoug Zongker2011-10-181-6/+6
| | |/ | | | | | | | | | Change-Id: I4d402e28996887fc1dba89b2764575c91c2c523b
| * / log when DownloadManager deletes filesDoug Zongker2011-10-181-0/+1
| |/ | | | | | | Change-Id: I39bcb3c7c4625659b0e8b0f3e2971beabb017b48
* | am c5c30ba1: NPE check before finalizeDestinationFile().Jeff Sharkey2011-10-171-3/+5
|\| | | | | | | | | * commit 'c5c30ba14d411b3e23c983912e7fea4f449c9f54': NPE check before finalizeDestinationFile().
| * NPE check before finalizeDestinationFile().Jeff Sharkey2011-10-141-3/+5
| | | | | | | | | | Bug: 5461417 Change-Id: I16f1e8594162b006b80bf7f2cdc6630d0dedfa38
* | Merge "Check canonical path when download requested."Jeff Sharkey2011-10-121-4/+10
|\ \
| * | Check canonical path when download requested.Jeff Sharkey2011-10-121-4/+10
| |/ | | | | | | | | Bug: 5449870 Change-Id: I3219273be9b796b123545c811e5f39fa83b5768e
* / log when DownloadManager deletes filesDoug Zongker2011-10-111-0/+1
|/ | | | Change-Id: Id4800401c16811df9c4ee78ee9636c77b4c95756
* Don't change extensions for explicitly set download locations.Jeff Davidson2011-08-301-8/+18
| | | | | | | | | | | | | | This regression from GB was introduced by 38f1711910715538d6b64e505fe8fb9a0cd40475, which was intended to allow duplicate downloads of the same file, adding -<n> to the end of file names. As a side effect, this also activated extension validation logic, which adds/changes an extension to match the Mimetype. This change keeps the unique filename logic but prevents extension changes when an explicit filename is set. Thus, it is still possible for the actual download location to differ from the requested one, but only if the file already exists. Bug: 5196436 Change-Id: I198dc2a819c5d839a05b72c25e0830d889a9c5a3
* fix DownloadThread's use of ETag, range headersDoug Zongker2011-08-291-46/+54
| | | | | | | | | | | | | | | | | | DownloadThread was only maintaining ETag and the file size for the duration of one HTTP request, rather than over all the requests needed to fetch a file, which kind of defeats the point of having them. Fix this by moving several state variables from InnerState to State, and initializing the total bytes and current bytes values from the download database. Skip actually making the HTTP request if we've already downloaded all the bytes of the file. This works around bug 5217390 by making the second DownloadThread do nothing instead of trying to fetch past the end of the file. (A real fix would eliminate the race condition that causes the second thread to get created in the first place.) Bug: 5217390 Change-Id: Ib5b8f87398b4ed2cb3d7f09569e245b55a89da5a
* Move to Notification.Builder progress API.Jeff Sharkey2011-08-091-47/+33
| | | | | | | | Instead of using custom layout to surface progress information, use new Builder API. Also use resources to build percent string. Bug: 4022082 Change-Id: I556a666771e9103ce5d7ddb60faa879b8777b284