diff options
author | Rohan Shah <shahrk@google.com> | 2014-08-13 18:04:43 -0700 |
---|---|---|
committer | Rohan Shah <shahrk@google.com> | 2014-08-13 18:09:36 -0700 |
commit | ccec014e1f11770dd406c2421fdb48a6eccad86a (patch) | |
tree | fba5f1b5cb5ed4a1171bfd07c2dd3d70c396c13a /src/com/android/mail/utils | |
parent | 87281e36245ee454d2edf396459eb7f05005ad8a (diff) | |
download | android_packages_apps_UnifiedEmail-ccec014e1f11770dd406c2421fdb48a6eccad86a.tar.gz android_packages_apps_UnifiedEmail-ccec014e1f11770dd406c2421fdb48a6eccad86a.tar.bz2 android_packages_apps_UnifiedEmail-ccec014e1f11770dd406c2421fdb48a6eccad86a.zip |
Add API check for L (setColor)
Change-Id: Iae4070ea149f96c19d59f12ca7525ebd7f85b127
Diffstat (limited to 'src/com/android/mail/utils')
-rw-r--r-- | src/com/android/mail/utils/NotificationUtils.java | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/com/android/mail/utils/NotificationUtils.java b/src/com/android/mail/utils/NotificationUtils.java index 9596ceef2..d773028d0 100644 --- a/src/com/android/mail/utils/NotificationUtils.java +++ b/src/com/android/mail/utils/NotificationUtils.java @@ -630,8 +630,11 @@ public class NotificationUtils { new NotificationCompat.WearableExtender(); Map<Integer, NotificationBuilders> msgNotifications = new ArrayMap<Integer, NotificationBuilders>(); - notification.setColor( - context.getResources().getColor(R.color.notification_icon_gmail_red)); + + if (com.android.mail.utils.Utils.isRunningLOrLater()) { + notification.setColor( + context.getResources().getColor(R.color.notification_icon_gmail_red)); + } // TODO(shahrk) - fix for multiple mail // if(folder.notificationIconResId != 0 || unseenCount <= 2) notification.setSmallIcon(R.drawable.ic_notification_mail_16dp); @@ -856,11 +859,14 @@ public class NotificationUtils { .setContentText(account.getDisplayName()) .setContentIntent(clickIntent) .setLargeIcon(largeIcon) - .setColor(context.getResources().getColor(R.color.notification_icon_gmail_red)) .setNumber(unreadCount) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setWhen(when); + if (com.android.mail.utils.Utils.isRunningLOrLater()) { + builder.setColor(context.getResources().getColor(R.color.notification_icon_gmail_red)); + } + // if this public notification summarizes multiple single notifications, mark it as the // summary notification and generate the same group key as the single notifications if (multipleUnseen) { @@ -1102,8 +1108,11 @@ public class NotificationUtils { // if (folder.notificationIconResId != 0) { conversationNotif.setSmallIcon(R.drawable.ic_notification_mail_16dp); - conversationNotif.setColor( - context.getResources().getColor(R.color.notification_icon_gmail_red)); + if (com.android.mail.utils.Utils.isRunningLOrLater()) { + conversationNotif.setColor( + context.getResources() + .getColor(R.color.notification_icon_gmail_red)); + } conversationNotif.setContentText(digestLine); Intent conversationNotificationIntent = createViewConversationIntent( context, account, folder, conversationCursor); |