summaryrefslogtreecommitdiff
path: root/src/com/android/mail/utils/NotificationUtils.java
Commit message (Collapse)AuthorAgeFilesLines
* Fix cut off notification sounds.Danny Baumann2017-03-081-2/+4
| | | | | | | | | | | | | | When posting a notification without sound, NotificationManagerService now stops playing the sound of the previous notification. As we post an update to the notification ~2s after we originally posted it, this leads to cut off notification sounds. Solution: If we only posted an update and didn't notify of new messages, keep the sound URI set and instruct the notification manager to play the sound only once. JIRA: BUGBASH-199 Change-Id: I3aefa62ce1583839ef991380b2be6c39864509a1
* UnifiedEmail: Use NotificationManager to figure out LED capabilitiesZhao Wei Liew2016-12-301-6/+6
| | | | | | | | | As of f/b change I7d627914b058861048071fc15776031c4152157f, there's a more generic helper method in the notification service to get a more unified (and extensible) list of what the on-device LEDs can do. Move away from direct usage of the boolean resources. Change-Id: I4bcc7bc63cd93dacd56f8561d5f46c03d4e450b3
* Remove mail signatures from notification text.Danny Baumann2016-12-301-1/+3
| | | | Change-Id: Ia0ab851a33aa335724d83dadddf45adbfc1013c6
* unified-email: custom notification lightsJorge Ruesga2016-12-301-16/+22
| | | | | Change-Id: I34b4149afff1c6688cf5e032ff82fdb41227cdb9 Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
* unified-email: check notification support prior to create notification objectsJorge Ruesga2016-12-301-16/+20
| | | | | Change-Id: I86513d397d75c3dc2f0dad1b3399c4ffeaabf173 Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
* Allow to resend all notificationsRégis Décamps2014-10-151-3/+6
| | | | | | | | | | | The underlying NotificationUtils allows to resend notifications on all accounts and folders by passing null. Fix NullPointerException in NotificationActionUtils if the intent omits these extra. Bug: 17713589 Gmail crashes when accessing an old notification for an account that has been deleted. Change-Id: I6c2cf5234006f4859fea5bbaa52970963bcfccdd
* Revert "Force Show Vector Drawables (UnifiedEmail)"Rohan Shah2014-10-131-5/+5
| | | | | | | | Need to revert - doesn't build on Mac OS This reverts commit a2023f30e61405506b6bab84575bd425957ae171. Change-Id: I84ffde14135857402e4249a1dec9040a80deff21
* Force Show Vector Drawables (UnifiedEmail)Rohan Shah2014-10-131-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Added anydpi-v21 drawable folder, which causes the system to prioritize the xmls in the folder and use them over the ones in xxhdpi for xxxhdpi devices. Also removed unnecessary xxxhdpi icons and updated notif mail and multiple_mail icons. Removed three files from the vector drawable folder as we cannot call BitmapFactory.decodeResources(...) on vector drawables: - ic_star_outline_20dp - ic_star_20dp - ic_check_wht_24dp We will have to go back and change how we initialize the bitmaps from the vector drawables later. These have been recorded in the bug. Finally, updated notification and parent folder icons. Bug: 17936539 Change-Id: If7759b47824a06aadd4ec038cb6ab7fb8e5fdfe3
* Redo Notification Tagging (UnifiedEmail)Rohan Shah2014-10-061-88/+41
| | | | | | | | | Deals with notification tagging - we no longer need the contact lookup uri info - We only need the sender address to create an uri. Bug: 17577629 Change-Id: I41cedfecbeaffadec2273ddaafdad1bc098a06b2
* Avoid crash when tagging people in notificationsTony Mantler2014-09-181-0/+3
| | | | | | b/17420805 Change-Id: I93b2b8015761e44195c8a1706b1ade2382b31cbf
* Sending a mail to self crashes gmailJames Lemieux2014-09-171-17/+10
| | | | | | | | | | | | | | | | | | b/17517391 When emailing yourself in Gmail, the initial entry in the messages table is written with a NULL fromAddress. When the Gmail server responds from the call to actually send the message, the sender is then filled in. This brief period of time where the fromAddress is (needlessly) NULL produces cursors that report the sender name and email address as NULL. To sidestep this problem, SendersView now takes the current Account as an argument and, if no proper sender information can be located, falls back to displaying the avatar of the current account, which should typically always match the sender. Change-Id: Ibe052dc948ff90e319a287ee1fb8cc8b707991b2
* Tag Notifications with People (UnifiedEmail)Rohan Shah2014-09-101-38/+134
| | | | | | | | | | Use addPerson with notification compat builder to tag notifications with contacts. Default to using a ContentResolver if the ContactLookupUriFetcher is null. Bug: 15385612 Change-Id: I2ce5fe90d77dd5d0f9b5cc5aeebef069b3b5fa19
* Allow LetterTileProvider to use a defined fontsizeRégis Décamps2014-09-091-30/+3
| | | | | | | | | | Also refactors the bitmap cropping into a circle from MessageHeaderView into BitmapUtil and makes NotificationUtils use that method as well. Bug: 16875798 SetupAddressesActivity: Show letter avatar if none Bug: 16378212 Draw letter tile for non-Gmail avatars in Account switcher Change-Id: I375990e3df331ff9952652d5f06a4f4f8d133e48
* Revert "Cut off notification string at 5120 chars"Rohan Shah2014-09-091-5/+1
| | | | | | | | | | Talked to Andrew about this and the changes in support should roll in fast enough, so this is unnecessary. This reverts commit b568ad289b137ebad66684636d94e4e77316fe0b. Bug: 17363929 Change-Id: Ie62c72fce46f4f590ba6105156ab9bbf2cb636bb
* Cut off notification string at 5120 charsRohan Shah2014-09-081-1/+5
| | | | | | | Limit the snippet length to 5*1024 chars. Bug: 17363929 Change-Id: Iff4db968b0e6c7d3a44034d5d4b8e4789bd6f10b
* Don't look up a sender icon if we don't have a senderTony Mantler2014-09-081-1/+1
| | | | | | b/17420805 Change-Id: Id85be391e724142f90e3cf8bb597b667591e5ffc
* Quantum leave behind items. b/16130906.Andrew Sapperstein2014-09-071-3/+3
| | | | Change-Id: I8a07744bb163d6adf1ad68adb83ad3f1d44aa63c
* Set the "when" field of conversation notifications.Alan Lau2014-08-281-3/+1
| | | | | | | | | | Set the field to the timestamp of the conversation instead of the current time. This is recommended per the notification doc, and this will prevent bridging of the notifications to wearable after notification repost (until the bridging logic changes to take post time into consideration). Bug 16978916 Change-Id: I4d6cec8c92d2ba24bf447a45715fd6959c2a1611
* Set category on the mail notificationsPaul Westbrook2014-08-221-0/+3
| | | | | Bug: 17184305 Change-Id: Iae0f5e958ca47253419641ed24d6e27643e99c17
* Remove asterisks from public notifsRohan Shah2014-08-211-25/+1
| | | | | | | | Just took out the method I wrote to censor out the names. Bug: 17184312 Change-Id: Idf979af8bc67147d3f1fdd704ea70cf4fe2d1203
* Crop Notification Tile only for L or LaterRohan Shah2014-08-211-1/+5
| | | | | Bug: 17162471 Change-Id: I98f9964c9aa2513ffe4ca311a40d8e89feee03b6
* Update Notifications (Unified Email)Rohan Shah2014-08-191-48/+39
| | | | | | | | | 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: Iaf768975664c56d0e5e92cb17c854024c1d4acd7
* Update Notifications Icon (UnifiedEmail)Rohan Shah2014-08-151-3/+3
| | | | | | Rest in pieces little gmail icon :( Change-Id: I092e902d5c3008016d70e4817f57daf6998b936f
* Add API check for L (setColor)Rohan Shah2014-08-131-5/+14
| | | | Change-Id: Iae4070ea149f96c19d59f12ca7525ebd7f85b127
* Fix build - broken assetRohan Shah2014-08-131-3/+3
| | | | Change-Id: I2338e18944bd99a6be867c6165837fa80b25ada2
* Update Notifications (UnifiedEmail)Rohan Shah2014-08-141-8/+60
| | | | | | | | | | | | | Updated most of the notifications and added color for them. Still missing a few things: - No Big Icon BG (waiting for possible addition to frmwrk) - Small mail icon is still there with multiple mail icon (code's in place but I'm looking for a better sol) - Badge (small) Icon is really small at the top of the bar which should be fixed soon Bug: 16987147 Change-Id: I44de8eab32250d1486805a652e8c04db89268c62
* Improve failure logic for null cursorsJames Lemieux2014-07-301-0/+12
| | | | | | | | b/16328925 Test cursor for null and throw a more descriptive exception. Change-Id: Ic9a1baf525737728b896d1c79bf90b525e0e2859
* Revert "Revert "Use getAccountId for AccountPreferences and FolderPreferences.""Paul Westbrook2014-07-301-9/+11
| | | | | | This reverts commit ce9372d8ee7daf9b05569e98f684f5b7e14f6a04. Change-Id: Ie5d560e4a29502078e0df15eb20d4ea7f153779a
* Revert "Use getAccountId for AccountPreferences and FolderPreferences."Régis Décamps2014-07-291-11/+9
| | | | | | | | Due to b/16645621 [Smoke test] Not receiving notifications when a new email arrives. This reverts commit 8d7d0b7dda368390c04dc6fd8156cf7a6ed72d6e. Change-Id: I3ab3aaa552a8f0c25ab369c0aceba4ec44c5a3e8
* Use getAccountId for AccountPreferences and FolderPreferences.Ray Chen2014-07-281-9/+11
| | | | Change-Id: I7dab0aa619a9372b38c2336af9ab19df1629da84
* Delegate Account creation to builder class.Ray Chen2014-07-161-1/+1
| | | | | | | Account contructors are no longer public and clients need to use Account.builder().buildFrom(...) instead. Change-Id: I8f072e893b49b64d962fa7a075e5c15364c4c05f
* Fix NPE when contactIconInfo is nullJay Shrauner2014-06-241-1/+5
| | | | | | | | | Check for null contactIconInfo and use default wearable bg when unseenCount <= 1, same as was already being done about 20 lines earlier in the same routine for the case when unseenCount > 1. Bug:15855456 Change-Id: I63b473eb1d409e20599346c287ddffaf132af92e
* NPE fix in saveNotificationMapJay Shrauner2014-06-181-4/+3
| | | | | | | | Change saveNotificationMap to use getUnread/getUnseen null safe APIs like other routines in this class. Bug:15722507 Change-Id: I52677355bf53ae962eae0c229cb1326076d2d4f3
* am 77b4c2c3: Minimum html support using Html class (no ol/ul)Jin Cao2014-06-181-4/+4
|\ | | | | | | | | * commit '77b4c2c31d7601665c337ce5cbc9d84fb9332be8': Minimum html support using Html class (no ol/ul)
| * Minimum html support using Html class (no ol/ul)Jin Cao2014-06-171-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support basic html in ComposeActivity using Html and HtmlTree class. - Extended HtmlTree to take in any arbitrary html -> object converter so we can use it to convert html to spanned as well as plaintext. - Added custom SpannedConverter to feed into HtmlTree. - Added async task to load Utils.htmlToSpan in the background. - Moved ComposeActivity#sendOrSaveInternal to a handler thread in case Utils.spanToHtml takes a long time. Note that we only support a subset of the html tags. To see the full list of tags we currently support, refer to HtmlUtils#SpannedConverter. Performance: About 3x faster than using Html.fromHtml (yay!). Performance should not be an issue for >99% of the users. b/7406122 Change-Id: I484d7fc7d2f36c4724d9e4cb90fa1d65eadcb903
* | Add support for public notificationsJames Lemieux2014-06-131-5/+69
| | | | | | | | | | | | | | | | Public notifications are redacted forms of private notifications that can safely be displayed above a user's lock screen without displaying sensitive information to unauthorized parties. Change-Id: Ibef0dfed3580de052dbda74829f4bd565b878369
* | Fix NPE when senderAddress is nullJay Shrauner2014-06-121-28/+30
| | | | | | | | | | | | | | | | getContactIcon was returning a null object when senderAddress is null. Change so returns default email icon and default wearable background. Bug:15592903 Change-Id: Id8eb7ceb72c9558157a3d502dbceb0793a7e75ff
* | Fix error log statementJay Shrauner2014-06-121-1/+1
| | | | | | | | | | | | | | Fix error log statement with %d but no argument. Bug: Change-Id: Id0a8108fc3c947f08b5c4c0bac18f7c6f2cf3fdf
* | am 54867378: Merge "Return the order key in the conversation cursor." into ↵Alan Lau2014-06-121-1/+5
|\| | | | | | | | | | | | | ub-gmail-ur13-dev * commit '54867378b9707edd5e5c514aeee241c7fbfa2898': Return the order key in the conversation cursor.
| * Return the order key in the conversation cursor.Alan Lau2014-06-111-1/+5
| | | | | | | | | | | | | | | | | | | | | | For Email the order key is the message timestamp, Gmail sortMessageId. The order key is then used as the sort key for notificatin api, and because it is stable, notification bridger can avoid bridging duplicate notifications and reodering the email card bundle on the watch. Bug 15563260 Change-Id: Ibc5aadf9fa2b52e0adb005af12bc451544e71d8f
* | am e806c944: Better user experience for Gmail wear users. * Skip undo on ↵Alan Lau2014-06-111-60/+72
|\| | | | | | | | | | | | | phone when the action is perform remotely * mark conversation as read after reply. * commit 'e806c9447c7137d2a7a828e7ccdc1f8961aa1c2a': Better user experience for Gmail wear users. * Skip undo on phone when the action is perform remotely * mark conversation as read after reply.
| * Better user experience for Gmail wear users.Alan Lau2014-06-101-60/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Skip undo on phone when the action is perform remotely * mark conversation as read after reply. Created separate pending intent for Wear actions. NotifActionIntentService skips the Undo for remote actions. ComposeActivity adds a converstion uri to start a service to resend notification. Bug 15332337 Bug 15332837 Bug 15532541 Change-Id: I9fb51ec6ac393075b08f770bbc3b3490aab622e3
* | Fixes b/15430735 and b/15404897 - Errors from lack of a from address.Anthony Lee2014-06-051-0/+5
|/ | | | | | | If we detect a null pointer from Message.getFrom(), go back the default value of an empty string. Precedent has been set from other calls to getFrom() that this is the accepted way of error handling. Change-Id: Icdd0aa0f86790b912e5bc5b1dde9f81552272816
* Set child notification (email in a bundle) to autocancel. Also add intentAlan Lau2014-06-021-0/+1
| | | | | | | | data to undo delete intent that should have been fix previously. Bug 15332837 Change-Id: I3bc86e19ac724d74e2fd037d54462a6794a7f27f
* Merge "Use NotificationManagerCompat everywhere and properly cancel child ↵Alan Lau2014-05-281-5/+8
|\ | | | | | | notifications" into ub-gmail-ur13-dev
| * Use NotificationManagerCompat everywhere and properly cancel child notificationsAlan Lau2014-05-281-5/+8
| | | | | | | | Change-Id: I9d073f3a635c24288a777086d4017143836918ec
* | Allow alternate sources for contact images.Andrew Sapperstein2014-05-281-65/+116
|/ | | | | | | | | | | | | | | | | | | | | | Makes some classes that overridable in order to provide alternative implementations: ContactResolver, ContactResolverTask, ContactLoaderCallbacks, and ContactPhotoFetcher all can be subclassed to provide new behavior. Also added hooks in ControllableActivity and MailIntentService to override building these classes. NotificationUtils was also updated to force all calls through MailIntentService which can be overridden. Finally, moved the BitmapCache used in conversation list to the activity level instead of at AnimatedAdapter-level (which is effectively fragment level). This speeds up subsequent queries for images dramatically. We reset the cache when changing accounts. b/11387812. Change-Id: Ie70d800862b073163ccbfa5295d6950e57d64009
* Port Gmail to new wearable api.Alan Lau2014-05-271-26/+25
| | | | Change-Id: I6ec0e72945814d11be8396f5984bc627b75378e7
* Set background for wearable only. Use the default image if the icon is notAlan Lau2014-05-211-42/+90
| | | | | | | | a profile picture. Bug 14092605. Change-Id: Id4c437e91a8f632c1d969ed76be294a8da118b20
* Wearable notification api change.Alan Lau2014-05-211-19/+41
| | | | | | | Bug 14685201 Change-Id: I24ac8086f685bf6b3dcd1847f755590b8fdc9dfa (cherry picked from commit 575255c9ad5bcb708f60e928bdafe32301dcf667)