Commit Graph

47 Commits

Author SHA1 Message Date
Makoto Onuki 2ed7a86949 Support pre-HC style account shortcuts
Account shortcuts used to point at MessageList directly with a
content://com.android.email.provider/account/ACCOUNT-UUID URI.

Hook these intents and open Welcome instead.

On Eclair and before, we stored an account-ID directly as an extra,
but this style is no longer supported.

Bug 4208879

Change-Id: I9fecb0723743377a6d7c7e84626e8613f2356492
2011-05-19 13:47:25 -07:00
Makoto Onuki 94331c96d9 Remove phone activities and implement one-pane
The primary purpose of this CL is to remove phone activities, so the
one pane implementation is very much temporary and primitive, but it
should offer minimal operations.

Change-Id: If57f81db7c605c95664d49044a5cc082beda59c0
2011-05-11 15:35:27 -07:00
Marc Blank 5d08360a9b Merge "Complete rewrite of account backup/restore code" 2011-05-10 16:23:41 -07:00
Makoto Onuki f5492ea991 Add 1-pane UI controller
Added the base class for the UI controllers and the 1-pane implementaion,
which is almost empty at this point.

The old phone activities still exist and will be used on the phone by default.
To use the new activity (1-pane EmailActivity) on the phone, use the following
comamnd.

adb shell am start -a android.intent.action.MAIN \
    -d '"content://ui.email.android.com/view/mailbox"' \
    -e DEBUG_PANE_MODE 1

Change-Id: Id1fe85d4517778afc967d7d5e17e1299dd1bfefd
2011-05-10 11:28:00 -07:00
Marc Blank 0993190caf Complete rewrite of account backup/restore code
* Use EmailProvider to backup/restore into a backup database
* Remove all of the old AccountBackupRestore code
* Get rid of the legacy Account class and all of the Preferences
  crap that referenced it
* Remove corresponding tests

Change-Id: I2de75aafdacc87246174303961e58547303f641e
2011-05-09 10:39:17 -07:00
Makoto Onuki 8112732376 Move more UI stuff from activity to the UI controller
- Now all the UI stuff is owned by the UI controller
- Except temporary UI (exchange search and per-mailbox-settings)
- Except error banner
  This should be moved too eventually, but I consider it as a low-priority.
  I'll leave it as-is for the time being.
- Moved RefreshTask too.  The spec for refresh has dependency to the UI.
  (i.e. implicit refresh of the mailbox list may not be necessary for
  the phone.)

Also renamed the main activity to EmailActivity.

Change-Id: I00585856bdacf69aa4e104178a5cf7352ff6d592
2011-04-28 10:59:55 -07:00
Makoto Onuki 0b6cb1c330 Store UUIDs in account shortcuts, rather than IDs.
Bug 4192836

Change-Id: I1d6349ed3ad70867f113b9a9f7eb8717b88b24c1
2011-04-04 14:12:05 -07:00
Makoto Onuki af6079c823 More use of EmailAsyncTask
... for Welcome and EmailWidget.  So that now it's safe for onDestroy()
to be called while a task is running.  (onDestroy cancels it.)

Change-Id: I660b471465170e1d1d0ce153571fb924ae703d7d
2011-03-31 11:05:22 -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
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 7d51b7a05b Remove all compatibility with pre-2.0 data
* Remove LocalStore (pre-2.0 mail database) and its unit test
* Remove UpgradeAccounts (converted pre-2.0 accounts to Provider)
* Remove FolderMessageList (receiver for pre-1.6 desktop shortcuts)
* Remove "upgrading" paths through LegacyConversions
* Clip out dangling references to everything above

Bug: 3292310
Change-Id: I5654d55a0879b00b05b63055b94651855a8ee3ef
2011-02-06 00:54:39 -08:00
Todd Kennedy 6c5ee59c4f Add "tap to configure" text to widget
If there are no email accounts defined, the widget should show a single string
that allows the user to create a new account. Whenever there are changes to
the defined accounts, the widget(s) will update their headers to ensure they
are only displaying valid information.

bug 3296594

Change-Id: I156c20cfc90692174297a2aededd85775e0ea196
2011-01-26 17:58:51 -08:00
Makoto Onuki 0c75f83f03 App icon on app drawer shouldn't restart the app
When launching Welcome and MessageListXL, make sure they start
as a "main" activity.  This fixes the reported bug.

Bug 3366537

Change-Id: I68facd739bd1dad8eeec52015b0720299d632e11
2011-01-19 16:37:19 -08:00
Makoto Onuki c50b6f685b Use broadcast to detect system account update.
Instead of AccountsUpdatedListener.

Bug 3211657

