Commit Graph

34 Commits

Author SHA1 Message Date
Todd Kennedy daf869cf60 Use an Account object to create a mail sender
Instead of boiling the account down to an unusable URI, just pass along
the Account object.

Change-Id: Ida408912de29734c8f4ed9cdf09a4d633dd03002
2011-04-20 11:14:02 -07:00
Todd Kennedy a50fc99b0c Use Account instead of URI to create transports
There's no need to create a URI just to rip in appart again. Additionally, to
support additional changes (i.e. to use Mailbox instead of Folder in the
MessageController), we need to store the actual Account.

NOTE -- This change only affects IMAP and POP3. SMTP will come in a follow-on CL

Change-Id: I400036a17271c99272fd9c603547dcd713b50b9d
2011-04-20 08:31:24 -07:00
Makoto Onuki 308ce92847 Better fix for the PendingIntent issue.
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
2011-03-23 14:49:38 -07:00
Andy Stadler d096f70ab3 Merge "Add contextual dialogs after notifications" 2011-02-19 21:39:58 -08:00
Andy Stadler f489413142 Add contextual dialogs after notifications
* 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
2011-02-18 18:23:18 -08:00
Todd Kennedy 34704851e9 Update account list if account description changes
Editing the account description occurs in a different fragment. As such, we
need to notify the fragment in charge of the account list whenever the
description is updated.

We already have a callback mechanism, so, expand that to send notifications
of any property change.

bug 3388586

Change-Id: I02475233f7f333db57c49ceaf908dbfa69c86ca6
2011-02-18 16:45:17 -08:00
Marc Blank 31d9acbf06 Email split, part huit: Refactor constants, clean emailcommon
* 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
2011-02-14 12:18:10 -08:00
Marc Blank a7bc0319a7 Email split, part six: EmailContent
* Moved EmailContent to emailcommon

Change-Id: Ib3db1bfcfe74554c0e5afd3cfce6d72f26e9aeb9
2011-02-10 19:44:29 -08:00
Andy Stadler 04c4ae864f Prevent NPE in account deletion race condition
Bug: 3399372
Change-Id: Ic41fb1292f8cc2e5ceb120e7233229dc4e47f1eb
2011-01-27 16:20:51 -08:00
Andy Stadler 09aae75f4e Fix account list after deleting accounts
* After deleting an account, we need to actually update
  the list of known accounts - it's not sufficient to simply
  rebuild the headers with one account marked deleted.
* Also remove a couple of obsolete TODO's

Bug: 3382965
Change-Id: I1aa6d88f869f0192b564b538817381efdc5fffe0
2011-01-27 00:02:44 -08:00
Makoto Onuki 49518bb360 Use proper alert icons on dialogs
Bug 3364447
Bug 3241281

Change-Id: Ie791d8d5eae26a848de08658a14d6a09d06d0846
2011-01-18 10:17:23 -08:00
Todd Kennedy c890a4e4a2 Display dialog if unsaved settings would be lost
When navigating away from a preferences screen and unsaved settings would be
lost, display a confirmation dialog. The user can either accept or cancel the
action. If canceling, the user is returned to the settings screen they were
currently on. Otherwise, they are taken to a new fragment (the exact
destination depends upon whether the user navigated "back" or selected another
header)

There is one additional change that needs to be made. In the case of navigating
to another header, we are notified _after_ the new header is selected. In this
scenario, the action is not cancelable and the user will lose any changes. We
must display an appropriate message when this happens. [note: this is the same
behaviour as when the user selects a breadcrumb]

bug 3327737

Change-Id: I4bd3b393a6323f3e63510e3ed08e4e1e745b04c4
2011-01-14 16:09:09 -08:00
Andy Stadler 983e1ad53b Make breadcrumbs work in server settings fragments
* Switch to newer startPreferenceActivity API
* Newer API lets us pass a string for the breadcrumb
* Get rid of newInstance() calls in all three server settings fragments

Bug: 3188951
Change-Id: I86ae91d63ff7bd32fa0eab96ac18686bb5e3e313
2011-01-13 00:07:09 -08:00
Makoto Onuki 38089f6c42 Show the UP arrow on account settings
Show the UP arrow on the action bar.  Tapping it works as a back press for now.

