diff options
| author | Ali B <abittin@gmail.com> | 2014-08-28 11:08:39 -0700 |
|---|---|---|
| committer | eyosen <abittin@gmail.com> | 2014-09-07 13:42:14 +0300 |
| commit | 40c2138bd0a22638a4e654615bb66aed2919ffb9 (patch) | |
| tree | 9de98d78dd6b38529daca598bb5b08bda21bf1f0 | |
| parent | ac4bdda6a8b3ceda51ccbdc1b3991865f257eb19 (diff) | |
Add Paused state iconkitkat
also Modify error state icon
Original commit by Adnan@CM
Adapted and modified to AICP code
PS2: Add missing function
PS3: Cleanup
Change-Id: I5488e096712d7fba35506c58000805ca1921ba48
| -rw-r--r-- | res/drawable-hdpi/download_pause.png | bin | 0 -> 1114 bytes | |||
| -rw-r--r-- | res/drawable-hdpi/ic_stat_download_error.png | bin | 0 -> 735 bytes | |||
| -rw-r--r-- | res/drawable-mdpi/download_pause.png | bin | 0 -> 1107 bytes | |||
| -rw-r--r-- | res/drawable-mdpi/ic_stat_download_error.png | bin | 0 -> 501 bytes | |||
| -rw-r--r-- | res/drawable-xhdpi/download_pause.png | bin | 0 -> 1181 bytes | |||
| -rw-r--r-- | res/drawable-xhdpi/ic_stat_download_error.png | bin | 0 -> 955 bytes | |||
| -rw-r--r-- | src/com/android/providers/downloads/DownloadNotifier.java | 24 |
7 files changed, 20 insertions, 4 deletions
diff --git a/res/drawable-hdpi/download_pause.png b/res/drawable-hdpi/download_pause.png Binary files differnew file mode 100644 index 00000000..6b435bb0 --- /dev/null +++ b/res/drawable-hdpi/download_pause.png diff --git a/res/drawable-hdpi/ic_stat_download_error.png b/res/drawable-hdpi/ic_stat_download_error.png Binary files differnew file mode 100644 index 00000000..57766240 --- /dev/null +++ b/res/drawable-hdpi/ic_stat_download_error.png diff --git a/res/drawable-mdpi/download_pause.png b/res/drawable-mdpi/download_pause.png Binary files differnew file mode 100644 index 00000000..a5aee6f2 --- /dev/null +++ b/res/drawable-mdpi/download_pause.png diff --git a/res/drawable-mdpi/ic_stat_download_error.png b/res/drawable-mdpi/ic_stat_download_error.png Binary files differnew file mode 100644 index 00000000..652e8b0a --- /dev/null +++ b/res/drawable-mdpi/ic_stat_download_error.png diff --git a/res/drawable-xhdpi/download_pause.png b/res/drawable-xhdpi/download_pause.png Binary files differnew file mode 100644 index 00000000..333c1b24 --- /dev/null +++ b/res/drawable-xhdpi/download_pause.png diff --git a/res/drawable-xhdpi/ic_stat_download_error.png b/res/drawable-xhdpi/ic_stat_download_error.png Binary files differnew file mode 100644 index 00000000..8388dd54 --- /dev/null +++ b/res/drawable-xhdpi/ic_stat_download_error.png diff --git a/src/com/android/providers/downloads/DownloadNotifier.java b/src/com/android/providers/downloads/DownloadNotifier.java index d4b69c3f..eadd45d3 100644 --- a/src/com/android/providers/downloads/DownloadNotifier.java +++ b/src/com/android/providers/downloads/DownloadNotifier.java @@ -177,10 +177,22 @@ public class DownloadNotifier { } } + // Check paused status about these downloads. If exists, will + // update icon and content title/content text in notification. + boolean hasPausedStatus = false; + for (DownloadInfo info : cluster) { + if (isPausedStatus(info.mStatus)) { + hasPausedStatus = true; + break; + } + } + // Show relevant icon if (type == TYPE_ACTIVE) { - if (hasErrorStatus) { - builder.setSmallIcon(android.R.drawable.stat_sys_warning); + if (hasPausedStatus) { + builder.setSmallIcon(R.drawable.download_pause); + } else if (hasErrorStatus) { + builder.setSmallIcon(R.drawable.ic_stat_download_error); } else { builder.setSmallIcon(android.R.drawable.stat_sys_download); } @@ -610,8 +622,12 @@ public class DownloadNotifier { || Downloads.Impl.isStatusClientError(status) || Downloads.Impl.isStatusServerError(status) || status == Downloads.Impl.STATUS_INSUFFICIENT_SPACE_ERROR - || status == Downloads.Impl.STATUS_DEVICE_NOT_FOUND_ERROR - || status == Downloads.Impl.STATUS_WAITING_FOR_NETWORK; + || status == Downloads.Impl.STATUS_DEVICE_NOT_FOUND_ERROR; return isErrorStatus; } + + private static boolean isPausedStatus(int status) { + return status == Downloads.Impl.STATUS_WAITING_FOR_NETWORK || + status == Downloads.Impl.STATUS_PAUSED_BY_MANUAL; + } } |
