Rewrite of download notifications.

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
Import translations. DO NOT MERGE

Change-Id: I6ca8a2ceef5a5ad54a9cff1b4194669762d637cf
Auto-generated-cl: translation import
Show remaining time in download notifications.

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
Merge "Show remaining time in download notifications." into jb-mr1.1-dev
Import translations. DO NOT MERGE

Change-Id: I79fc66232d0405d1a631ff00ae21579baa4d6a3f
Auto-generated-cl: translation import
Import translations. DO NOT MERGE

Change-Id: I5fe1cabbe3d55843bb3155efb5c0c00a511b04fd
Auto-generated-cl: translation import
Import translations. DO NOT MERGE

Change-Id: I8aa3828fb38dc088148dbe588735364ccb09bee5
Auto-generated-cl: translation import
Import translations. DO NOT MERGE

Change-Id: Ib11120e47f29151b4281f86db6dbeaecf4e060d5
Auto-generated-cl: translation import
Update extras for in-progress download.

Follow move to EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS extras, which
was missing during refactoring.

Bug: 7617373
Change-Id: I26203a2bc6fc0e211a1aa602c0de018332d76f60
Merge "Update extras for in-progress download." into jb-mr1.1-dev
Improve download remaining time calculation.

Calculate remaining time in DownloadNotifier so we always use the
most recent progress data, which avoids showing stale times.

Weight speed calculation to prefer historical data so remaining time
is smoother on bumpy network connections.

Bug: 7631948
Change-Id: I497be0899e65086356745340b19d3987c6185bdd
Merge "Improve download remaining time calculation." into jb-mr1.1-dev
Import translations. DO NOT MERGE

Change-Id: I195b9b502336dad204ce6b4e9a1a74cc9f9f398f
Auto-generated-cl: translation import
Import translations. DO NOT MERGE

Change-Id: Ia4dc102097a8c6085e20d7fc7e2e10adc475f872
Auto-generated-cl: translation import
Import translations. DO NOT MERGE

Change-Id: I6882b2a17c13803e66b1afc8e0bc02dd3d4bf049
Auto-generated-cl: translation import
Import translations. DO NOT MERGE

Change-Id: Icadeb210d13e600f85b1a1d21aaaa79e26d78240
Auto-generated-cl: translation import
Cancel stale notifications when starting.

Bug: 7693834
Change-Id: I5e212be321cccae0f7c76f80049c4e09f0867694
Merge tag 'android-4.2.2_r1' into jellybean

Android 4.2.2 release 1