Change-Id: I1e60092fc06fe80b9914ff7264c24fcbfa950745
2011-01-17 11:03:57 -08:00
Makoto Onuki 6a858c1be2 Make widget open appropriate screen
Widget should open MessageListXL on tablet.

Bug 3253813

Change-Id: I5cfa63b571e443a0217bc9332bb4a76a039143ac
2010-12-06 14:43:51 -08:00
Makoto Onuki 7126e5ae53 Fix & clean up intent handling
- 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
2010-11-02 18:18:43 -07: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
Marc Blank 64b64cca01 Rename SyncManager to ExchangeService
* Updated comments and checked for 100-columns

Change-Id: I4ab5aaa9425714f8e035e1952db3fec63d498ae1
2010-08-27 12:15:56 -07:00
Makoto Onuki 0be2d85bb8 Make notification open XL activity on tablet
* Now notification kicks Welcome, which knows which
  activity to use.
* Extracted cancelNewMessageNotification
* Also fixed 2909215.  There'll be only one XL activity on the app stack.

Bug 2945369
Bug 2909215

Change-Id: I2a7fec0d48a7618375cae55138ca51fefc70ff6e
2010-08-26 13:17:41 -07:00
Makoto Onuki d111cc70aa Add a debug parameter to Welcome to force 1-pane/2-pane
- Now Welcome takes an EXTRA_DEBUG_PANE_MODE to force the
  one-pane/two-pane mode.

Use this to open one-pane.
adb shell am start -a android.intent.action.MAIN \
  -n com.google.android.email/com.android.email.activity.Welcome \
  -e DEBUG_PANE_MODE 1

Use this to open two-pane.
adb shell am start -a android.intent.action.MAIN \
  -n com.google.android.email/com.android.email.activity.Welcome \
  -e DEBUG_PANE_MODE 2

Change-Id: I6e96f80f53f4488152935502c19d3dd8e0788150
2010-08-18 16:57:27 -07:00
Makoto Onuki b98f219cf0 Open 2 pane after adding an account.
- After adding an account, and when a shortcut to an account is clicked,
  launch Welcome instead of MessageList.
- Then welcome launches the appropriate activity.
  (MessageList or MessageListXL)

- Welcome no longer launches AccountFolderList, which will be gone
  according to the current plan.

Always going through Welcome makes sure that the account backup/restore
and the reconciler will always get kicked.

Change-Id: Ia57027eba16e98c5d8854e8d3c1d8773bcfbf1e5
2010-08-10 09:50:52 -07:00
Makoto Onuki 191448b430 Make Welcome launch MessageListXL
Also added the "1 pane" activity to test the phone UI.

Change-Id: I1c86d2088a2298ada5028b7a266bd090b593593c
2010-08-05 13:58:20 -07:00
Marc Blank e6cc662abc Use AccountManager for POP/IMAP; refactor setup classes
There are two major, interrelated parts to this CL:

1) Clean up the activities to reduce the use of Intents to pass
   information between activities; instead, we use a common
   SetupData structure that automatically saved/restored as necessary
   during the setup flow.  A fair amount of code and inconsistent
   use of Bundle extras has been eliminated in the process.

   * Create SetupData structure, setters/getters, and initialization
     methods to simplify the preservation of state during setup flow
   * Remove all state/flow extras from Intents; Intents now only
     specify the Activity to be started, which should greatly simplify
     the transition to Fragments.
   * Remove all state/flow fields from Activities
   * Modify existing setup activity unit tests and confirm tests pass

2) Create AccountManager accounts for POP/IMAP email accounts to
   provide consistency in user experience.  Also, internal flows are
   now identical as between account types.

   * Move account reconciliation from SyncManager to MailService, so
     that reconciliation is consistent between email and exchange
     accounts; move unit tests as appropriate
   * Add a "Sync Email" setting for POP/IMAP/EAS
   * Change MailService to respect the "Sync Email" setting in
     Settings -> Accounts & sync
   * Create PopImapSyncAdapterService to handle manual POP/IMAP sync as
     requested by SyncManager; add EmailSyncAdapterService to perform
     the same function for EAS
   * Use new PopImapAuthenticatorService to add AccountManager accounts
     for POP/IMAP accounts; setup appropriate stanzas in AndroidManifest
     and add related xml files
   * Update AccountSettings to use SetupData

Miscellaneous other changes:

   * Only allow valid port numbers in incoming/outgoing setup

Bug: 1712475

Change-Id: Ibdac52fb2c5578b86bf3992ddb1acd10f162391a
2010-07-21 19:01:41 -07:00
Andrew Stadler 79ef52cfb3 Improve handling of UI reset cases
* When account disappears (e.g. delete from Accounts & Sync) the Welcome
   activity should launch with FLAG_ACTIVITY_CLEAR_TOP to remove any
   stacked activities as well.
