Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5350)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUIManager.java

Issue 1388483002: Implement the Notification `timestamp` property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUIManager.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUIManager.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUIManager.java
index 965a3871c195be90ca9e3e9ca1d00160dd1f0d5a..8a466f93519be9896ada5900d1982be60e1a9586 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUIManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUIManager.java
@@ -397,14 +397,15 @@ public class NotificationUIManager {
* @param icon Icon to be displayed in the notification. Valid Bitmap icons will be scaled to
* the platforms, whereas a default icon will be generated for invalid Bitmaps.
* @param vibrationPattern Vibration pattern following the Web Vibration syntax.
+ * @param timestamp The timestamp of the event for which the notification is being shown.
* @param silent Whether the default sound, vibration and lights should be suppressed.
* @param actionTitles Titles of actions to display alongside the notification.
* @see https://developer.android.com/reference/android/app/Notification.html
*/
@CalledByNative
private void displayNotification(long persistentNotificationId, String origin, String tag,
- String title, String body, Bitmap icon, int[] vibrationPattern, boolean silent,
- String[] actionTitles) {
+ String title, String body, Bitmap icon, int[] vibrationPattern, long timestamp,
+ boolean silent, String[] actionTitles) {
Resources res = mAppContext.getResources();
// Set up a pending intent for going to the settings screen for |origin|.
@@ -431,6 +432,7 @@ public class NotificationUIManager {
NotificationConstants.ACTION_CLOSE_NOTIFICATION,
persistentNotificationId, origin, tag, -1 /* actionIndex */))
.setTicker(createTickerText(title, body))
+ .setWhen(timestamp)
.setSubText(origin);
for (int actionIndex = 0; actionIndex < actionTitles.length; actionIndex++) {

Powered by Google App Engine
This is Rietveld 408576698