OSDN Git Service

Fix Opp notifications timestamp not correct issue
authorLixin Yue <L.X.YUE@motorola.com>
Mon, 2 Nov 2009 07:51:05 +0000 (15:51 +0800)
committerJaikumar Ganesh <jaikumar@google.com>
Mon, 30 Nov 2009 18:47:32 +0000 (10:47 -0800)
Should set the value of Notification.when before calling
setLatestEventInfo()

Dr No:Eastham
Bug: 2292381

src/com/android/bluetooth/opp/BluetoothOppNotification.java

index c4a4591..345ec89 100644 (file)
@@ -303,6 +303,7 @@ class BluetoothOppNotification {
             intent.setClassName(Constants.THIS_PACKAGE_NAME, BluetoothOppReceiver.class.getName());
             intent.setData(contentUri);
 
+            n.when = timeStamp;
             n.setLatestEventInfo(mContext, title, caption, PendingIntent.getBroadcast(mContext, 0,
                     intent, 0));
 
@@ -311,8 +312,6 @@ class BluetoothOppNotification {
             intent.setData(contentUri);
             n.deleteIntent = PendingIntent.getBroadcast(mContext, 0, intent, 0);
 
-            n.when = timeStamp;
-
             mNotificationMgr.notify(id, n);
         }
         cursor.close();
@@ -342,6 +341,8 @@ class BluetoothOppNotification {
             Intent intent = new Intent(Constants.ACTION_INCOMING_FILE_CONFIRM);
             intent.setClassName(Constants.THIS_PACKAGE_NAME, BluetoothOppReceiver.class.getName());
             intent.setData(contentUri);
+
+            n.when = timeStamp;
             n.setLatestEventInfo(mContext, title, caption, PendingIntent.getBroadcast(mContext, 0,
                     intent, 0));
 
@@ -350,7 +351,6 @@ class BluetoothOppNotification {
             intent.setData(contentUri);
             n.deleteIntent = PendingIntent.getBroadcast(mContext, 0, intent, 0);
 
-            n.when = timeStamp;
             mNotificationMgr.notify(id, n);
         }
         cursor.close();