Merge "Fix new notification showing timestamp "now" after turning off DND" into pi-dev

am: 929ea36157

Change-Id: Ic5e6c30d8219258f3393e237bb0c671de446f9c5
This commit is contained in:
Selim Cinek
2018-05-03 08:29:56 -07:00
committed by android-build-merger

View File

@@ -104,8 +104,16 @@ public class DateTimeView extends TextView {
sReceiverInfo.set(ri);
}
ri.addView(this);
// The view may not be added to the view hierarchy immediately right after setTime()
// is called which means it won't get any update from intents before being added.
// In such case, the view might show the incorrect relative time after being added to the
// view hierarchy until the next update intent comes.
// So we update the time here if mShowRelativeTime is enabled to prevent this case.
if (mShowRelativeTime) {
update();
}
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();