summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLixin Yue <L.X.YUE@motorola.com>2009-11-02 15:22:42 +0800
committerJaikumar Ganesh <jaikumar@google.com>2009-11-25 13:05:22 -0800
commit18c3040260907472a9e471e5707a5b2f8320d074 (patch)
tree78c1333294a0fd96bdcbe9be9b0599f11b4a13c4 /src
parent89f9c9b4ccc22bc1f37edf5effa518970d342808 (diff)
downloadandroid_packages_providers_DownloadProvider-18c3040260907472a9e471e5707a5b2f8320d074.tar.gz
android_packages_providers_DownloadProvider-18c3040260907472a9e471e5707a5b2f8320d074.tar.bz2
android_packages_providers_DownloadProvider-18c3040260907472a9e471e5707a5b2f8320d074.zip
Fix Download application notification timestamp not correct issue
Should set the value of Notification.when before calling setLatestEventInfo(). On downloading an image without exif information, the received file's timestamp is correct for main database field but incorrect for temporary display field. Root cause is that if Notification.when not set before calling setLatestEventInfo(), the timestamp value in milliseconds unit will be directly set to a field as second unit. Thus database will record the time as 1000 times forward as 2067, etc. However from UI the file's time will be just shown like "10/10/67", misleading people to think time is set backwards before system time 0(1969).
Diffstat (limited to 'src')
-rw-r--r--src/com/android/providers/downloads/DownloadNotification.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/android/providers/downloads/DownloadNotification.java b/src/com/android/providers/downloads/DownloadNotification.java
index 9f54190e..fe5217f0 100644
--- a/src/com/android/providers/downloads/DownloadNotification.java
+++ b/src/com/android/providers/downloads/DownloadNotification.java
@@ -276,6 +276,8 @@ class DownloadNotification {
intent.setClassName("com.android.providers.downloads",
DownloadReceiver.class.getName());
intent.setData(contentUri);
+
+ n.when = c.getLong(lastModColumnId);
n.setLatestEventInfo(mContext, title, caption,
PendingIntent.getBroadcast(mContext, 0, intent, 0));
@@ -285,8 +287,6 @@ class DownloadNotification {
intent.setData(contentUri);
n.deleteIntent = PendingIntent.getBroadcast(mContext, 0, intent, 0);
- n.when = c.getLong(lastModColumnId);
-
mNotificationMgr.notify(c.getInt(idColumn), n);
}
c.close();