summaryrefslogtreecommitdiff
path: root/src/com/android/email/NotificationController.java
Commit message (Collapse)AuthorAgeFilesLines
...
* Move Mailbox to top level class.Ben Komalo2011-05-131-1/+1
| | | | | | No other changes made. Change-Id: I3d8f3c521dc0d902be313b25252b4b6a4a96e7ee
* Rename AccountSettingsXL -> AccountSettingsBen Komalo2011-05-131-2/+2
| | | | | | | This activity already supports phone and tablet mode. Only renames in this change - no other change. Change-Id: Ieca17137af45e3860812091f69cd4d9b55ddf3ec
* Open message if only one message in notificationTodd Kennedy2011-05-131-4/+8
| | | | | | | | If there is only one unread&unseen message in the notification, clicking the notification will automatically open the message view fragment. Otherwise, the message list fragment will be opened. Change-Id: I22778258836a36f289d71b99a6214ec82778f385
* Suspend notifications for currently shown accountTodd Kennedy2011-05-121-56/+66
| | | | | | | | We will suspend notifications whenever we display the message list for an account (including "combined inbox"). As soon as the message list is paused, notifications will be resumed. Change-Id: I481a0f59ce68f89c32210d862d0267f3f334063b
* Add account observer to NotificationControllerTodd Kennedy2011-05-111-62/+92
| | | | | | | The notification controller now observes changes to the account database and adds or removes message observers as appropriate. Change-Id: I1670fcfd6ce744030199b86708a6ada55b239a84
* Fix NPE in NotificationControllerTodd Kennedy2011-05-111-1/+7
| | | | | bug: 4409317 Change-Id: I7e515ba7c4fa7114e2bf9ecf6cb473cb3506ad1c
* Create a new notification serviceTodd Kennedy2011-05-111-23/+0
| | | | | | | | | We can remove the preferences stuff 'cuz the service "should be" longer living. And, even if the service is terminated (either by the user or by the system) we'll receive a new notification when the service comes back. This is probably desired behaviour anyway. Change-Id: I4850a9473401536e8fb20385b780d4736ce80a8e
* Use observers to manage new message notificationsTodd Kennedy2011-05-101-189/+304
| | | | | | | | | | | | | | | | | | We were sort of using observers to maintain the new message notifications. However, other parts of the code would poke into the notification controller to set things such as a list of newly added message IDs. Now, we rely exclusively on db observers to manage notifications. As a side effect of this, we now set the notification text correctly to be the most recently _added_ message. This may be different than the most recently sent message [since there may be a non-negligable delta between when the message was sent and when it was received]. NOTE this still suffers from an outstanding bug where we continue to get notifications when the Eamil UX is visible. That and monitoring changes to the account table will be addressed in future CLs. Change-Id: I4c68273716cc685574a1ca71e5d634f53fe0d882
* Remove notification if messages seen off deviceTodd Kennedy2011-05-051-18/+217
| | | | | | | | If we receive new messages, we may display a notification to the user. If those same messages are read elsewhere (i.e. via a web client), we will remove the notification. Change-Id: Iba09afe01942e0deaac8210fd6f9b315b1c8c93f
* basic code cleanup of the notification controllerTodd Kennedy2011-04-281-127/+132
| | | | | | | | | * javadoc methods * rename some methods * remove duplicate code; now new message and other account notifications are created with the same code Change-Id: Iecf70494b6407a9a73380de103390a59d006191b
* Better fix for the PendingIntent issue.Makoto Onuki2011-03-231-33/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor the changes introduced in Ib02842bb. - Now Welcome and AccountSettingsXL accept intents with URLs of the following style, and get IDs from query params, rather than extras. Welcome: content://ui.email.android.com/view/mailbox?ACCOUNT_ID=1&MAILBOX_ID=2&MESSAGE_ID=3 AccountSettingsXL: content://ui.email.android.com/settings?ACCOUNT_ID=1 - Now the "new message" and "login failed" notifications use these new style intents, so the system wouldn't merge PendingIntents for different accounts. Also: - Moved all notification creation logic to NotificationController. (Except the one in CalendarSyncEnabler; which is used only to support upgrading from pre-froyo and I don't think it's worth refactoring.) - Note the "password expired/expiring" and "security needed" notifications aren't changed; they still use extras to store account IDs. This is okay because these notifications are not per-account. Bug 4065269 Change-Id: I70737438d2e7c45fd7488a5b0a7105c8568e02f7
* Merge "Fix NPE in NotificationController" into honeycomb-mr1Makoto Onuki2011-03-091-1/+4
|\
| * Fix NPE in NotificationControllerMakoto Onuki2011-03-091-1/+4
| | | | | | | | | | | | | | | | This would happen when a message has no from addresses. Bug 4027170 Change-Id: I1da091a6a55b274805ee6b3e109cbeb55a21fae1
* | Fix bug 3509555 make notification always open right accountMakoto Onuki2011-03-091-2/+27
|/ | | | | | | | | | | | | | | | | | The problem was that: - Each account now has own new message notification - But PendingIntens for these all point to the same activity, only with different long extras (for acount IDs). - Framework merges these intents, because extras don't count as a "difference" in this case. - So when multiple new message notifications are shown, they'll all share the same intent internally, so they'll all open the same account. A quick workaround seems to be to set a unique URI to each intents. Bug 3509555 Change-Id: Ib02842bb32634cfdf01ae2d684dd04dfede23832
* Add contextual dialogs after notificationsAndy Stadler2011-02-181-2/+2
| | | | | | | | | | | | | * When security settings notification is clicked, inform user that they need to change settings (before dumping them in security settings.) * On an authentication failure, present a dialog to the user explaining that the username or password may be incorrect. * When the device pin/password is expiring or expired, present a dialog to the user explaining that it needs to be updated. Bug: 3238657 Change-Id: I8fca446fa3c1bf87a95938553dbdc362c3df220e
* Refresh email notifications (part I)Andy Stadler2011-02-161-32/+24
| | | | | | | | | | | | | * Use strings that fit properly in new notifications * General cleanups & rewrites from Roy * Remove showWarningNotification() and use postAccountNotification() This is part I. Part II will add dialogs triggered by some of these notifications, to provide more explanation to the user of what's wrong and how to fix it. Bug: 3238657 Change-Id: Ib51bcb4412f8a09a6f97653f0b5f8642efe2ac1e
* Email split, part huit: Refactor constants, clean emailcommonMarc Blank2011-02-141-0/+1
| | | | | | | | | | | | | | | * There are three pieces to this CL (sorry): 1) Move and/or rename some constants into emailcommon 2) Move Utility to emailcommon, moving the few UI related utilities back into Email (FolderProperties and UiUtilities) 3) Remove all references to resources from emailcommon * The three pieces relate in that, between them, they allow the emailcommon static library to compile cleanly Bug: 3442973 Change-Id: Ic5e3abaa2a1b36999e0b6653c6c2134ea1bd544f
* Email split, part six: EmailContentMarc Blank2011-02-101-4/+4
| | | | | | * Moved EmailContent to emailcommon Change-Id: Ib3db1bfcfe74554c0e5afd3cfce6d72f26e9aeb9
* Email split, part quatre: Move along, nothing to see hereMarc Blank2011-02-101-1/+1
| | | | | | | | | | * No code was harmed, er, changed in the making of this CL * All that's happened is that code that is needed by both Email and Exchange have been moved into emailcommon * This required import changes to many files, which explains the length of the CL Change-Id: I4e12455ba057a4a8054fdbd0b578c73afa411c8a
* Resolve build warnings; part 3Todd Kennedy2011-02-031-4/+10
| | | | | | | | | Fixes deprecation warnings NOTE: This does not resolve hostauth deprecation; that will be fixed in a separate CL. Change-Id: I47115516da34effbf885615cb439c9d3e6f95b84
* Use generic contact icon for notifications & messagesAndy Stadler2010-12-151-3/+4
| | | | | | | | | | * Copies the icon from contacts * Used whenever the sender doesn't have a local photo * Used in notifications and in messageview Bug: 3282187 (notification) Bug: 3285156 (memory leak from the placeholder graphic) Change-Id: I528cae20355aa8cce7be37b26f32aa90e092708b
* New style for the new message notificationMakoto Onuki2010-12-061-38/+56
| | | | | | Bug 3176956 Change-Id: Id7418fb8bb942230266815167f0a2e79062a9116
* Add password expiration plumbingAndy Stadler2010-12-011-0/+56
| | | | | | | | | | | | | | | * Set aggregated expiration values with DPM * Fix min/max logic when aggregating, and fix unit test * Add expiration tests when checking if policies are active * Add expire-password to uses-policies set * Handle password refresh (clear notifications and sec. holds) * Handle password expiration (warning and/or wipe synced data) * Unit tests for provider-level methods * Refactor common security notification logic * Placeholder notification strings (need final) Bug: 3197935 Change-Id: Idf1975edd81dd7f55729156dc6b1002b7d09841f
* Correctly set intent to new message notificationMakoto Onuki2010-11-221-2/+2
| | | | | | Bug 3219763 Change-Id: I7826e762713228ee4ca1ca1d57b4d7603df81a66
* Use new notification API to get the new features.Joe Onorato2010-11-211-22/+8
| | | | Change-Id: I47a6c46ebb7999663ec16f049c99c418f4333213
* Don't show non-incoming message in notification.Makoto Onuki2010-11-101-1/+1
| | | | | | | | | | | | | | Filter out non-incoming messages using a subquery. (because the message table doen't have the mailbox type.) I was initially thinking of adding a new content URL for the message table joined with the mailbox table, but it turned out to be a bit of pain, so ended up using a subquery. (one of the problems was that both tables had the "_id" field.) Bug 3177220 Change-Id: I276efb70db1589835f3ddb8c7da4773e72d8691b
* Fix & clean up intent handlingMakoto Onuki2010-11-021-4/+6
| | | | | | | | | | | | | | | | | | | | | - Make sure an account shortcut really opens the account by adding the FLAG_ACTIVITY_CLEAR_TOP flag to shortcuts * Shortcuts have to be re-created for this fix to take effect. - Remove Welcome.createOpenCombinedInbox/OutboxIntent, which don't work with the new combined view. * createOpenCombinedInboxIntent() is not used already * createOpenCombinedOutboxIntent() is used, but is not final UI, so removing it is okay. - Fix MessageListXL.actionOpenMailbox -- now it really uses the passed mailbox ID. Bug 3144066 Change-Id: I2ee3f84c62a135351c10266c7ca6d5178c3a0ca2
* Use notifications for login failuresMarc Blank2010-10-271-3/+55
| | | | | | | | | | | | | | * For now, clicking on the notification takes the user to the Welcome activity, as we don't have final flows for the new account setup UI * Need comment on strings; the problem is that notification text must be rather short if we're to use the standard notification display. It looks like newer UI will allow 3 lines instead of 2, however. * Tested w/ IMAP, POP3, EAS, and SMTP Bug: 2322253 Change-Id: I7ed6fa5599179870cbcdb14af062e956eff37ec5
* Switch to tablet style notificationMakoto Onuki2010-09-291-0/+227
- Now we show separate notification for each account - New notification has sender photo, sender name, and subject of the latest email - Added the NotificationController class, which is intended to manage all notifications besides "new message" eventually. The framework doesn't seem to be 100% ready, and it's not clear how to add the 3rd line in the expanded notification at this point. Need to revisit it later to verify UI details. Change-Id: I40193ee372cb6b2b7245c1588890f238b2469699