* When account disappears entering AccountSetupNames, don't fall out
   of Eas Flow Mode.
* Followup to 5e354cd1db

Bug: 2563998
Change-Id: Ifbe086e26205bb28c2514f84cb28e839888b1eb0
2010-04-14 19:16:46 -07:00
Andrew Stadler 5e354cd1db Exit most activities when accounts are deleted
This resolves cases like this:  You are in the inbox of an Exchange
account.  You click home, settings, accounts & sync, and you delete
the account.  Now re-enter the Email app.  You'll be left in a strangely
empty inbox, for an account that no longer exists.

* Set a flag any time the reconciler deletes an account
* Check that flag in onResume of any activity that depends on the account
    list and could be left in an "empty" state if account(s) are deleted.
* The Activities in which we check it are:
  * AccountFolderList
  * AccountSettings
  * MailboxList
  * MessageCompose
  * MessageList
  * MessageView
* Clear the flag any time we come in through Welcome, which will dispatch
    to other activities properly based on the number of accounts found.

Bug: 2563998
Change-Id: I00fc542581c2bed92d744a4c2e48a88f83737f11
2010-04-14 09:28:04 -07:00
Makoto Onuki 59cf1d05c1 Clear references to inner classes in onDestroy().
Also
- Made inner classes private if possible.
- Made some members final.

Bug 2570603

Change-Id: I34451000f2540c67e1039ea9dc4839dbec5ffab7
2010-04-07 11:54:57 -07:00
Makoto Onuki a942858f0d Properly handle old style (<= 1.6) account shortcuts.
A desktop shortcut to an account created on donut or before points at
com.android.email/.activity.FolderMessageList, which we've already removed.

- Added a dummy FolderMessageList to receive it and redirect to MessageList.
- Removed FolderMessageListUnitTests, which was left unremoved.

Bug 2535335

Change-Id: Ie5ffa158882633a4929c4c47a3d9625fd1626863
2010-03-26 11:02:18 -07:00
Andrew Stadler 842ac04828 Legacy account migration
* Create new activity to encapsulate account upgrade
* Populate it with a list of legacy accounts, and progress bars for each
* Sidestep Welcome when there are legacy accounts to convert
* Super lightweight account migration:
  - Account login info only
  - no folders, messages, or attachments
* Scrub out old data
* Return to Welcome screen

As noted, the copies working (useable) POP & IMAP accounts, but does
not try to deal with folders, messages, or attachments.

Bug: 2065528
2010-02-10 23:18:19 -08:00
Makoto Onuki 9fe51f6329 Gather common exchange related methods into one place
So that it'll be easier to remove exchange dependency.
2010-02-02 13:36:45 -08:00
Andrew Stadler 5e91cccd4b Quick backup/restore of accounts
* Workaround for (HTC bug 2275383) & (Moto bug 2226582)
* Adds checkpoints for backing up and restoring accounts
* Uses legacy Account / prefs to back up accounts - this is because
  some of this code will be reused for legacy account migration
* Unit tests of Account & LegacyConversions
* Unit tests of backup & restore
* Not done:  testing of EAS/Account Manager interface (this will require
  deeper dependency injection, to avoid the embedded calls to the Account
  Manager and other system services.)
2010-01-20 01:36:01 -08:00
Marc Blank f1efd65a5e Fix "back key" flow for Email account setup
* The existing flow is badly broken; every "back" causes the user
  to leave the setup flow and therefore have to start from scratch.
  This is a very bad user experience, as previously entered data is
  lost and must be re-entered.
* The fix corrects these problems, allowing the user to back up
  through screens UNTIL the account is successfully created.
* After account creation, the user is returned to the proper screen,
  depending on whether we're in "eas flow mode" or not

Bug: 2337511
Change-Id: Ie25ac73dfcd8a1dca36e1b31c75ffb22359840d1
2009-12-21 11:28:53 -08:00
Marc Blank e59c8725c5 Make sure SyncManager keeps running in various edge cases
* Have Welcome start the service (in case the app has been reloaded)
* Have SyncManager.ping start the service if there's no instance of
  SyncManager

Change-Id: I8bed2843a3e065d2db29fad67dfb0bb3a5d0ff5e
2009-09-14 08:50:50 -07:00
Marc Blank 75a0873dd9 Remove the temporary call to start SyncManager in Welcome.java
Change-Id: Ic15b19374e89d2b1329e55d4bc86336499a983fd
2009-08-31 22:06:30 -07:00
Andrew Stadler 4e4abc645c Clean up launch-time & account setup behaviors.
* Moved welcome message into account setup basics (name/pass)
* Reworked Welcome to go to AccountSetupBasics on count=0
* In AccountFolderList, removed old welcome message code, and add
  code to launch AccountSetupBasics when last account is deleted
