Commit Graph

57 Commits

Author SHA1 Message Date
Todd Kennedy 040ddf60cf Resolve build warnings; part 5
Remove dependence upon URIs for creating the host auth structure

Change-Id: I92dee36fa329a8976b76bbd4991ed3469c6475f2
2011-02-16 17:38:31 -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 f020910461 Fix Account Manager integration
* Rework the interaction with the Account Manager
* Remove unneeded call to response.onRequestContinued()
* Store response in SetupData so it can survive the entire account
  setup flow.
* Explicitly report exit status to acct mgr at known exit points:
  * AccountSetupBasics.finish() (fail/cancel)
  * AccountSetupOptions.finish() (fail/cancel)
  * AccountSetupOptions.optionsComplete() (success)

Bug: 3335128
Change-Id: Ia55724eb1e938f2633c5ff7afb719a879be16a1b
2011-01-26 11:16:56 -08:00
Andy Stadler a97faa25ac Discard result of Dupe Account check if paused
Fixes a potential race condition with a slow DB lookup and a
fast user (or monkey).

Bug: 3384992
Change-Id: I0602820e1d9f49eb01b09c9d78db3d0fc47ccfb1
2011-01-25 23:18:45 -08:00
Andy Stadler 858c282277 Handle leading/trailing space in passwords
* Allow, but provide warnings via EditText.setError()
* Remove one last instance of password trim()

Bug: 2981433
Change-Id: I406a4f8b8f27cc5ce90424a8cafe88a677e72f45
Signed-off-by: Andy Stadler <stadler@google.com>
2011-01-19 16:40:15 -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
Dianne Hackborn 31e2576791 Follow API changes.
Change-Id: I1ca0fe365b953fa98a462912309a1c9647277ba7
2011-01-17 16:24:00 -08:00
Brett Chabot ea4c564261 Use new public API to protect force account creation.
Check value of ActivityManager.isRunningInTestHarness() before allowing force
account creation, instead of ActivityManager.isUserAMonkey().

Bug 3329873

Change-Id: I5028eef9caced2cacc9c187dfd746865939fdedd
2011-01-09 15:25:52 -08:00
Andy Stadler 8b5cd2beff Remove UI thread access in AccountSetupBasics
* Move getOwnerName to a FutureTask
* Use AsyncTask for call to Utility.findExistingAccount()

Change-Id: I85e35a12cc28b1dda8a0ccd930869316032a3b12
2011-01-03 23:07:25 -08:00
Andy Stadler 3dedc8b191 Defragment AccountSetupBasics
* This was an early attempt at fragmentation
* But it turned out that no fragment was needed here - it is
  not shared or reused in any way.
* Precursor to doing final layouts for the activity.
* Tested working:
    Automatic provider lookup
    Manual
    POP/IMAP and EAS flow modes (from accounts & sync)
    Force account creation intent
    Provider note
    Duplicate account detection

Change-Id: I434edd4b152391d36e70440873932db3ec1a1c99
2010-12-09 11:05:34 -08:00
Andy Stadler 6175300474 Allow non-monkey creation of test accounts
* Set the debugging flag to allow it
* Add STOPSHIP (it cannot go out like this)

Bug: 2735784
Change-Id: Id5d162f7f1879b76004a24d5d81e769b06ef8d29
2010-12-08 16:43:23 -08:00
Andy Stadler d685b469c7 Add magic intent to force account creation
* Add entry point via com.android.email.CREATE_ACCOUNT
* Enable when in monkey mode only
* Walks through setup screens as if auto-populated and as if
  connection checking always succeeds.
* Refactored some common code in AccountSetupBasicsFragment
* Removed obsolete commentary about auto-population of EAS accts
* Also fix minor typo in FLOW_MODE_ACCOUNT_MANAGER_POP_IMAP

