Merge "Fixed a bug where the chronometer was invisible" into nyc-dev am: 2486cb2c89

am: e9b32c77f8

* commit 'e9b32c77f88a2acb7e7e23fbd14f6b4f373cba0b':
  Fixed a bug where the chronometer was invisible

Change-Id: Ie6f36bca7345f7b1f86425e993deb7d617bbc4d5
This commit is contained in:
Selim Cinek
2016-05-19 20:54:37 +00:00
committed by android-build-merger
2 changed files with 12 additions and 5 deletions

View File

@@ -3369,7 +3369,7 @@ public class Notification implements Parcelable
* otherwise
*/
private boolean showsTimeOrChronometer() {
return mN.showsTimeOrChronometer();
return mN.showsTime() || mN.showsChronometer();
}
private void resetStandardTemplateWithActions(RemoteViews big) {
@@ -3865,14 +3865,21 @@ public class Notification implements Parcelable
}
/**
* @return true if the notification will show the time or the chronometer; false
* otherwise
* @return true if the notification will show the time; false otherwise
* @hide
*/
public boolean showsTimeOrChronometer() {
public boolean showsTime() {
return when != 0 && extras.getBoolean(EXTRA_SHOW_WHEN);
}
/**
* @return true if the notification will show a chronometer; false otherwise
* @hide
*/
public boolean showsChronometer() {
return when != 0 && extras.getBoolean(EXTRA_SHOW_CHRONOMETER);
}
/**
* An object that can apply a rich notification style to a {@link Notification.Builder}
* object.

View File

@@ -198,7 +198,7 @@ public class NotificationHeaderUtil {
}
// in case no view is visible we make sure the time is visible
int timeVisibility = !hasVisibleText
|| mRow.getStatusBarNotification().getNotification().showsTimeOrChronometer()
|| mRow.getStatusBarNotification().getNotification().showsTime()
? View.VISIBLE : View.GONE;
time.setVisibility(timeVisibility);
View left = null;