We should call notificationbuilder.setShowWhen(true) when we target Android N |
||||||
Issue descriptionBecause this defaults to false when you target N+, we will lose custom developer-set timestamps unless we explicitly call this. https://developer.android.com/reference/android/app/Notification.Builder.html#setShowWhen(boolean) https://developers.google.com/web/updates/2016/03/notifications ('Manage the timestamp displayed to the user' section) (Right now we target M so it's not an issue yet).
,
Oct 11 2016
,
Oct 18 2016
Bumping to P1 as the target sdk upgrade is happening imminently: https://bugs.chromium.org/p/chromium/issues/detail?id=623989
,
Oct 18 2016
Thinking about it & experimenting, not sure this is actually an issue - the custom timestamp will still be set under the hood which should still affect the notification order correctly, we just won't display it on N, in line with Android N defaults, which they presumably changed for a reason (to make it less cluttered?). This is the same as what happens on desktop (custom timestamps are not displayed but do affect notification order*). Nothing will change pre-N. * see https://developers.google.com/web/updates/2016/03/notifications ('Manage the timestamp displayed to the user' section)
,
Oct 18 2016
Maybe we could follow that paradigm - hide it by default, display it when the developer provides their own? However, that wouldn't be nice to plumb through at all. Per the specification, the `timestamp` as been defined to be set to the current time if the developer doesn't provide it. That means we'd either have to carry on a bool indicating whether it was set by the developer, or we'd have to check whether |timestamp| is within a certain number of milliseconds of the current time. Both are a bit icky. I think we /should/ display it when given a non-default value. I don't think we have to do that right now, since nobody uses it yet. WDYT?
,
Oct 18 2016
I guess it depends on whether developers are mostly concerned with preventing wrong timestamps from being displayed, (the use case outlined in the documentation*) or if they want to ensure a particular timestamp is displayed whenever possible. I think the former is more likely so would suggest we wait for developer complaints before spending time implementing this. *"On Android, Chrome's notifications show their create times in the top right corner by default. Unfortunately, this might not be the time that the notification was actually generated by your system. For example, the event might have been triggered when the device was offline, or the notification could be shown for an upcoming meeting." (https://developers.google.com/web/updates/2016/03/notifications)
,
Oct 18 2016
Seems good to me :)
,
Oct 19 2016
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by awdf@chromium.org
, Oct 7 2016Status: Assigned (was: Available)