* Fixed shortcut picker so launcher shortcuts work again
* Reimplemented shortcut receiver (in MessageList now)
* Default EAS accounts to SSL

Addresses bug 1916583 & 1987440
2009-07-21 11:06:14 -07:00
Andrew Stadler ded3c915d8 Add folders to AccountFolderList
* Scan folders and write into child cursors
* Clicking a folder takes you to MessageList
* Remove most links to FolderMessageList (nearly dead!)
* Repair 1-account startup behavior (takes you directly to inbox)
* Cleanup a few basic things like context menus & refresh

TODO: Magic mailbox section at the top
TODO: As always, better linkage to sync engine(s)
TODO: Menus, context menus, etc.
TODO: Proper handling of expandable list - accounts should stay open?
2009-07-10 16:46:51 -07:00
Andrew Stadler 72dce73390 Convert Accounts to AccountFolderList
* Move relevant sources & resources to new name
* Convert from ListView to ExpandableListView
* No children yet - selecting account simply jumps to FML (temp)
* No other change to functionality (e.g. no menu changes yet)
2009-07-09 12:33:09 -07:00
Marc Blank 2c67f1f8b8 Initial submission for EAS support (email)
* There is some temporary code ensuring that SyncManager runs (this will be removed when Exchange
is entirely independent)
* The service interface (aidl) is in place for most user-facing actions (load more, start sync, etc.)
* EAS account validation is done via aidl
* Folder and message sync appear to be functional in this early submission
* Provider now does cascading deletes (Account -> HostAuth and Mailbox, Mailbox -> Message,
  Message -> Attachment and Body)
2009-06-23 13:13:42 -07:00
Marc Blank a290f503f1 Refactored EmailStore, EmailContent, EmailProvider
EmailStore goes away, replaced by EmailContent
All database activity is moved to EmailProvider
2009-06-15 14:49:11 -07:00
Andrew Stadler 68a9ccfcde final cleanups to get basic message operations working properly.
* Generate compatibility UUID early enough to stick, so our localstore
db's are created correctly and not recreated over and over again.
* Compose menu items working
* Fix single-account mode (go straight to inbox)
* Lightweight Account projections where possible
* Properly show/hide default account checkbox (during new acct screens)

What works:
* All unit tests
* Editing existing accounts
* Create new accounts
* Checking account settings against server
* Mail sync using accounts
* Viewing mailboxes
* Viewing messages
* Composing messages

What breaks (in approx order of planned fixes)
* Some details of account editing
* Import of existing accounts
2009-06-09 16:13:05 -07:00
Andrew Stadler 9019315b26 Conversion to provider-based Account. What works:
* Editing existing accounts
 * Two placeholder accounts are written

What breaks (in approx order of planned fixes)
 * Some details of account editing
 * New account creation,
 * Viewing mailboxes & messages
 * Mail sync using accounts
 * Import of existing accounts
2009-06-03 16:11:36 -07:00
Marc Blank fae4727a91 Squashed commit of the following:
commit 19beb6f0cc6c0f3f0cbcdcd66cec9f141b470d70
Author: Marc Blank <mblank@google.com>
Date:   Fri May 29 14:23:01 2009 -0700

    Changes to EmailProvider

commit 84cced7b94bde4688ad986a45a6bf876cde3bdbe
Author: Marc Blank <mblank@google.com>
Date:   Fri May 29 14:02:20 2009 -0700

    Fix additional formatting issues.

commit 1faeb1763ba8a967fbf79ddbc48822af08c65a15
Author: Marc Blank <mblank@google.com>
Date:   Thu May 28 19:26:03 2009 -0700

    Changes in EmailStore.Account
    - Add isDefault column
    - Add status methods setDefaultAccount/getDefaultAccount

    Resubmit previous with formatting issues addressed.
2009-05-29 16:08:17 -07:00
The Android Open Source Project 96c5af40d6 auto import from //depot/cupcake/@135843 2009-03-03 19:32:22 -08:00
The Android Open Source Project 8c2158a5eb auto import from //depot/cupcake/@135843 2009-03-03 18:28:50 -08:00
The Android Open Source Project 687f9962d7 Code drop from //branches/cupcake/...@124589 2008-12-17 18:05:56 -08:00
The Android Open Source Project 8978aac197 Initial Contribution 2008-10-21 07:00:00 -07:00