From 523d3073f6d81e1d1e8b3ad249cc82e7e3496e01 Mon Sep 17 00:00:00 2001 From: Rohan Shah Date: Tue, 19 Aug 2014 10:49:28 -0700 Subject: [PATCH 1/2] Update Notifications (Email) Got rid of large icon and only setting 'small icon' now. If conceal sensitive info has been enabled, also hides the ending of the account address. Bug: 16987147 Change-Id: I0899a602d1dfdaef980002746ce9079912f0525c --- src/com/android/email/NotificationController.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/com/android/email/NotificationController.java b/src/com/android/email/NotificationController.java index e247f6b53..0bcc95a06 100644 --- a/src/com/android/email/NotificationController.java +++ b/src/com/android/email/NotificationController.java @@ -123,14 +123,13 @@ public class NotificationController { * @param title The first line of text. May NOT be {@code null}. * @param contentText The second line of text. May NOT be {@code null}. * @param intent The intent to start if the user clicks on the notification. - * @param largeIcon A large icon. May be {@code null} * @param number A number to display using {@link Builder#setNumber(int)}. May be {@code null}. * @param enableAudio If {@code false}, do not play any sound. Otherwise, play sound according * to the settings for the given account. * @return A {@link Notification} that can be sent to the notification service. */ private NotificationCompat.Builder createBaseAccountNotificationBuilder(long accountId, - String ticker, CharSequence title, String contentText, Intent intent, Bitmap largeIcon, + String ticker, CharSequence title, String contentText, Intent intent, Integer number, boolean enableAudio, boolean ongoing) { // Pending Intent PendingIntent pending = null; @@ -144,7 +143,6 @@ public class NotificationController { .setContentTitle(title) .setContentText(contentText) .setContentIntent(pending) - .setLargeIcon(largeIcon) .setNumber(number == null ? 0 : number) .setSmallIcon(R.drawable.ic_notification_mail_24dp) .setWhen(mClock.getTime()) @@ -172,7 +170,7 @@ public class NotificationController { private void showNotification(long accountId, String ticker, String title, String contentText, Intent intent, int notificationId) { final NotificationCompat.Builder builder = createBaseAccountNotificationBuilder(accountId, - ticker, title, contentText, intent, null, null, true, + ticker, title, contentText, intent, null, true, needsOngoingNotification(notificationId)); mNotificationManager.notify(notificationId, builder.build()); } From ebae672af4a423c57557e317f3befa9d318193e9 Mon Sep 17 00:00:00 2001 From: Tony Mantler Date: Tue, 19 Aug 2014 14:20:12 -0700 Subject: [PATCH 2/2] Drawer resource updates b/17071718 Change-Id: I4a3a93b23c68f63d306fedf39ebbae09ee5ee094 --- .../android/email/provider/EmailProvider.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/com/android/email/provider/EmailProvider.java b/src/com/android/email/provider/EmailProvider.java index 174a9e49a..025f0eff0 100644 --- a/src/com/android/email/provider/EmailProvider.java +++ b/src/com/android/email/provider/EmailProvider.java @@ -2675,13 +2675,13 @@ public class EmailProvider extends ContentProvider + " ELSE " + UIProvider.FolderType.DEFAULT + " END"; private static final String FOLDER_ICON = "CASE " + MailboxColumns.TYPE - + " WHEN " + Mailbox.TYPE_INBOX + " THEN " + R.drawable.ic_drawer_inbox - + " WHEN " + Mailbox.TYPE_DRAFTS + " THEN " + R.drawable.ic_drawer_drafts - + " WHEN " + Mailbox.TYPE_OUTBOX + " THEN " + R.drawable.ic_drawer_outbox - + " WHEN " + Mailbox.TYPE_SENT + " THEN " + R.drawable.ic_drawer_sent - + " WHEN " + Mailbox.TYPE_TRASH + " THEN " + R.drawable.ic_drawer_trash - + " WHEN " + Mailbox.TYPE_STARRED + " THEN " + R.drawable.ic_drawer_starred - + " ELSE " + R.drawable.ic_drawer_folder + " END"; + + " WHEN " + Mailbox.TYPE_INBOX + " THEN " + R.drawable.ic_drawer_inbox_24dp + + " WHEN " + Mailbox.TYPE_DRAFTS + " THEN " + R.drawable.ic_drawer_drafts_24dp + + " WHEN " + Mailbox.TYPE_OUTBOX + " THEN " + R.drawable.ic_drawer_outbox_24dp + + " WHEN " + Mailbox.TYPE_SENT + " THEN " + R.drawable.ic_drawer_sent_24dp + + " WHEN " + Mailbox.TYPE_TRASH + " THEN " + R.drawable.ic_drawer_trash_24dp + + " WHEN " + Mailbox.TYPE_STARRED + " THEN " + R.drawable.ic_drawer_starred_24dp + + " ELSE " + R.drawable.ic_drawer_folder_24dp + " END"; /** * Local-only folders set totalCount < 0; such folders should substitute message count for @@ -3799,11 +3799,11 @@ public class EmailProvider extends ContentProvider } } else if (column.equals(UIProvider.FolderColumns.ICON_RES_ID)) { if (mailboxType == Mailbox.TYPE_INBOX) { - values[i] = R.drawable.ic_drawer_inbox; + values[i] = R.drawable.ic_drawer_inbox_24dp; } else if (mailboxType == Mailbox.TYPE_UNREAD) { - values[i] = R.drawable.ic_drawer_unread; + values[i] = R.drawable.ic_drawer_unread_24dp; } else if (mailboxType == Mailbox.TYPE_STARRED) { - values[i] = R.drawable.ic_drawer_starred; + values[i] = R.drawable.ic_drawer_starred_24dp; } } }