DownloadProvider: fix the crash when rotate screen.

TrampolineActivity will be recreated when rotate screen,
then the fragment is currently associated with any Activity.
So getActivity() will return a null and caused NullPointerException.

Add the null check before call finish().

CRs-Fixed: 640914

Change-Id: I76f368a597552e824d533b6a66ea23fad4c0cb41
DownloadProvider: add to support download into sdcard storage

When insert into downloads database to start a new download,
will check file uri destination is valid or not, currently it
only support phone storage downloading, what we do is to add
supporting sdcard storage downloading, this will make download
save path setting feature work well.

Change-Id: I7995ae63ec5769103d7ad66bcd677e383ef7f440
DownloadProvider: Still display as downloading after download failed

When the remaining space is less than 10% of the total space,
download will fail, but it still display as downloading in status bar
after failed in "Downloads" app.

Check error status about downloads. If error exists, will update icon
, content title and content text in notification.

CRs-Fixed: 636489

Change-Id: I5554ef3d1505642c5cd847bd3d2e25a29772dc0d
DownloadProvider: Create and implement DialogDismissListener.

  - Better way to dismiss a host activity then explicitly calling
  getActivity() finish().

Change-Id: I121fb63d2d57c6c4b22abac2389d5c3d5ccad6e4
DownloadProvider: Check if the device actually supports second storage.

Change-Id: I78297ca235e058aecfd0ff5a0e990fc3004b4c77
DownloadProvider: Use an alert icon for downloads that have an error status.

Change-Id: If6d0f021cada1a09855009ab3276aa46bec74cfe
Automatic translation import

Change-Id: Icc93454edf18c58289062b577da376c3b7884bc9
Automatic translation import

Change-Id: I691e62b9ace9c1b69911d046ee90d942bada3704
Merge branch 'cm-11.0' of https://github.com/CyanogenMod/android_packages_providers_DownloadProvider into android-4.4