Bug: 2735784
Change-Id: Ie7363836cd267673e963e60ae8bc32cab422576e
2010-12-04 22:53:59 -08:00
Andy Stadler 7988164ddf First pass of XL account setup
* AccountSetupBasics now has an XL version
* This is from prelim wireframes
* Final colors, text size, and positioning all TBD
* Fixed a StrictMode violation (counting #accounts in onCreate)
* Lightweight (non-shippable) fixes for functional phone UX

Bug: 3188940
Change-Id: Idf6cb514208eba07eaa20b20abfd5fcc3dae1751
2010-11-14 21:16:49 -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
Daisuke Miyakawa 43f2321d10 Modify code style.
Change-Id: I40eeb738ca2dcc7f21ddbc603b03debde5ac27d3
2010-10-10 15:17:52 -07:00
Daisuke Miyakawa 9dac94975f Use AccountAuthenticatorResponse properly.
Current implementation ignores callbacks coming from
AccountManager, which should be called everytime
when this Activity finishes its job.

Bug: 3069222
Change-Id: Iea03cf94bdfe8da184e415bf7e759ddeb46ecdd9
2010-10-08 16:16:43 -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
Andrew Stadler 8bcb572ccf Convert setup to actionbars, and holo theme
* All setup activities given UI makeover:
  * Remove legacy themes from manifest - exposes default holo theme
  * Remove bottom row button(s)
  * Replace with action bar button(s)
* No change to workflow or activity/fragment organization

Change-Id: I07ce11a0a2b4b767b5ac111d466e68400fe0f30b
2010-09-08 23:27:05 -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
Andrew Stadler 1b156352f3 Fragmentize Incoming settings (IMAP/POP server)
Also, extract DuplicateAccountDialogFragment for reuse.

Change-Id: I042a158e264d949024347d477d6e9ec999c244d3
2010-08-10 14:28:20 -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
Andrew Stadler a75bab5504 Fragmentize AccountSetupBasics
Change-Id: I99eb4cd4f8aa80d25a01d720244ccee599cba1d8
2010-08-09 22:44:41 -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
Makoto Onuki 42e3f10a95 Use "*#*#36245#*#*" to activate the debug screen.
Dial *#*#36245#*#* on the dialer to activate the debug screen.
"36245" = "email"

It's useful when
- There's no keyboard.
- There's no account set up yet.
  (You can do it by entering the special username/password on new account
  screen, but that's a bit of a pain.)

It's also easier to tell to people.

Also, removed "sensitive logging", which should never be used.

Change-Id: Id692f8b216f2d85abe1880c452d2067f170dac83
2010-07-01 16:15:07 -07:00
Marc Blank 9d387ff0bb Fix validation use of FolderSync
* To avoid having to use a mock deviceId with FolderSync in validation, we now
  simply use the real deviceId with the correct SyncKey ("0" for a new account,
  or the actual sync key if the account already exists)
* Rework utility code that finds existing accounts
* Write unit test for findExistingAccount

Bug: 2589243
Change-Id: Ia532b2e209aec3aa01ca06617b4da78c3d986b32
2010-05-28 10:48:17 -07:00
Andrew Stadler 63ab9de1b8 Partial solution to make EAS setup respect "manual"
* Track whether the user clicked "manual" vs. clicking next (and falling
  into "manual" because the account is not found in the providers list.
  Convert this into an "allowAutoDiscover" parameter.
* Pass "allowAutoDiscover" down into AccountSetupAccountType and through
    into AccountSetupExchange.  (Note, it's unused/ignored for POP & IMAP
    accounts and should not affect them.)
* In AccountSetupExchange, use the existing EXTRA_DISABLE_AUTO_DISCOVER
    (previously only for testing) to suppress autodiscover in manual mode.

Bug: 2570919
Change-Id: I2583e00d1e6cc26bbd4b85134eddae8cc3a1f91e
2010-04-05 19:08:05 -07:00
Andrew Stadler 9f73249031 Continuing work on account migration
* Prune all folders, messages & attachments that won't migrate
* Clean up SSL/TLS values for better connection results & security
* Move account setup lookup code to AccountSettingsUtils to share it
* Cleanup config/auto-rotation settings to prevent relaunch of
  auto-discover or account check (from exchange).
* A couple of other very small fixes

Bug: 2065528
2010-03-03 22:19:41 -08:00
Andrew Stadler ecb1af8041 Finish up IMAP ID implementation
* scrub all external strings to keep them compliant for IMAP protocol
* move Build.MODEL to x-android-device-model
* send x-android-mobile-net-operator
* send AGUID
* unit tests for above
* retrieve providers from VendorPolicyLoader

Bug: 2332183
2010-02-01 15:53:46 -08:00
Makoto Onuki e5c3c98e9a Fix confusing setup screen title.
Change the title of the screen for adding an exchange account from "Set up email" to "Add an Exchange account".

Bug: 2159019
2010-02-01 14:24:38 -08:00
Makoto Onuki f613489663 Add "vendor policy" loader, and alternate exchange descriptive text.
- Dynamically switch to the alternate exchange strings to substitute overlays.
- Added the mechanism to load the "vendor policy", which tells you when the
  alternate strings should be used.

Bug: 2382710
2010-01-27 17:40:56 -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 17da1767e3 Implement Autodiscover for Exchange servers
* Autodiscover allows complete configuration using only email address
  and password
* Code handles the two standard autodiscover addresses and redirect
* Autodiscover process starts when the user chooses "Exchange" as the
  account type.  If the account is created via the AccountManager,
  autodiscover begins upon tapping "Next" for the first time
* If autodiscover fails due to anything other than auth failure for
  autodiscover-capable servers, the user is placed into the standard manual
  configuration screen

Bug: 2366019
Change-Id: I936712b924833d9a133e8da04e11c3ba45d92f92
2010-01-13 17:11:49 -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 e1145d1739 In EAS flow mode, don't try to use auto-setup (fixes #2143583)
Change-Id: I53a287d909fdde3c6ab75087a4a049c3afe9852c
2009-09-24 11:58:11 -07:00
Andrew Stadler 8067b54294 UI cleanups for new account creation
* Improve appearance of basics screen and use simplified text
* Provide alternate text when in EAS account setup flow (from acct mgr)
* Change "Exchange/ActiveSync" button to "Exchange account"
* Add some spacing to the three buttons, to improve appearance

Bugs addressed:
2128055 Change string in account picker activity to Exchange
2132713 Welcome message for Email app is inappropriate when coming from
          Settings -> Accounts & sync -> New account
2009-09-20 17:26:43 -07:00
Andrew Stadler da8836a76c Give warnings if dupe account created:
* Check for existing accounts with matching servername + username
* Show a dialog and block account creation
* Triggers in three cases:
  * After input of an auto-setup account (e.g. Gmail or AOL)
  * After input of manual setup (incoming) parameters
  * After changing incoming parameters of *any* existing account
* Made some notes in EmailContent regarding fields in HostAuth that we
    are not actually using.
* Added HostAuth unit tests

Primarily fixes bug # 1964449
Bonus fix for bug # 1594408

Change-Id: I49310faf6654280582e0ab3d3e40f2701bfcd21d
2009-09-15 16:33:44 -07:00
Jeff Hamilton d382107bdc Don't try to load the owner info for now, it's not available. 2009-08-20 22:51:26 -05:00
Andrew Stadler bcff14acf2 Create setup flow for use by Accounts manager.
* Create a new entry point for the exchange setup flow and switch
    EASAuthenticatorService to call it
* Pass "eas flow mode" down through the setup screens
* Slightly modify their behavior as we go (e.g. we skip the
    (account type" screen since we know it's EAS.)
* Add a checkbox to "sync contacts from this account" and pass that
    value into ExchangeStore when we set up the account.
* Change the flow exit to pop back to the account manager instead of
    taking the user to the new inbox.

This CL satisfies cases 1 & 2 of bug # 1974752.
2009-08-20 15:51:36 -07:00
Jeff Hamilton fb67ec958c Handle null cursors when looking up owner info. 2009-08-19 12:26:44 -05:00
Marc Blank cc402e42ab Clear error states on network reconnect; add temporary notifications; see details
* When we get a network connect broadcast, clear error states so sync can
  restart for any boxes in an error state
* Add temporary notification code for the testers
* Add file-based debug logger
* Add Exchange logging to debug screen (adds additional exchange debugging)
* Add Exchange sd card logging to debug screen (logs to sd card)
* Change setLogging service API to send an int rather than a boolean
* Make sure push mailboxes are set up again when account changes to push
* Make sure push mailboxes are set up again when account mailbox starts
* (Fixed contacts sync bug found during debugging these changes)
2009-08-09 21:20:47 -07:00
Mihai Preda a5af05f1a9 MessageCompose: load body.
- load body for edit-draft, replay, forward.
- fix debug secret code for no-keyboard devices.
- fix CR-LF BUG 1911254.
- fix menu invoke compose from folder with mailboxId < 0.
2009-08-06 11:40:42 +02:00
Mihai Preda 180d69e085 Fix UnsupportedOperationException in AccountSetupBasic caused by Account.update() when !isSaved().
Bug 2001896.
Introduced by CL 8158.
2009-07-27 20:56:43 +02:00
Andrew Stadler 9e2c6bd5f2 Remove saveOrUpdate from EmailContent to prevent stale writes
* Numerous classes modified to deal with this change
  * Fixes bugs 1993292 and 1994671
  * Renamed various setter and getter methods to reflect the underlying
    field names
  * Renamed syncFrequency to syncInterval in Account and Mailbox
  * Convenience method added to AccountSettings to save only user settings
  * Calls to content.update(context, content.toContentValues()), which save
    all fields, should be double-checked for correctness, making sure that
    content has current data and will not conflict with other threads that
    might modify that data
  * Ran all unit tests to confirm proper function

NOTE:  The logic to enforce single default account no longer works,
because that logic is in Account.save() and does not run via
Account.update().  I have patched out a small section of the relevant unit
test and will file a bug to come back for this fix.
2009-07-22 15:13:30 -07:00
Andrew Stadler 54c1f2bf9a Improvements to default account handling
* Remove all references to Account.mIsDefault, which was not the right
    way to find the default account (it is lazy initialized)
* Change Account.getDefaultAccount to getDefaultAccountId, which is more
    efficient and suitable in most uses.
* Wrote unit tests for provider default account handling

This should resolve bug 1983390 as well as a few other issues with default
account management.
2009-07-21 16:44:16 -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 294a4fd0c6 Enable creation of new accounts using provider-based accounts.
What works:
* Editing existing accounts
* Create new accounts
* Checking account settings against server

What breaks (in approx order of planned fixes)
* Some details of account editing
* Viewing mailboxes & messages
* Mail sync using accounts
* Import of existing accounts
2009-06-05 16:09:18 -07:00
Andy Stadler d505973178 AI 144522: am: CL 144520 General cleanup after the integrations in CL 143018. Some spelling
errors, inconsistencies in passing Application/Activity/Context, and
  some error handling cleanups.  These are all changes that would have
  probably been made before the original submits, but I didn't want
  to fix them in the integration step.
  Original author: stadler

Automated import of CL 144522
2009-04-03 15:42:31 -07:00