Bug 3341634

Change-Id: I9fade234fd9878f701a601f4d016778fa032383b
2011-01-12 11:03:02 -08:00
Andy Stadler 9f7e3982ad Reduce UI thread disk access in account settings
This change is in top-level settings for a given account:
* Call saveSettings async on UI changes, instead of synch at onDestroy()
* In loadSettings, get default account id async

Also sprinkled in some TODOs for future whack-a-mole fixes.

Bug: 3133639

Change-Id: I5216c78d28b35fe47e43b48ad0db3a3e57b25004
2010-12-22 13:55:42 -08:00
Andy Stadler 8ec0dcfe0d Fix NPE on rotation
* onAttach is called fairly early when rotating, so it needs to do
  very little.
* or in this case, defer some work until onResume

Bug: 3170922
Change-Id: Ie760125c5f32b293f8ba1753f2993de0d7439b56
2010-12-14 11:53:41 -08:00
Andy Stadler 112ed496f8 Update server settings to current look
* For each of incoming, outgoing, exchange fragment, create a "settings
  mode" which slightly alters the layout for use in AccountSettingsXL.
  * Build a settings mode wrapper layout around the basic fragment
  * Add new constructor to set "settings mode" and select layout
  * Add wiring for cancel/next buttons in the fragment
* AccountSettingsXL configures each fragment in its settings mode
* Remove old actionbar "Next" options (no longer needed)

TODO: Pixel perfect adjustments, colors, fonts, etc.

Bug: 3188951
Change-Id: Iba26281b214333db301dd40d6c016b6c5a932c2d
2010-12-02 21:45:04 -08:00
Andy Stadler 97874770fc Move "Add Account" to ActionBar
Not currently enabling/disabling properly, filing a framework bug.

Bug: 3188951
Change-Id: I9c8900187048f548411a23c2a1b0208c79fc0a24
2010-11-29 15:00:37 -08:00
Andrew Stadler cd09545b87 Provide runtime switch for GL acceleration
* new checkbox in debug fragment
* saved value in prefs so it's sticky
* each Activity calls a helper to enable/disable per that flag

Change-Id: I1af1ae9f401bc746cc97da00dfb0e06407b79d46
2010-11-01 16:16:27 -07:00
Marc Blank d3e4f3ca7e Use notifications for login failures
* 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
2010-10-27 08:56:37 -07:00
Makoto Onuki 899c5b8661 Switch to tablet style notification
- 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
2010-09-29 18:35:17 -07:00
Dianne Hackborn a2cc46c810 Fix issue #2967969: Crash rotating screen on "delete account" dialog
Update settings to use to PreferenceActivity APIs to retain its
current state across instances.  Removes
inheritance of Header (to work well with new framework impl that
retains these across instances), avoid resetting the current header
after a state change (we want to keep showing whatever the user
last viewed), put the dialog on the back stack (so it will get
removed if the back stack is cleared).

Change-Id: Ie35b1c0eb9b06277165f2b9cadb0e2999bb8af47
2010-09-13 18:25:00 -07:00
Andrew Stadler 2731aef45c Convert exchange setup to use checker fragment
* AccountCheckSettingsFragment now supports AutoDiscover
* Clean up callbacks for account check & autodiscover errors
* AccountSetupExchange now supports rotation
* Remove dead code in SetupData & AccountSetupBasics

TODO next CL: Remove all edit flows from setup activities
TODO next CL: Remove old CheckSettings activity

Change-Id: I3c9884856ca6e70226374fdb28400bfb3588387e
2010-09-13 14:04:45 -07:00
Andrew Stadler fd14496c49 Convert setup to use checker fragment
* Activities modified to use new check-settings fragment:
  * AccountSetupBasics (auto-setup for imap/pop)
  * AccountSetupIncoming
  * AccountSetupOutgoing

Next CL: Same work for exchange, and terminate old CheckSettings activity.

Change-Id: If5c5bfe331161b2429f7d7a4bd13290932f03c47
2010-09-10 15:51:37 -07:00
Makoto Onuki 0f52e546ef Implement General Preferences
- Removed the place holder setting
- Added "auto-advance" setting, which has "newer",
  "older" (original behavior, default) and "message list"
- Strings were copied from Gmail

This CL has preference change only (i.e. the setting isn't used yet).
The actual implementation will come later.

Change-Id: I9f90a723c67e066fdc536a73490101817a127933
2010-09-09 17:02:02 -07:00
Andrew Stadler 1a5e1e1593 Use real fragments for incoming/outgoing/exchange settings
* From account settings, switch to incoming/outgoing/eas fragments
* Show "Next" button in actionbar (may be dup'd in single-pane view)
* Common base class for in/out/eas fragments
* Depends on PreferenceActivity.startPreferenceFragment(), new API
* If the user clicks an account header while editing server settings,
  present a dialog before discarding the changes that haven't been
  checked yet.
* Confirm working (if a bit ungainly in appearance) on phone screen

Change-Id: I03591b9a8ffd11fe26fc6f58a5698740e61d0090
2010-09-03 14:30:21 -07:00
Andrew Stadler 9c65c146f3 Direct access to edit specific account settings
* Finish implementation of AccountSettingsXL.actionSettings()
* Point account manager entry point at it now
* Remove old AccountSettings activity
* Move AccountSettingsTests over to AccountSettingsXLTests and minor
  cleanups so it works in fragmentized activity.

Change-Id: I5f979a3a9a29dcbbe5a63833b184e6c0313652d5
2010-09-01 21:17:53 -07:00
Andrew Stadler b387560384 Move Add Account button to new Footer position
Change-Id: I662f6cbfd8db80f4b383e6204afcf460764f4d4c
2010-09-01 14:24:32 -07:00
Andrew Stadler 57f125a01b Move debug settings from own activity to setting fragment
* Add DebugFragment and incorporate it into AccountSettingsXL
* Tap "Email preferences" 10 times in a row to enable debug settings.
  (Or type D E B U G works as well.)
* Point broadcast receiver (*#*#EMAIL#*#*) to AccountSettingsXL
* Remove old debug launchers in AccountFolderList
* Remove old Debug activity

Change-Id: Ib289c42878a07c23f815654ce4570c1399aa49de
2010-08-31 11:11:54 -07:00
Makoto Onuki bd3e7777c5 Fix broken breakage introduced in I2a7fec0d
This file was left unchanged somehow...

Change-Id: I1b441731c71b63401c8b756e8e591c3018c07e35
2010-08-26 13:36:58 -07:00
Andrew Stadler 464d1f95b7 Finish delete account functionality
* Wire in delete account functionality
* Minor cleanups
* Update TODO list

Change-Id: Id9852eb833b0b4e4e8233620412e475815e537ef
2010-08-25 22:44:11 -07:00
Andrew Stadler a14a24a5bc Add Add & Remove Account options to AccountSettingsXL
* Add account is a large (+) in the action bar
* Remove account is a new item at the bottom of the settings fragment
Note: Add account works, remove account just toasts for now.

Change-Id: I5b3b8ab8c7d328cb78d103c47b9eca866466f9df
2010-08-19 16:28:52 -07:00
Andrew Stadler 5122417625 Make AccountSettingsXL the main settings UI
* Connect to it from all call sites
* Remove 1-pane and 2-pane icons
* Leave a few more breadcrumbs for launching into specific account
* Update the long TODO list in AccountSettingsXL

Change-Id: I502eda9a622518e8d4a23d46989340ad400cdd34
2010-08-18 16:47:42 -07:00
Andrew Stadler 2ae2a12d6b Initial implementation of SettingsXL (checkpoint)
* Create AccountSettingsXL
* Build headers dynamically based on accounts
* Launch account settings per-account
* Temporary launch point from menu in AccountFolderList

TODO: Fragment flip to incoming/outgoing/checksettings not implemented yet
TODO: Use more recent updates to PreferenceActivity
TODO: Finish plumbing into account settings fragment
TODO: Something more real for app settings

Change-Id: I6f4c5bb8cf691f25517c25950ef2049084335ce3
2010-08-18 11:29:46 -07:00