Commit Graph

894 Commits

Author SHA1 Message Date
Marc Blank 2fabab32b9 Don't require sSyncLock for sync error map
* Use ConcurrentHashMap; check that this provides enough protection
  for all uses
* This resolves known deadlock issues in ExchangeService

Bug: 3371039

Change-Id: Ie4ccbe7cdfe8c3d4ec7a0f789409126c8c09f8c4
2011-01-21 18:14:04 -08:00
Makoto Onuki 6833fd5ab6 AttachmentProvider: Always return mime-types in lowercase
Intent-filter's mime-type matching is case-sensitive.  We should always use
lowercase letters.

Bug 3375709

Change-Id: Idd4abb41f94c816a5b9150aef5859dd75487a042
2011-01-21 14:56:01 -08:00
Makoto Onuki 7093746dd5 Don't modify content URI to non-email providers
The "?limit=" param is only supported by EmailProvider, so don't add
it to other URIs.

Doing so causes a permission error when opening an EML attachment on gmail,
because we're granted the permission only to the passed URI, but not to
the URI with the "?limit=" param.

Bug 3371630

Change-Id: I88fff88a7e48e5bc958124eedec3e592978a40c7
2011-01-20 16:28:36 -08:00
Marc Blank 6c9911e3fb Merge "Strip content of the "head" tag" into honeycomb 2011-01-20 14:38:26 -08:00
Marc Blank 9dc8ba5cad Strip content of the "head" tag
Bug: 3285281
Change-Id: I1183697ad09fbf8740e3529fecfa59cf6650b2f9
2011-01-20 14:31:09 -08:00
Todd Kennedy 02ba344cf2 Only show messages from inbox for account & unread views
Use a sub-selection to limit the messages from the inbox. Also add a unit
test to ensure the selections are working correctly.

bug 3368613

Change-Id: Ia24ef6028ded27c69f982ecbc6b67f35f84d1b6d
2011-01-20 13:20:12 -08:00
Andy Stadler be6910e7a4 Merge "Properly handle unsupported encryption policy" into honeycomb 2011-01-19 12:01:56 -08:00
Andy Stadler a0d080558f Properly handle unsupported encryption policy
* This fixes the case of:
  * a device that does *not* support device encryption
  * connecting to an account that *does* require device encryption
  * but also supports "non-provisioned devices" (making the encryption
    requirement optional.)
* Added unit test

Bug: 3367191
Change-Id: I894e68c4119a102dad02d2e0815fccdae1e87189
2011-01-19 11:40:48 -08:00
Todd Kennedy 3db3e4b795 widget combined inbox view only shows messages in inbox
instead of showing all messages (e.g. messages in drafts, etc...) the "combined
inbox" view now only messages in the inbox folder. This is now identical to
the "combined inbox" view available in the full email UI.

bug 3368613

Change-Id: I0080b56cd2718a3dce82b279277c63c4f43e86dc
2011-01-19 11:27:41 -08:00
Marc Blank 0324017aa0 Fix another case of HTML leakage in snippets
* Add test for this case

Bug: 3285281
Change-Id: If45d33624ac5dbd16d28b45428be29e5a8c51046
2011-01-19 10:59:29 -08:00
Andy Stadler 946239e8a0 Add per-account preference for bkgnd attachments
* Add flag to Account record
* Add checkbox to Account Settings (IMAP & EAS)
* Add checkbox to Account Setup (IMAP & EAS)
* Add flag to backup/restore logic
* Update Account & AccountSetupOptions unit tests

Bug: 3360873
Change-Id: I0c407776ede4110f33716644f6f027938f21130a
2011-01-18 10:53:37 -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 ad8c6c2e60 Merge "Fix LocalStoreUnitTests" into honeycomb 2011-01-17 10:37:57 -08:00
Makoto Onuki 36f2088408 Fix LocalStoreUnitTests
The problem was that we tried to upgrade the db by re-creating a LocalStore,
without closing the existing connection.  The db was still upgraded on the
filesystem, but the old connection kept looking at the old table definition
for whatever reason.

Also cleaned up checkAllTablesFound().  It now shows what columns are
missing when failed.

Bug 3349973

Change-Id: I80f4c67f1bd61cd5e1f12a632978b36a6e0a3b19
2011-01-14 14:36:01 -08:00
Makoto Onuki 31d263d38c Fix UtilityMediumTests
Bug 3353967

Change-Id: I7cdac5f6d4f3008c7ceaf9a8f0520524c9ea16f5
2011-01-14 13:04:19 -08:00
Makoto Onuki d072f9905d Don't show trashed messages in Starred mailbox
Also show the *total* starred message count (excluding trashed starred)
in the mailbox list, not *per-account* starred count.

Bug 3346872
Bug 2149412

Change-Id: I2274f215f994b62280ac6138982b927cec22c677
2011-01-13 15:41:22 -08:00
Andy Stadler 4f721a1625 Merge "Add encryption to SecurityPolicy" into honeycomb 2011-01-13 13:26:13 -08:00
Andy Stadler 469f2987dc Add encryption to SecurityPolicy
* Add encrypted-storage to uses-policies
* Add new field to PolicySet
* Add "false" to all constructor callers
* Add unit tests (including fixing some existing unit tests)
* Add new logic to AccountSecurity activity t0 dispatch both password
  and encryption requests.

Bug: 3346641
Change-Id: I54f39bc9b6fbe21c033a05b36b83081e5c78a296
2011-01-13 13:12:55 -08:00
Makoto Onuki ffdb8a7ea9 Merge "Fix "load more messages"" into honeycomb 2011-01-13 10:43:03 -08:00
Makoto Onuki a796fbab02 Fix "load more messages"
Was simply broken.

Bug 3347062

Change-Id: Ic8d16be377ee5a9871f0019a0b008a4de2390f15
2011-01-12 17:47:26 -08:00
Marc Blank 5a8be8e7ed Properly handle style (and similar) tags in HTML snippets
Bug: 3285281
Change-Id: Ia45dbe39b47f1bcb647efbf1860ed4b933976df8
2011-01-12 16:21:01 -08:00
Makoto Onuki 9c0da8b84f Don't show starred mailbox, if account has no starred
Bug 3334963

Change-Id: I751e56731b990a6e94b8547a577a84c1a848cbc7
2011-01-11 16:45:05 -08:00
Andy Stadler 86753bc41c Update file type acceptance rules
* Open up all types for view/save rules
* Add anti-malware block list (based on extensions)
* Clean up code that shows/hides view & save buttons
* Redo handling of load/cancel 1sec timer
* Unit test for new little utility
* Allow larger items when on wifi

Bug: 3338984
Bug: 3334950
Bug: 3338988
Bug: 3340835

Change-Id: I991135636d507f2660e2860720dbed21bd1a955b
2011-01-11 14:40:41 -08:00
Makoto Onuki a826d3fb03 Pixel perfect: Message view
Still waiting for a few missing assets, but it's done other than that.

The divider change is already merged; new layouts all use the framework style.

It's basically all layout changes, except for:
- Now the recepient address line has "Show details", which shows a dialog with
  all to/cc/bcc addresses with the timestamp.
- Now invite response buttons are checkboxes.
  (But the basic behavior doesn't change -- once you check a response,
  the message will be gone, so you can't change the response later.)

Copied message_header_bg from gmail manuall.  It'll look silly without it.

Bug 3138021
Bug 3307021

Change-Id: I6f7eb91d6104c3143a5c58b0c4c6c19929cea477
2011-01-10 15:51:32 -08:00
Marc Blank d9d120bfe4 Merge "Fix issues w/ security-related account data deletion" into honeycomb 2011-01-09 18:25:53 -08:00
Marc Blank 69af769688 Fix issues w/ security-related account data deletion
* Stop running syncs
* Delete all EmailProvider data except the account itself (with
  cleared sync key) and the account mailbox (necessary for syncing
  to sync after security hold is lifted

Bug: 3245779
Bug: 3253952
Change-Id: Idc208ef5ed85808b085ebab9c26a428fb0451e34
2011-01-09 18:24:35 -08:00
Marc Blank d6ce2998f7 Merge "Fix widget view switching with > 1 account" into honeycomb 2011-01-07 16:01:49 -08:00
Marc Blank dc3f9f4d69 Fix widget view switching with > 1 account
* Add test case for view switching

Bug: 3329906
Change-Id: I738bad118d7d7a8d2839fbd2a9fdc00af2af3153
2011-01-07 13:20:48 -08:00
Todd Kennedy 5faff6c76a Merge "Use new holo light icons" into honeycomb 2011-01-06 13:58:18 -08:00
Todd Kennedy 64ac7a6cc8 Use new holo light icons
Use the new icons where appropriate. This is not a complete change as there are
still some icons missing.

Change-Id: I51d1458749343ddfc6456dc2a9853b8bc2540e26
2011-01-06 13:42:20 -08:00
Andy Stadler 201a24f51e Harden MailService against half-created accounts
* Add simple sanity checks to scanned accounts, skip over if bad
* Fix existing unit tests and add new unit test for this change
* Also fixed minor bug in EmailContent that was never triggered in
  production code (only discovered it via a unit test).
* Also fixed minor bug in an existing unit test

Bug: 2937595
Change-Id: Id60bbb5d8bd923db043d46891c7f89d7debb0a11
2011-01-06 12:53:40 -08:00
Andy Stadler f252d5d95e am 42749c91: am 1a791e67: Fix NPE when switching IMAP into TLS
* commit '42749c9105c663e035a0863d7a6bda111b5c7112':
  Fix NPE when switching IMAP into TLS
2011-01-05 08:10:26 -08:00
Andy Stadler 1a791e675b Fix NPE when switching IMAP into TLS
* Update MockTransport to allow TLS connections
* Test TLS connection in ImapStore unit tests
* The bugfix: Re-query capabilities after closing/reopening parser for TLS

(Note: Actually, this is required by the IMAP RFC 3501, 6.2.1)

Bug: 3315939
Change-Id: I51f838043e87750b5712a1bd2e4f9c821b58c808
2011-01-04 20:21:15 -08:00
Marc Blank 99de346ed3 Merge "Handle query with an id of -1 more gracefully" 2011-01-04 11:17:42 -08:00
Marc Blank cbdd9f78b2 Distinguish mailbox requests that are user requested
Bug: 3251757
Change-Id: Ie417ebf44c8b740db88e5854077782930359a958
2010-12-31 11:02:03 -08:00
Marc Blank d306ba3438 Handle query with an id of -1 more gracefully
* In query of an otherwise valid URI with -1 as an id, simply return
  an empty cursor
* Add unit test to verify proper handling of invalid uri's

Bug: 3183245
Bug: 3292080

Change-Id: Ia0c35cbd0f5dd0dc4a8fc794226399644cf1fe13
2010-12-30 15:02:43 -08:00
Makoto Onuki adbb6f8bc4 Log cursor/adapter class name and such when detecting a crash
Also log where the cursor was closed, if it is.

To investigate bug 3308465 and bug 3305706

Change-Id: I2b0fd9ea14757b6cf7597cd7162686d050d43fe9
2010-12-23 16:15:44 -08:00
Andy Stadler 2959a7e073 Fix ANRs from Email.setServicesEnabled()
* Create sync & async versions
* Rename all callsites so sync is very apparent
* Fix callsites appropriately
* Clean up interaction between reconciler and setServicesEnabled

Bug: 3133770
Bug: 3134677
Change-Id: Iefbc7814d9aa390baea6345e450e2a4768bf0a9a
2010-12-23 13:19:55 -08:00
Andy Stadler 3b1cccf234 Async code for read/unread and starred
* Move each worker into async (combining common code)
* Update unit tests to match
* Make the message->account->controller lookups more efficient

Bug: 3134653
Change-Id: Icc82998a5d8eb07c7ebc7edbd28cd9308378d866
2010-12-23 09:55:16 -08:00
Andy Stadler 6ebaa90847 Reduce/eliminate UI thread access in MailService
* Make most calls to AccountBackupRestore return immediately w/o DB access
* Move most workers in MailService into async runnables
* Remove account restore / null check from ACTION_SEND_PENDING_EMAIL
* Strengthened unit test on Mailbox.findMailboxOfType() because after
  removing the account check (above), sendPendingMessages depends on
  findMailboxOfType() returning -1 on a missing account.
* Clean up a bunch of warnings (no longer use deprecated Config.LOGD)

Bug: 3133763  (and probably others)
Change-Id: Id39707bca7a8ebf5000f84d542013411ff0f422e
2010-12-22 16:34:48 -08:00
Marc Blank edb05ca5ee Harden AttachmentDownloadService; fix storage calculation
Bug: 3292720
Bug: 3286634

Change-Id: I378aac369ee8317c0c41b1f021a3731b81bcb380
2010-12-17 11:28:18 -08:00
Andy Stadler e3a17f1438 Restrict download/display to "attachment" and "inline"
* Check content-disposition and restrict to these two types
* Add unit test
* Reformatting collectParts (code style cleanup)

Bug: 3242502
Change-Id: I5dcbdda5d4788502113771f4fd1b5fff834a402d
2010-12-15 11:36:02 -08:00
Makoto Onuki 9afd6bc59f Merge "Fix unit tests" 2010-12-13 16:45:50 -08:00
Makoto Onuki c849936a36 Fix unit tests
- Now ProviderContextSetupHelper.getProviderContext() invalidates DB cache

* MailboxAccountLoaderTestCase
- Save hostauth properly
- (ProviderContextSetupHelper invalidates cache before each test)

Bug 3280911

* SmtpSenderUnitTests
- Use ProviderContextSetupHelper to create isolated context,
  which now also invalidates DB cache

Bug 3280913

* MailboxFinderTest
- When kicking Controller.Result methods directly from tests,
  call the raw callback, rather than the one wrapped with
  ControllerResultUiThreadWrapper, to make it synchronous.

Bug 3280898

* MessageViewTest
- Disable testOpenMessage()
  This test doesn't work because it sets up test data in an isolated
  context but the activity/fragment don't see them because they
  use the real context.
  I have no idea why it worked before... Maybe because there were
  accounts/mailbox/message with the same ID in the DB by chance.

Bug 3280905

Change-Id: I6beb08c58fff102e90bebd2c35f70820268b9e62
2010-12-13 16:29:57 -08:00
Marc Blank 04fb27841c Merge "Fix unit tests" 2010-12-13 15:33:30 -08:00
Marc Blank 75a873be84 Implement prefetch of IMAP/EAS attachments
* Load attachments in the background for IMAP/EAS messages
* Download an attachment from account X if:
  1) 25% of total storage free
  2) Attachments for X use < 1/N of 25% of total storage, where N is
     the number of AccountManager accounts
* Add accountKey to Attachment table for performance

Change-Id: I913aa710f34f48fcc4210ddf77393ab38323fe59
2010-12-13 15:32:57 -08:00
Marc Blank 171b9cb1f5 Fix unit tests
Bug: 3280929
Bug: 3280926
Bug: 3280921
Change-Id: Id81baecf6f1f0c7fedd9d6d623f664f49861fb25
2010-12-13 15:29:33 -08:00
Makoto Onuki 23d6d9cf24 Merge "Controller.Result callbacks should all have accountId" 2010-12-13 10:50:18 -08:00
Makoto Onuki aef9515ee7 Controller.Result callbacks should all have accountId
- Added accountId to loadAttachmentCallback/loadMessageForViewCallback

- Cleaned up LegacyListener/MessagingListener.
  Removed the constructors which take messageId and attachmentId, which
  are used to bridge loadAttachmentProgress, which the callsite doesn't know
  these IDs.  The inconsistency (only loadAttachmentProgress() uses the member
  messageId) doesn't look too good, so extracted this into a separate class,
  MessageRetrievalListenerBridge.

Change-Id: I46303e50df2b0e1fe8616e7c9cef632ac14f23aa
2010-12-10 18:11:44 -08:00
Andy Stadler c1e8c95d05 Fix two errors reported by continous test
* Add "ForTest" to skip ProGuard stripping
* Remove an unused method

Change-Id: I2af04f39bfafc3b3abd433f158363e37d9daccdd
2010-12-08 22:07:12 -08:00
Andy Stadler 3a4b9e140e Fix failing tests in AccountSetupExchange
A recent change was short-circuiting the logic that loads
the UI from the account.  This fix simply resets the flag
so the test can reload the UI multiple times as it tests things.

Change-Id: I7cc53e2766b78172e5a7b05088e94fdec99ae0d6
2010-12-08 00:22:23 -08:00
Makoto Onuki 74e094834c New style for the new message notification
Bug 3176956

Change-Id: Id7418fb8bb942230266815167f0a2e79062a9116
2010-12-06 14:51:19 -08:00
Marc Blank 3127277ad5 Merge "Never close underlying cursor if there are active users" 2010-12-03 12:02:36 -08:00
Marc Blank c159d32be0 Never close underlying cursor if there are active users
Bug: 3249537
Bug: 3238216
Change-Id: I281f0b0d6319adaffd78fe8e4c3da6f126eb71da
2010-12-03 12:01:59 -08:00
Makoto Onuki 9d5aaeacd6 Follow-up to Id18fb940. Tests, fix transaction.
Change-Id: If425db7d729e260102a9db82b98e14ff6f6be143
2010-12-03 10:55:27 -08:00
Andy Stadler d3a9ab946c Leave empty inbox when clearing out account.
* Makes things simpler for UI state on a wiped account
* Also wipe sync keys from remaining account & inbox
* Unit tests

Bug: 3245274
Bug: 3245779
Change-Id: I74cc6d7859dad54961426b70ffe0541ce49e3b91
2010-12-01 16:21:51 -08:00
Andy Stadler 1ca111c19c Add password expiration plumbing
* 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
2010-12-01 12:58:36 -08:00
Makoto Onuki d1ee5b8fa5 EML viewer: Set title, and show arrow next to the app icon
- Set "Viewing FILENAME" as title.
- Home icon now has "back" arrow.  Closes the activity when clicked.

Bug 3221312

Change-Id: I689499e10704d3c5d206df4aa12e21db9687c4c5
2010-12-01 11:35:09 -08:00
Makoto Onuki a19e003242 Merge "Fix UtilityUnitTests.testSpecialIcons" 2010-12-01 11:34:16 -08:00
Marc Blank 1832ea8c58 Merge "Don't throw exception on moveToPosition in CachedCursor" 2010-12-01 09:09:03 -08:00
Makoto Onuki ed0d19e887 Fix UtilityUnitTests.testSpecialIcons
Now non-special mailboxes on mailbox list doesn't have an icon, so
getIcon(Mailbox.TYPE_MAIL) should return null.

Change-Id: I354551baa4027c8e90c499dafac72423343c9cee
2010-11-30 17:34:55 -08:00
Marc Blank 68dc380d62 Don't throw exception on moveToPosition in CachedCursor
* Just return false

Bug: 3240290
Change-Id: I808ca88c7897c573d19c2c2c92b179b4106a6dd3
2010-11-30 12:38:52 -08:00
Andy Stadler e29189e3ee Cleanups to Controller & AttachmentProvider
* New method in AttachmentProvider to delete all attachments for an
  account, and unit test it.
* New method in Controller to delete all synced data for an account,
  and unit test it.
* Fixed existing problem with Controller unit tests (needed cache clear)
* Fixed existing problems in Controller (mContext vs. mProviderContext)

Bug: 3197935
Change-Id: I79c6a03c21f18d37eeb8158cd1c2af0e0a6e9d2e
2010-11-30 12:11:36 -08:00
Makoto Onuki 08e1f2f782 Don't show account dropdown when there's only 1 account.
Bug 3225851

Change-Id: I7b411f8047e3b26cfe53f17c46c3e2611fb8ae9d
2010-11-23 17:23:36 -08:00
Makoto Onuki 5b81690de1 Show color chips for combined view.
Show color chips for account rows and message items on the combined view.

Moved hard-coded color values to resource.

Bug 3138001

Change-Id: Ib93fb9d6e9592ebd0c297f83c3dee2358a80508f
2010-11-23 13:03:06 -08:00
Marc Blank cf3fb71bc6 Implement password expiration for EAS
* Hoist wipe() method from AbstractSyncParser to AbstractSyncAdapter
* Add deleteAccountPIMData(accountId) to the EmailService API
* Implement deleteAccountPIMData for EAS

Change-Id: I1037cde25fc2b24419f399446cfa0906dc0174d1
2010-11-22 11:17:00 -08:00
Marc Blank 349055aad4 Allow ProviderTests to work with ContentCache
Bug: 3204331
Change-Id: I5399345c2b759fb34d3dc7c694eb0eef8d7de493
2010-11-17 10:19:30 -08:00
Andy Stadler 2199c7ddf5 Minor cleanups for ContentCache
* Change CounterMap to not extend HashMap
* Renamed remove() to subtract()
* Comment out a failing test
* Add a flag that prevents any objects from being cached

Change-Id: I74754133b505178e8b0166390f69509f006a3da2
2010-11-16 22:49:04 -08:00
Marc Blank fab77f147f EmailProvider content caching
* In this CL, we cache individual rows, based on the CONTENT_PROJECTION
  defined for the most common queries (Account, HostAuth, Mailbox, and
  Message)
* Queries on individual rows (most often Class.restoreClassById()) will
  look to the cache first, rather than querying the database
* Queries on smaller projections will build MatrixCursor's from cached
  data
* Write-through caching updates the cache with changed columns
* Experiments with live data indicate that > 95% of queries that are
  cacheable (single row, no selection) can be retrieved from the cache,
  thereby saving a great deal of disk access.
* Timing experiments show that cache hits are > 40x faster than cache
  misses
* Unit tests for the various classes exist, with more coming

TODO
----
* More unit tests

Change-Id: I386a948a2f4cc02b6548d07d9b2fefd1e018a262
2010-11-16 08:58:05 -08:00
Makoto Onuki 2ac1eaf8c3 Account selector rework.
- Show email address
- Show inbox unread message count

Initially I thought of using a join to get accounts with their unread
counts with one query, but there were enough subtle issues that I gave up
on the idea.

Instead it uses a MatrixCursor to build a completely new cursor,
based on a regular accounts cursor.

Change-Id: I09e8762f131cc2bd3637e1a3d302088a3b5b2479
2010-11-10 17:41:29 -08:00
Makoto Onuki 77303a483b Merge "New message view command layout" 2010-11-10 14:09:38 -08:00
Makoto Onuki 931ca67a1f New message view command layout
UI Changes:
- "Move", "Delete" and "Mark as unread" became action bar commands.
- The message view bottom panel now only has "newer" and "older" buttons,
  with  the current position in the message list.  (shown as POS of TOTAL)
- The buttom panel is now shown only on portrait

Non UI changes
- MessageOrderManager now keeps track of the current cursor position
  as well as the total message count.

- Fixed the "move_action" string, which was wrongly marked as non-translatable.

Bug 3169454

Change-Id: I599543f9e11000a4ee283d31fbd407b2ab53ac44
2010-11-10 11:08:14 -08:00
Makoto Onuki 6f3d167cfa Don't show non-incoming message in notification.
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
2010-11-10 10:22:41 -08:00
Andy Stadler 54ab7a27a3 Fix NPE in pop3 checkcapabilities
* This happens if an open fails immediately (error message in the
  initial banner) followed by a checkSettings.
* The fix is to harden checkSettings to force a clean connection
  every time.

Bug: 2170147
Change-Id: If7403bf517477d2b03b21d71caab511fe45e234c
2010-11-04 23:34:26 -07:00
Andy Stadler ba4e72a947 Cleanup various IMAP/POP manual account setup defaults
These defaults affect manual setup only.  There should be no changes
observed in automatic setup, and no changes observed in EAS setup.

* user $email instead of $user as default login
* guess "imap." or "pop3." for server name
* propagate the incoming server name to the outgoing server name, and
  replace "imap.", "pop3." or "pop." with "smtp."

Also, fixed a couple of leftover places where we were trimming
passwords (and should not be, since some people insist on having
spaces in their passwords.)

Bug: 2978634
Change-Id: I9b0e345aa9550b5e1cc29aaa22109f03da61af20
2010-11-03 09:31:45 -07:00
Makoto Onuki 730cc6724a Add "Combined view".
- Don't show combined mailboxes with regular mailboxes in the mailbox list.
- Add "Combined view" to the account selector instead.
- "Combined view" has all the combined mailboxes and accounts.
- Renambed these combined boxes.  (e.g. "Combined inbox" -> "Inbox")
- Regular account view still has "Starred" mailbox, but it's actually
  "combined" and not per-account.
- Re-order special mailboxes per latest wireframe.

Bug 3138004

Change-Id: I4c5860c6774b10c55ba0ca599373e51105432cf8
2010-11-01 11:51:51 -07:00
Marc Blank 02d59d2194 Delete secured accounts if device admin is disabled
* Update unit test

Bug: 2817683
Change-Id: Ia7117c34e7bbba13ac4f2ff375d19b3ef94ef49c
2010-10-27 09:03:21 -07:00
Marc Blank 4a66884b74 Merge "Use notifications for login failures" 2010-10-27 08:57: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 be1aa37dc5 Don't use sendMailCallback() -- don't track outbox status
There're differences between how SMTP and EAS use this callback.
We should eventually unify the behavior, but till then let's not
use sendMailCallback().

Bug 3116377

Change-Id: Ic5ecf16251c11ab2bd2e16e29bd417f1ece67f14
2010-10-22 15:45:51 -07:00
Makoto Onuki 8c3629c978 Merge "Skip testCommaInserting if screen is off or locked." 2010-10-21 13:54:34 -07:00
Makoto Onuki e9919377ee Skip testCommaInserting if screen is off or locked.
sendKey() doesn't work if the screen is off or locked.

We could probably use a WakeLock and KeyguardLock to force the
screen to be on, but that'd require adding unnecessary permissions
to the email app. (not the test apk)

Bug 1737038

Change-Id: Ic036dc4d12770e82bc5de1133d6dd34cd8465f30
2010-10-21 13:51:46 -07:00
Makoto Onuki a44c0349fa Merge "Don't move drafts to trash" 2010-10-20 17:37:42 -07:00
Makoto Onuki 77aabd9519 Don't move drafts to trash
Now deleted drafts are really deleted, rather than getting moved to trash.

Also rewrote the test to avoid creating AsyncTasks on the test thread.
In this case it seems to be running fine, but I've had problems doing this
before.

Bug 3099179

Change-Id: Ice5298bf94312ce764d90aa35c5a6c5262ec5b42
2010-10-19 13:54:05 -07:00
Marc Blank eb49659423 Prevent MailService from spamming AccountManager during reconcile
* When any Account is modified, MailService gets a content notification and
  runs reconciliation in an AsyncTask.  Reconciliation ends up calling the
  AccountManager, which also runs asynchronously.  The net effect is that,
  especially during unit tests, where we create/destroy accounts rapidly,
  these calls can "back up", ending in a situation in which the worker pool
  for AsyncTask is filled, with a resulting RejectedExecutionException
* We fix this by preventing more than one request for reconciliation to
  be queued at a time
* Added a unit test that thrashes the notification handler

Bug: 2937628
Change-Id: Iaf25806efb46831f31704604360df091752d9525
2010-10-18 14:07:47 -07:00
Marc Blank 6af171cae6 Fix errors in MockProvider unit tests
Change-Id: Ibfe6d72547f182332fddf82a842a131f920f5e7f
2010-10-16 21:12:12 -07:00
Makoto Onuki 7fdd88e37c Merge "Put the dest mailbox name in the "message moved" toast" 2010-10-14 15:36:37 -07:00
Makoto Onuki ee7205d100 Put the dest mailbox name in the "message moved" toast
Also removed obsolete todo

Bug 3075984

Change-Id: I10ce9df29c4913c328d2a962151d4a9f2e6e1408
2010-10-14 15:14:46 -07:00
Makoto Onuki 9b5001a34c Don't use negative IDs with ListView
ListView uses the _id column for some operations, including
onSave/RestoreInstanceState, and if the column contains negative values
they don't work as expected.  The same assumption seems to be in other places
as well, so let's just avoid using negative IDs.

With this CL we now use two different IDs, one for ListView, which will
never be negative, and the other for us, the actual mailbox ID.

Bug 3049315

Change-Id: I263b4895212b5f8bb80c98acaf5c4eccd0bfef55
2010-10-14 14:42:46 -07:00
Andy Stadler efcde27bf7 Use original all-day flag when upsyncing exceptions DO NOT MERGE
Bug: 3087410
Backport of: I4bed0039758e98d4b85054876f192605eb00ee82

Change-Id: Ibc875d58c2f6c5317ce8e4fee97b96c2fd6b2ecf
2010-10-13 15:05:38 -07:00
Marc Blank 9ce8f4d2a3 Use original all-day flag when upsyncing exceptions
Bug: 3087410
Change-Id: I4bed0039758e98d4b85054876f192605eb00ee82
2010-10-13 14:10:36 -07:00
Marc Blank fde172f576 Fix CalendarSyncAdapterTests
Bug: 3077174
Change-Id: Ic0ba851969e852488a72241c8fba9f466c5bc3a6
2010-10-08 17:17:04 -07:00
Makoto Onuki 02a750dd64 Fix tests
Bug 3077014
Bug 2992255

Change-Id: I1e8127327158b0821177d0744a60132f89dccdd8
2010-10-08 14:53:40 -07:00
Marc Blank fe6e3eae2a Fix MailService unit test
Bug: 2844726
Change-Id: I168b3db49bf422b33d05f25cfff1c7be15150c2b
2010-10-07 14:34:50 -07:00
Makoto Onuki feb8869c4f Remove unused method Utility.getIconIds()
And redirected the related tests to getIcon().

Bug 2894555

Change-Id: I1d90f01e7476ca79bddd644e123ad979d6ebe987
2010-10-05 16:15:38 -07:00
Makoto Onuki 085f7eb121 Extract the throttling part from ThrottlingCursorLoader
Extracted into the Throttle class as I'll need this logic elsewhere.

Bonus: Now it has tests.

Change-Id: Ie9a5933f8e5015dda6985ba76814f1f945266178
2010-10-01 17:46:59 -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
Marc Blank 0efe738e05 Add Uri for Message queries that include a LIMIT
* Use a query parameter (e.g. ?limit=2); LIMIT works with any
  query

Change-Id: Idd106ab4b61aec237ac9676a201e797c4f65f15b
2010-09-28 10:58:36 -07:00
Andy Stadler ac916da48e Improve handling of content-disposition DO NOT MERGE
* Check array returned by split("=")
* Add unit tests for this case
* Also add unit tests for quoting removal

Bug: 3040796
Backport from: I170f3cd483fe35186194edeb0c3142fb0e2e9b75

Change-Id: I32ccbdbc7264a95a9cd279218cae390e65e82eeb
2010-09-27 15:16:24 -07:00
Andrew Stadler 87fcd03a1b Improve handling of content-disposition
* Check array returned by split("=")
* Add unit tests for this case
* Also add unit tests for quoting removal

Bug: 3040796
Change-Id: I170f3cd483fe35186194edeb0c3142fb0e2e9b75
2010-09-27 15:09:35 -07:00
Andy Stadler 02a0edb60d Allow spaces in passwords DO NOT MERGE
* Separate/identical fixes for incoming, outgoing, exchange
* Unit tests
* Some protocols will fail anyway (e.g. POP3)

Bug: 2981433
Backport from: I82984e5912fc7fcb88e747815d0fe33cb36605e7

Change-Id: I49d5c13137e4f78b6fa0f9ce288c1a78ff028f88
2010-09-27 13:31:04 -07:00
Andrew Stadler fb4333b3a5 Allow spaces in passwords
* Separate/identical fixes for incoming, outgoing, exchange
* Unit tests
* Some protocols will fail anyway (e.g. POP3)

TODO: Some sort of warning (master only - won't backport that)
Bug: 2981433

Change-Id: I82984e5912fc7fcb88e747815d0fe33cb36605e7
2010-09-27 10:04:03 -07:00
Makoto Onuki d25d87c7ba Fix NPE with use of getFirstRowXxx
Make sure not to cast null into a primitive type.
(i.e. If null isn't expected as a return value, make sure to set a non-null
default value.)

Bug 3032143

Change-Id: I9a344d765c75a66f529ad8d99b00b2b919139f9c
2010-09-24 16:59:51 -07:00
Marc Blank 224442906b Merge "Handle EAS type 1 folders (user-created)" 2010-09-24 16:54:57 -07:00
Marc Blank 23f8d3be7d Handle EAS type 1 folders (user-created)
* If a type 1 folder has an mail folder as a parent (at any level),
  it is also a mail folder (and therefore, we should have it in our
  folder list)
* Before rejecting type 1 folders, look for parents and accept those
  that are mail folders
* Add unit test to verify logic

Bug: 2978410
Change-Id: I44cda1d1c1fd7f3976af53a1672736201cc995ff
2010-09-24 12:46:08 -07:00
Makoto Onuki 4209ea36b0 Make ThrottlingCursorLoader smarter
Now the class initially uses smaller timeout, and expand it when detecting
multiple changes in a short period.

This CL makes the UI look more responsive especially on the message list +
message view mode.  e.g. Starring on the message view will quickly be
reflected to the message list.

Bug 3024799
Bug 3027832

Change-Id: Ie2d44c3769d43e3fd0f54ee526556eb3bad5e288
2010-09-22 18:01:01 -07:00
Andrew Stadler 0813c7051f resolved conflicts for merge of 0d9ed341 to master
Change-Id: I198f760ef1734cf4a64c875236a2352859dc1a72
2010-09-22 14:37:44 -07:00
Andy Stadler 16657c9c20 Merge "Fix test failures" into gingerbread 2010-09-22 13:18:52 -07:00
Andy Stadler 6278dcdeaf Fix test failures
Methods were used by tests only and being stripped by PG.

Bug: 2894378
Change-Id: Ieb1dd0daa8bd380c66a7b1e6151c5e5b22cbe38c
2010-09-22 12:06:41 -07:00
Marc Blank d46952e7b0 DO NOT MERGE: Test validity of port numbers in account setup
Bug: 1712475
Change-Id: Iced4875379a804b5072e4df0af25db7bf9473131
2010-09-21 17:46:15 -07:00
Makoto Onuki 0be6c7c5cf Merge "DO NOT MERGE: Fix handling IOException in ImapStore" into gingerbread 2010-09-21 10:24:48 -07:00
Makoto Onuki 32517753ea Merge "DO NOT MERGE: Handle multiple IMAP SEARCH results." into gingerbread 2010-09-21 10:24:44 -07:00
Makoto Onuki 75c6a611aa Merge "DO NOT MERGE: Test for interaction between ImapStore and vendor policy." into gingerbread 2010-09-21 10:24:40 -07:00
Makoto Onuki 7fbdc44c58 Merge "DO NOT MERGE: Extract MockVendorPolicy, add standard mechanism to inject it." into gingerbread 2010-09-21 10:24:36 -07:00
Makoto Onuki 415b27fbd3 Merge "DO NOT MERGE: Follow-up to the new IMAP parser." into gingerbread 2010-09-21 10:24:18 -07:00
Marc Blank ef70c9872b Merge "DO NOT MERGE: Send intro text with SmartForward" into gingerbread 2010-09-20 19:18:58 -07:00
Marc Blank 9afbf947de DO NOT MERGE: Send intro text with SmartForward
* We need to include the intro text (--Original Message--, etc.) to
  SmartForwards, and somehow this got in a past updat
* Add unit test for forwarding
* Fix unit test for reply so that it works localized

Backport of I8d92f00d37a434840ec3eb237f3901cd5dc7ad09

Bug: 2477988
Bug: 2685784
Change-Id: I2b6654413a8eb5ca900f958f49ec9eee5161a365
2010-09-20 18:51:32 -07:00
Marc Blank 6512458784 DO NOT MERGE: Make sure signature is added to reply/forward
* Add this to processSourceMessage in the reply/forward cases
* Add unit tests for reply and forward case

Backport of I6be8383fe5f217a4bda8e669cb69f439bc8e96b6

Bug: 2734321
Change-Id: Ia59e8c4e2f9663f2a10cff066eddeff80bc06cef
2010-09-20 18:48:07 -07:00
Makoto Onuki f255081a85 DO NOT MERGE: Fix handling IOException in ImapStore
- mConnection.destroyResponses() should be protected with
if (mConnection != null).
When we get an IOException, we close the connection and null it out in
ioExceptionHandler().  So mConnection can be null at any point after
where ioExceptionHandler() first appears.

- ioExceptionHandler should close its parent ImapFolder only if the argument
connection is mConnection.
Methods like exists() may pass an ImapConnection which is not mConnection
to ioExceptionHandler.  In which case we don't have to close the ImapFolder.

Bug 2898211

Backport of I8f9f45d91f596bb8da1a1575593e652d66deb643

Change-Id: I070458b5535540aba69ad7eee88bd2af8ad5f7b1
2010-09-20 16:45:48 -07:00
Makoto Onuki 29f0638f4d DO NOT MERGE: Handle multiple IMAP SEARCH results.
Apparently IMAP servers may return multiple SEARCH responses for a
single SEARCH command, and we need to handle all of them.

Before the IMAP rework there was 3 methods that issued the SEARCH command.
Two of them ware doing it right, but the other wasn't, which was what
I copied from, unfortunately!

In case you're wondering, originally the test for this method was done through
upper methods, e.g. getMessage().

Bug 2911647

Backport of Ia50072944d5b01c1e59541c3a966067b13910cc4

Change-Id: Iab5d3fa21e403f2e1043990112154fbb72322b02
2010-09-20 16:45:48 -07:00
Makoto Onuki 8aa79ba695 DO NOT MERGE: Test for interaction between ImapStore and vendor policy.
Backport of I092b3a0f2f40d9aa19f2f61066362099c8b3f50b

Change-Id: I492f975e66d67aae62024804a294e796f23d2aad
2010-09-20 16:45:48 -07:00
Makoto Onuki 618f1d8ac5 DO NOT MERGE: Extract MockVendorPolicy, add standard mechanism to inject it.
One thing that bothers me regarding the new ImapStore is that there is no
tests to verify if the way how getImapId() uses a vendor policy hasn't changed.
This part is hard to test with a real vendor policy, and it can easily be
overlooked even if it's broken.

This CL offers ImapStoreUnitTests a way to test the interaction between
getImapId() and a vendor policy.

Also fixed a bug in VendorPolicyLoaderTest where it assumed the test apk
package name is "com.android.email.tests", but it may actually be
"com.google.android.email.tests" now.  (Broken since the test makefile
used inherit-package.)

Backport of I8feb616ea28cb5cae5b4fba57e363771014ac599

Change-Id: I59536bc9a0e5c09c23eab21cdfb2f8283ef01a42
2010-09-20 16:45:48 -07:00
Makoto Onuki 57ab324a11 DO NOT MERGE: Follow-up to the new IMAP parser.
- Replace string literals in ImapStore with constants.
- Simplifies ImapStore.en/decodeFolderName
- Mix cases in the test data to test for case-insensitivity

Backport of I88424357227bcf78528df5e6a1c4ba45d54cc65b

Change-Id: I254fe82324f6ff530e40ca0cff7073f670cf9aa3
2010-09-20 16:45:48 -07:00
Makoto Onuki ff0712cb1e DO NOT MERGE: New IMAP parser to fix long-lasting problems.
- Almost completely re-wrote ImapResponseParser layer
- We no longer use simple ArrayList and String to represent
imap response.  We have classes for that.  (Type safe!)
These classes are also NPE-free.
(which isn't necessarily a good thing, though)
- A lot of clean-ups and fixes in ImapStore.
- More tests for ImapStore.

Now ImapResponseParser moved to com.android.email.mail.store.imap.parser,
but inside, it's 99% new code.

This CL introduces many new classes, but most of them are small classes
to represent the IMAP response.

Problems that this CL fixes includes:
- Special characters in OK response
- Handling BYE response
- Case sensitivity
- ClassCast/ArrayIndexOutOfBound/NumberFormatException
- Handling NIL/literals at any position

Bug 2480227
Bug 2244049
Bug 2138981
Bug 1351896
Bug 2591435
Bug 2173061
Bug 2370627
Bug 2524881
Bug 2525902
Bug 2538076

Backport of I7116f57fba079b8a5ef8d5439a9b3d9a9af8e6ed

Change-Id: I38b6da7b82110181dc78a2c63c6837c57afa81ae
2010-09-20 16:45:48 -07:00
Makoto Onuki 9d1b9fc784 DO NOT MERGE: Two new tests for the bottom half of ImapFolder.append().
They cover the cases:
- when OK response doesn't have APPENDUID.
- when APPEND fails.

Backport of I13a0fb8aaf2e1cbb5a1f055c9ce56e2891373ea0

Change-Id: Ifb5f8c07a8d956b0f4cc019eac7712ef22b0fa73
2010-09-20 16:45:47 -07:00
Makoto Onuki 286eafcf5f DO NOT MERGE: More tests for IMAP, clean up, and a few bug fixes.
- A few new tests in ImapStoreUnitTests.
- Added TODOs to ImapStoreUnitTests (for mainly NO response handling)
- Renamed ImapStore.releaseConnection to poolConnection.
- Fixed a bug in getConnection where it'd return a closed connection.
- Now getConnection() hanles BYE response for NOOP correctly and treat the
connection as closed.

Backport of I48e5b89049338f7d4f1ac77cd7ac7243945a9575

Change-Id: I529c6667a1e60c67285b7050b2b1e4b67eccc104
2010-09-20 16:45:47 -07:00
Makoto Onuki cd0b60e97a DO NOT MERGE: More test for ImapStore/ImapFolder.
- Also, fixed a potential crash in getMessages().
It could happen when a client is gettign a message list while
another client is removing messages.

Backport of I04b1de6bc384cffb7a5286bcec0a349a3d62a623

Change-Id: I227ecbf5bd68c999ba0ab8cd50ef798ef4ef35e4
2010-09-20 16:45:47 -07:00
Makoto Onuki a599ee773d DO NOT MERGE: Tests for IMAP FETCH
Adding regression test for the new IMAP parser.

Backport of Iac7f5c022e44ca5f06f735e145af15cc459eb61f

Change-Id: Ic84172b6793a9837c2fc4a894fee141da3d19f1d
2010-09-20 16:45:47 -07:00
Makoto Onuki 18d331898f Merge "DO NOT MERGE: Relax MIME date parser." into gingerbread 2010-09-20 16:44:06 -07:00
Makoto Onuki 090489b395 Merge "DO NOT MERGE: Fix flaky tests" into gingerbread 2010-09-20 16:43:48 -07:00
Andy Stadler be2ef97220 DO NOT MERGE Send local IP address with EHLO instead of "localhost".
Bug 1515345

Backport of: I181c9f0d79fbdf62f7df77f72a1ec9653797b6dd

Change-Id: If9da2d9f717814bff6a3aa7e6f1a0a44a49f34d6
2010-09-20 16:21:32 -07:00
Makoto Onuki a780e12db2 DO NOT MERGE: Relax MIME date parser.
Make the date parser accept invalid dates like
"Thu, 10 Dec 09 15:08:08 GMT-0700" which was observed in an email from eBay.

Per RFC, timezone must be either obs-zone (e.g. "GMT") or +/- with 4 digits.
The GMT+/-digits format is not permitted.

Bug 2367124

Backport of I59968274160aeadea70223208b463ee692660056

Change-Id: I3c80eee28d1dcf4c0c211f773a50de0f0839e4ad
2010-09-20 15:50:52 -07:00
Makoto Onuki a8a68b827d DO NOT MERGE: Fix flaky tests
Follow up to I3bf7d340.  Make sure temp directory is set before running tests.

Turned out Application.onCreate doesn't seem to be guaranteed to be run
before unit tests.

Without this, some tests may fail saying: "TempDirectory not set.
Application hasn't started??", if onCreate runs too late.

Backport of Ic5aee939a2c21f9579a643d0729dd0e9ba81022e

Change-Id: I7526e3205fc78a5eb79f0786b831c4f642cbda70
2010-09-20 15:50:49 -07:00
Makoto Onuki 7040017624 DO NOT MERGE: Add static method to get temp dir in Email.
I need to be able to get the temp dir from anywhere without Context
for the new IMAP parser.

Backport of I3bf7d34059399a8253c0760ebc392804ea434412

Change-Id: Idf7f8dffe9d6dd040d1b2311d053d4fc292ba18e
2010-09-20 14:06:50 -07:00
Marc Blank 74444e73c2 Remove GAL lookup dependency on running ExchangeService
Change-Id: I4ff4017bcbb29862e07fde63e2ac01e3552ccd83
2010-09-15 17:57:03 -07:00
Makoto Onuki 261d6c3f0c Notify only account cursors when resetting new msg count
- Resetting the new message count is now correctly done on a BG thread.
- Added special content provider URI to reset the count.
  (/resetNewMessageCount)
- This URI only supports update, which will notify only account
  cursors.
- Fixed a problem that an insert with MAILBOX_ID/MESSAGE_ID/ACCOUNT_ID
  triggers two notifications.

- This CL changes how we use notification URIs, but unfortunately
  no tests for this part.  It turned out MockContentResolver doesn't
  support the notification mechanism, which made it very hard
  to write tests.

Bug 2911646

Change-Id: I35b30a7e6bf2d57510486c7ed19b9f263d8c9b58
2010-09-15 10:53:17 -07:00
Makoto Onuki 5b0c2c7f34 Fix tests broken by I2bf5de4e (Clean-ups for EmailProvider)
My previous CL broke some tests.
- make sure to set 0 to unreadCount when adding a new row
- when updating messageCount in the tests, directly manipulate
  the DB.  (the provider no longer allows this)

Change-Id: Ib569349707007badf4f23600fbca37110c78fa6d
2010-09-10 14:37:01 -07:00
Makoto Onuki 7183724276 Don't check flagLoaded for outbox message list
We found a case where messages in outbox have flagLoaded=FLAG_LOADED_UNLOADED,
where it should be FLAG_LOADED_COMPLETE.  Haven't found the root problem, but
remove the flagLoaded test to mitigate the problem.

Also moved the buildMailboxIdSelection call to a worker thread.
(this method issues some queries.)

Bug 2984285

Change-Id: I2a5be300fb3da703698512262cc38bea75d0f7ba
2010-09-10 11:12:46 -07:00
Makoto Onuki b1ea9c3c12 Add quick contact badge to MessageView.
- Added "quick contact badge" to MessageView
- Removed PresenceUpdater, and added new implementation based
  on Loader, which is much simpler.
- Changed some text color, so they're visible now.

Bug 2988625

Change-Id: I688a3217178ee8fd0b7245c0ab36a633687ea525
2010-09-09 13:57:31 -07:00
Makoto Onuki 76a73d104d Merge "Cleanups for unbundling" 2010-09-09 11:24:29 -07:00
Makoto Onuki 697f98aea5 Cleanups for unbundling
* android.security is hidden.  Use java.security.MessageDigest instead.
* Remove android-common from makefile (we no longer use it)
* Add LOCAL_SDK_VERSION to makefile and comment it out

Change-Id: I7f9a021387d5c4e47ade1adb0bb75bec82ba0dd8
2010-09-09 10:46:52 -07:00
Andrew Stadler 4c3a8ede01 Quick fixes for account setup unit tests
Some of these broke in 8bcb572ccf
which changed the [Next] button to an ActionBar menu item.

However, the entirety of AccountSettingsXLTests needed to be disabled
because the PreferenceActivity is very different on phone or XL sized
devices, and the tests infrastructure will need to be refactored to deal
with that (on another day.)

Change-Id: I9adbfc9b8da6179e4c4e82d29bb872ee05619a41
2010-09-09 09:28:38 -07:00
Makoto Onuki 09ea19f184 Merge "Rewrite testGetFirstRowLong/Int" 2010-09-07 14:32:11 -07:00
Marc Blank e7b9e4ab94 Add snippets to messages
* Add 'snippet' column in Message table and handle upgrades to the
  new schema
* Generate a snippet from either HTML or plain-text message body,
  removing tags, extraneous whitespace, and other superfluous text
  along the way.  Store the snippet in the Message table
* Clean up MessagesAdapter to use the pre-existing list projection
  and constants
* Write unit tests for snippet creation
* The UI in this CL is always single-line, ellipsized

TODO: Handle two-line subject if portrait and XL

Change-Id: I84a2cbe10957975942edad6eb1255a726924a78a
2010-09-03 23:23:19 -07:00
Makoto Onuki 4cdae2b1b8 Rewrite testGetFirstRowLong/Int
They were overly-complicated, and even crashed with some framework changes.

Bug 2949312

Change-Id: Icf50bdf2333a32f3b79791f840c58ee0c58ead7f
2010-09-03 16:37:45 -07:00
Makoto Onuki 767f9fe2eb Implement batch move.
* UI is still temporary
* In this version, we check if the selected messages can be moved *after*
  you click "Move", rather than disabling the button beforehand.

Change-Id: Ief2864d2a513001847844963b2b0cb6b714e8667
2010-09-03 15:39:04 -07:00
Marc Blank 213c52dd64 Fix issues with handling FREQ=YEARLY in RRULEs
* Turns out that we weren't handling one of the cases for YEARLY
  RRULE; that in which the date is specified as a day of week plus
  week of month
* Also, we weren't always sending the INTERVAL properly in a few
  cases
* Fix these issues and add a unit test that confirms the fixes
* Also removed an unused argument in recurrenceParser in
  CalendarSyncAdapter

Bug: 2718948

Change-Id: If9146d484218e7d6bd9f5c2305d0e6a216aeed49
2010-09-02 18:17:42 -07:00
Andrew Stadler bf2a53ef5e Merge "Direct access to edit specific account settings" 2010-09-01 21:20:41 -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
Makoto Onuki a25aa613f7 Open MessageComponse when draft in All Starred is selected
Also removed a silly unnecessary code in Mailbox.isRefreshable.

Bug 2968445

Change-Id: I75187e5abf1c3e67c8b9ead38c7f749fc8b6cfb0
2010-09-01 18:27:12 -07:00
Makoto Onuki 11aea1efe4 "Move to" multiple messages
Now Controller.moveMessage supports moving multiple messages.

Change-Id: I5d9715cd94e55cf14254b4d4d731524be9d014a8
2010-09-01 15:18:06 -07:00
Makoto Onuki daec902cae Merge "Fully implement "refresh" action bar button" 2010-08-31 17:20:48 -07:00
Makoto Onuki e357f58791 Fully implement "refresh" action bar button
* Now it'll refresh mailbox list (left pane) as well.
(With the minimal interval of 30 seconds)

* Always refresh inbox.
(also with the minimal interval of 10 seconds)

* Also make sure the "auto-refresh" won't refresh
non-refreshable mailboxes. (drafts, etc)

Bug 2929889
Bug 2930018

Change-Id: I09452d40aad6008a721cfbc3f491617224d7048f
2010-08-31 16:49:12 -07:00
Marc Blank 70047f73d3 Merge "Change EAS User-Agent to a constant String" 2010-08-31 16:31:11 -07:00
Makoto Onuki 086aac2386 MailboxFinder should ignore callback for non-target account
There were two cases where MailboxFinder responded to updateMailboxListCallback
when it shoulnd't.
- Callbacks for non-target accounts
- Callbacks arrived after the operation is finished

Make sure these callbacks are properly ignored.
Also, make sure startLookup() can't be called more than once.

Change-Id: I823c11ab5f96df4eb84594c08d3325d12319f708
2010-08-31 10:20:02 -07:00
Marc Blank 03e3449c6b Change EAS User-Agent to a constant String
Change-Id: Ie1efcbc1666bd9bc759aca8134eba21cb9e2467b
2010-08-31 10:10:11 -07:00
Marc Blank 61911d4ff7 Fix another inconsistent set of PolicySet values
* EAS can send both "simple password" and a non-zero number of
  required complex characters; we're supposed to ignore the
  complex character requirement in this case
* Force complex characters to zero if password is "simple"
* Update constructor test to check the fix

Bug: 2903349
Change-Id: I3d42bd3c8f3667d8f3027da9e91e0dd18722d9bf
2010-08-30 20:18:16 -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 25144e2b79 Fix testAccountIsEasAccount
Bug 2953763

Change-Id: Iad1bf94e676c1fb41335e8bd7f3297af0033b0f5
2010-08-26 15:08:57 -07:00
Marc Blank b53b150105 IMAP implementation of "move to folder"
* Clean up Controller.deleteMessage to work with new EmailContent
  utility methods, and move out of the UI thread
* Add unit test for Controller.moveMessage

Change-Id: Ic49e2ecc7ef2252dd4d51f4c3b313b936fda78b6
2010-08-26 10:43:28 -07:00
Marc Blank 62d19789b7 Merge "Fix attachmentExists (recognize mContentBytes)" 2010-08-25 22:35:28 -07:00
Marc Blank 4dcb1c5fda Fix attachmentExists (recognize mContentBytes)
* Add unit test for attachmentExists

Bug: 2937856
Change-Id: I020f58740618c084676bbf1cdfad3795edb07688
2010-08-25 22:34:22 -07:00
Marc Blank 818214e31f Fix failing account backup/restore unit tests
* We can't run the AccountManager functionality of account backup
  and restore in the unit tests, because IsolatedContext doesn't
  mock the AccountManager; this leads to various NPE's when the
  test is run
* These problems started, by the way, when we added POP/IMAP
  account integration with AccountManager
* Since the AccountManager side of account backup/restore isn't
  tested, we'll skip that part of the process when running unit
  tests

Bug: 2873546

Change-Id: I94673913e66722ac70f3c49c51465122e98bf3d9
2010-08-24 17:50:55 -07:00
Makoto Onuki 5247ab8cae Make isEasAccount always work.
isEasAccount now uses getProtocol(), so it works even if the hostauth
hasn't been restored yet.

Bug 2929896

Change-Id: Iee902c18ef59680d8a7d4622230489ec7946f38c
2010-08-24 14:27:10 -07:00
Marc Blank bf37f67e6d Merge "Add utilities to retrieve Mailbox and Account from a message id" 2010-08-24 12:23:34 -07:00
Makoto Onuki 7fd307212f Restore list scroll position when necessary.
Bug 2769052.

Change-Id: I09b04311ad2a5bd0d41d37f78dddc500414323c1
2010-08-24 11:20:00 -07:00
Marc Blank c184f36c2d Revert "Convert Controller to a full service"
This reverts commit 0e6d972641.

Change-Id: I005fc34152396806468edef919a3620961ddb4fe
2010-08-24 10:27:58 -07:00
Marc Blank bca4e6e70b Add utilities to retrieve Mailbox and Account from a message id
Change-Id: Ice727f82b5c284617b831f19e2667078cd3da5dc
2010-08-24 09:24:21 -07:00
Makoto Onuki 1abbc55a45 Merge "Temporarily disabling crashing test." 2010-08-23 12:39:09 -07:00
Makoto Onuki d1a05e1cc3 Fix occasional fails of MailboxFinderTest.
Some of the tests run code on the UI thread but check the result
on the test thread, without synchronization, which is wrong.

Mark the fields volatile to fix it.

Change-Id: I917493f10fc9a15da57cfbc1e65e8d8e2cffd850
2010-08-23 12:38:23 -07:00
Marc Blank f19f9cf4d3 Simplify AttachmentDownloadService; add unit tests
* Changed our queue from a TreeMap to a TreeSet that uses an easily
  testable comparator
* Remove the ugly bit twiddling priority computation
* Test DownloadSet (the logic behind queue ordering, addition,
  removal, query, etc.)

Change-Id: Ia8427900b8f39a243a5407349775802d0a4fad4f
2010-08-23 11:42:40 -07:00
Makoto Onuki 8852708238 Temporarily disabling crashing test.
The problem is that this test creates a partial account which will be
used by the activity, but the account is picked up by MailService too
(which is probably not intentional), which crashes because the account
is not properly constructed.  (empty address)

Bug 2938323

Change-Id: Ie9ba19ebf72431d086014c1dc191a0c71769dea4
2010-08-20 16:15:47 -07:00
Marc Blank 0e6d972641 Convert Controller to a full service
Change-Id: I2078fd047ff46f85936c8bf798a5edd3678bb5b4
2010-08-20 13:34:09 -07:00
Makoto Onuki f52afae942 Make sure RefreshManager's callbacks are called on UI thread.
Fixed the bug where callbacks for sendPendingMessagesForAllAccounts
are called on a worker threaed.

Change-Id: I28f1424cf67e15abf37c09b68050d1385f9ac3ee
2010-08-18 14:49:46 -07:00
Makoto Onuki 21efedb67f Rework/cleanup of "refresh".
Added RefreshManager, which is responsible for getting refresh requests
from UI and keeping track of what is being refreshed.

Conceptually it's a part of Controller, but extracted for easier testing.

- Now sendPendingMessagesForAllAccounts() is owned by RefreshManager
  rather than Controller.
- Also updateMailboxRefreshTime/mailboxRequiresRefresh have been moved
  in from the Email class.
- Now MessagingException implements a method to return an error message
  for the UI.

The refresh button on 2-pane doesn't work as intended yet, because the
spec is a bit too complicated (as described in the TODO in
MessageListXLFragmentManager.onRefhres()).

This change touches many file mostly because it cleans up a lot
of code duplication.

Change-Id: I058ab745ccff10f6e574f6ec4569c84ac4a3e10e
2010-08-18 11:06:45 -07:00
Marc Blank 75153d3122 Fix broken unit test
Bug: 2900294
Change-Id: I61e002061b1d743327a84e64925e64cb6228b879
2010-08-16 23:31:23 -07:00
Makoto Onuki 2866a0a8d7 Merge "Properly unregister mock controllers" 2010-08-13 15:45:52 -07:00
Makoto Onuki 130686327a Merge "Reworking MessageListFragment." 2010-08-13 15:40:28 -07:00
Makoto Onuki 4be3bc1ec8 Properly unregister mock controllers
Some tests create mock controllers.  They register themselves to
MessagingController when instantiated, but never unregister.

Added a cleanup method, and call it for each instance.

(I was hoping it would spped up unit tests, but it didn't.  Still
it's a nice thing to do.)

Change-Id: Ia90f0380aef388d22f7cfcf6e9203e05444b3285
2010-08-13 15:28:23 -07:00
Andrew Stadler 9382eb9ff2 am a30631da: Clear password related policies in PolicySet when p/w not required
Merge commit 'a30631da1cae25be3f75137133297e30cef2db9c' into gingerbread

* commit 'a30631da1cae25be3f75137133297e30cef2db9c':
  Clear password related policies in PolicySet when p/w not required
2010-08-12 15:15:59 -07:00
Makoto Onuki 187d033484 Reworking MessageListFragment.
- Now MessageListFragment uses loaders to load data.

- Now that we use Loader's auto-requery with throttling,
  removed the throttling timer from MessagesAdapter.

- Simplified footer mode.  (now only "no footer" or "load more")

- Removed saving/restoring list state code.
  These method don't really look like working, or at least
  not always working.  Now that UI's lifecycle is changing,
  we'd better redo it from scratch.

- Removed MessageListUnitTests.
  It only has tests for onSaveInstanceState/restore of the fragment,
  which I virtually disabled.

And minor clean-ups
- Moved the code to save/restore selected state from the fragment
  to Adapter.

Bug 2911766
Bug 2897500

Change-Id: I16c7aefecc5409c57fc5fc8c59b5c80d9b7fc164
2010-08-12 15:06:37 -07:00
Andrew Stadler a30631da1c Clear password related policies in PolicySet when p/w not required
Merge from master of c263810b08

Bug: 2883736
Change-Id: Iec4ed0e320d67aee8a89092ac650c0960540057b
2010-08-12 14:56:32 -07:00
Makoto Onuki 367ebd7fa5 Handle multiple IMAP SEARCH results.
Apparently IMAP servers may return multiple SEARCH responses for a
single SEARCH command, and we need to handle all of them.

Before the IMAP rework there was 3 methods that issued the SEARCH command.
Two of them ware doing it right, but the other wasn't, which was what
I copied from, unfortunately!

In case you're wondering, originally the test for this method was done through
upper methods, e.g. getMessage().

Bug 2911647

Change-Id: Ia50072944d5b01c1e59541c3a966067b13910cc4
2010-08-12 11:10:00 -07:00
Andrew Stadler 641ae45358 Fragmentize Exchange setup
Change-Id: Ib331d9a7f7be7acbfe355d6a03d9ae07af0cc627
2010-08-11 16:07:26 -07:00
Makoto Onuki 41502f6ea8 Merge "Fix handling IOException in ImapStore" 2010-08-11 14:44:47 -07:00
Makoto Onuki c14ff6ea45 Fix handling IOException in ImapStore
- mConnection.destroyResponses() should be protected with
  if (mConnection != null).
  When we get an IOException, we close the connection and null it out in
  ioExceptionHandler().  So mConnection can be null at any point after
  where ioExceptionHandler() first appears.

- ioExceptionHandler should close its parent ImapFolder only if the argument
  connection is mConnection.
  Methods like exists() may pass an ImapConnection which is not mConnection
  to ioExceptionHandler.  In which case we don't have to close the ImapFolder.

Bug 2898211

Change-Id: I8f9f45d91f596bb8da1a1575593e652d66deb643
2010-08-11 14:44:09 -07:00
Makoto Onuki 6d8bfa67c4 Make AccountBackupRestore/"delete account" robust.
Fix for crashes caused by an incomplete account
which typically a crashed unit test leaves behind.

- "Delete account" now works for incomplete accounts
- AccountBackupRestore won't crash.

Change-Id: Ie235aa15cf9b970fd184c60f14406aa7353c6f00
2010-08-10 13:49:56 -07:00
Andrew Stadler 71cc035c55 Fragmentize AccountSettings
This is phase 1, which simply replaces the phone UX with a fragment-based
equivalent.  A subsequent CL will convert it to a large-format multi-pane
version.

Also fix a latent bug in the signatures of the Incoming & Outgoing
settings, both in the reflection code and in the proguard flags.

Change-Id: I86e857af8b9573c0d6070bb21053ce65bb7fe8a0
2010-08-09 10:36:50 -07:00
Marc Blank c263810b08 Clear password related policies in PolicySet when p/w not required
Bug: 2883736
Change-Id: I2c9c573aea9a4fef1699ff6339e8ef628d7f2269
2010-08-07 17:27:16 -07:00
Makoto Onuki 36bdeeb0e1 Add getFirstRowInt.
It's the int version of getFirstRowLong.

Because getFirstRowLong returns a Long as opposed to a long, and the return
value can be null, it's a pain to cast to Integer.  So added this variant.

Change-Id: I2a3190e49db480e6d594be4b1fcef9a71e56cb2f
2010-08-06 11:00:44 -07:00
Makoto Onuki 94506fdaf6 Small fixes/clean-ups.
- Fixed account selector default account look-up
- Renamed MessageListFragment.onRestoreInstanceState
  to loadState.
  (Activity.onRestoreInstanceState is called after onStart,
  but this one is called in onCreate, so it wasn't a good
  idea to use the same name.)
- Changed mailbox cursur requery timeout to 3 seconds
- Added some TODOs.

Change-Id: Ia2242cd9f74936d24756b800eacd126958eed330
2010-08-06 10:11:36 -07:00
Marc Blank b91eea0119 resolved conflicts for merge of fbf501fe to master
Change-Id: Ic68cbf2de1877ab06744287f57c1c33c4e0e573a
2010-08-04 10:28:40 -07:00
Makoto Onuki 907774e763 Merge "Aadd special boxes to mailbox list." 2010-08-03 17:21:14 -07:00
Makoto Onuki 833fe73b99 Aadd special boxes to mailbox list.
Change-Id: I36616f53555346ca7fbb6f3426a0c3196d7bacbc
2010-08-03 17:06:04 -07:00
Marc Blank 92861b5c2b Fix tests that broke due to DST changes in African countries
* In particular, "Africa/Casablanca" has DST in 2010 now, so it can't
  be used as a test for non-DST time zones

Bug: 2882900
Change-Id: I3026ae4816fc068bd6c783fa3ca879666e796fc9
2010-08-03 11:32:58 -07:00
Marc Blank 4e619a2d50 am 2b2b3448: Handle inactivity timeout > maximum allowed properly
Merge commit '2b2b3448ec200f3d649e5f57309908d28ce3bfc7' into gingerbread

* commit '2b2b3448ec200f3d649e5f57309908d28ce3bfc7':
  Handle inactivity timeout > maximum allowed properly
2010-08-02 20:41:55 -07:00
Marc Blank 2b2b3448ec Handle inactivity timeout > maximum allowed properly
* In a recent change, we mistakenly removed the logic for handling
  too-long inactivity timeouts; we should just fall back to the maximum
  since this is stricter than what we're being asked to enforce
* Restore this logic and update the unit test
* The regression was caused by change Ida5663a9, to wit:
  Backport: Handle "Allow non-provisionable devices" properly

Bug: 2886746
Change-Id: I99cf9a37441b80477cc1c2c7ec2a78f8a14a83da
2010-08-02 19:39:09 -07:00
Dmitri Plotnikov 5ab18497f6 Adding support for a full-contact (entities) query.
Change-Id: Ib1cdd998dcc4f60124dbc37a42fd61ee0f6802fd
2010-08-02 18:19:25 -07:00
Makoto Onuki d0c2178063 Merge "Add the messageCount column to the mailbox table." 2010-08-02 16:01:32 -07:00
Makoto Onuki 574854b528 Add the messageCount column to the mailbox table.
- Use trrigers to keep them up-to-date.
- Batch-update them upon upgrade.

- Motivation:
  On the mailbox list, we show the number of messages in trash/drafts.
  We currently do this with count(*) on the fly, which is okay
  because MailboxList is really shown right now.
  However, on the 2 pane, it's always shown and constantly refreshed,
  so the use of count(*) can be a huge penalty.

  It also make the code significantly simpler.

Change-Id: I26efa238d5183df43420a65925876248ef6c6cb6
2010-07-30 17:37:28 -07:00
Makoto Onuki 20bf78222b Merge "Fix failing tests." 2010-07-30 16:06:36 -07:00
Makoto Onuki b6c1ad0f01 Rename MessageViewFragment2
Change-Id: I28e23c0ff18211db999396c5ba1ad9ef898d4515
2010-07-30 15:41:40 -07:00
Makoto Onuki 206d4e842d Split up MessageViewFragment like we did to MessageView.
Break MessageViewFragment up into two fragments, MessageViewFragment, which
is used to show regular messages, and MessageFileViewFragment, which shows
EML messages.  (And their base class, MessageViewFragmentBase.)

MessageViewFragmentBase's javadoc has a class diagram.

MessageViewFragment is actually named MessageViewFragment2 at this point
so that GIT correctly finds out the rename from MessageViewFragment to
MessageViewFragmentBase.  I'll rename it back in a following CL.

Also added very basic unit tests for MessageView and MessageFileView.
At this point, they just make sure the activities really open and show
messages without exceptions.

I feel like the current naming schema for the activities/fragments is
kinda confusing.  Let me know if you come up with better names.

Change-Id: Iff948f4b68cfdb7c1e68f225927b0ce58d34766b
2010-07-30 15:38:53 -07:00
Makoto Onuki 2d5b4f25f9 Fix failing tests.
Bug 2844798
Bug 2882894

Change-Id: I683c67ddc7ce7c22f06e4b39df330d3850513862
2010-07-30 10:34:00 -07:00
Makoto Onuki b8f31d5490 Helper to create isolated context for provider tests.
The logic came from ProviderTestCase2, but it can be used with other
kind of test cases, such as InstrumentationTestCase.

Extracted from an existing class.  We'll need it for new activity tests.

Change-Id: I5741f01d4749fd397704cef330082470f6051bcf
2010-07-29 17:22:58 -07:00
Makoto Onuki ec15f2356e Extract the mailbox lookup logic into an independent class
This new class MailboxFinder is responsible for looking for a mailbox
by an account id and a mailbox type.

If a mailbox is not found on the first try, it'll tell Controller
to refresh the mailbox list, and try again later.

This will be used by MessageListXL.

Change-Id: I4adc3db025fb271c254aa2b58b3b753281dc7398
2010-07-28 16:36:34 -07:00
Makoto Onuki 4de80f22ae Merge "Move isSecurityHold/clearAccountHoldFlags to Account" 2010-07-28 13:44:42 -07:00
Makoto Onuki ae8fc30b41 Fix "disk I/O error" in LocalStoreUnitTests
The problem was that we didn't close the LocalStores created in these
testDbUpgradeXxx tests.

Also,
- Make sure to close databases.
- Make sure to close cursors.
- Cleard up warnings (unnecessary casts, etc.)

Bug 2859264

Change-Id: Ifaddbb6cf07794a7b5978564ea8fbb3cbf75b978
2010-07-28 13:07:33 -07:00
Makoto Onuki bcf32320e2 Move isSecurityHold/clearAccountHoldFlags to Account
- Added unit tests
- I see the "open a cursor, move to the first row, read a column" pattern over
  and over.  Added a utility method for this.  (Let's try not to bloat the
  binary by copying code around!)
- Added helper classes for database related tests
- Removed code dup

Change-Id: I380959215cc1661b252158f0f6e35369b499cdf8
2010-07-28 11:12:38 -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 a0b88dc1c8 Merge "Adding more test to MessageOrderManager" 2010-07-15 11:07:12 -07:00
Makoto Onuki 638c67f4db Adding more test to MessageOrderManager
Added a case where all the message in the message list is removed.

Change-Id: Iedc2dbdf391978bd67d3bcdc260590d98cc9ef7d
2010-07-15 11:06:19 -07:00
Marc Blank cd0f12fda8 resolved conflicts for merge of 84f7d07d to master
Change-Id: I62abe3b8aa31a1b551d0396e184b648c305033ec
2010-07-14 23:12:20 -07:00
Marc Blank 1585d313f1 am 8b36acb1: Backport: Handle "Allow non-provisionable devices" properly
Merge commit '8b36acb10d555b59ec0497f6c71426af823c7931' into gingerbread

* commit '8b36acb10d555b59ec0497f6c71426af823c7931':
  Backport: Handle "Allow non-provisionable devices" properly
2010-07-14 22:56:28 -07:00
Marc Blank 8b36acb10d Backport: Handle "Allow non-provisionable devices" properly
* Backport from master branch
* Send policy key of "0" when validating; this gets us the policies
  even if "Allow..." is enabled (currently, we simply don't see the
  policies)
* If we don't support all of the policies, send back the response
  code indicating support for partial support.  If we get a positive
  response back, then we're good to go - the server allows devices
  with partial support.  Otherwise, we fail as we always have - with
  the toast indicating that the device doesn't support required
  policies
* Remove PolicySet.isSupported() and ensure proper field ranges
  within the constructor
* Update tests as appropriate

Bug: 2759782
Change-Id: Ida5663a9b35c75ecc61a5f442be0bd60b433cb73
2010-07-14 22:47:47 -07:00
Marc Blank 7a1a203786 am e43b11ba: Handle correction of rejected Ping heartbeat
Merge commit 'e43b11ba3e9be9380b7c43cde3117c6de28f28bd' into gingerbread

* commit 'e43b11ba3e9be9380b7c43cde3117c6de28f28bd':
  Handle correction of rejected Ping heartbeat
2010-07-14 22:33:34 -07:00
Marc Blank ec29471c73 Make sure signature is added to reply/forward
* Add this to processSourceMessage in the reply/forward cases
* Add unit tests for reply and forward case

Bug: 2734321
Change-Id: I6be8383fe5f217a4bda8e669cb69f439bc8e96b6
2010-07-14 12:43:37 -07:00
Marc Blank e43b11ba3e Handle correction of rejected Ping heartbeat
* Handle status 5 for Ping command (heartbeat of out range)
* Write unit test for heartbeat reset

Bug: 2834195
Change-Id: Ic7952a4b296cf15c6ba895d6579fe7956b171e5b
2010-07-13 18:06:24 -07:00
Makoto Onuki de0a1c33c9 Extract MessageListTask and make it self-contained.
Introducing MessageOrderManager which maintains a message list for
MessageView.  It's used to tell if there is newer/older messages
in a mailbox, and the id of them.

Also, slightly related to this, moved mWaitForLoadMessageId to
ControllerResults where it should belong.

Change-Id: I84e32180c7e84a317f2204bb10ad7245ec022dca
2010-07-13 11:26:01 -07:00
Makoto Onuki e60d3648fd Extract presence check logic into its own class.
Change-Id: I12e449ce7f1d10ed4737581e35367eae84a7f29e
2010-07-13 11:19:04 -07:00
Makoto Onuki 7f247d1cd3 Disable MessageViewTests
- These tests will probably not make sense with the upcoming UI change.
- Moved testAttachmentWritePermissions to UtilityUnitTests.
  It's a test for createUniqueFile, which is now owned by Utility.
- Removed Long.MIN_VALUE hack from MessageView.
  New tests should have something better.

Change-Id: I9a09e5e8080a165b010607d1fa3112bcaaab4f90
2010-07-12 16:14:29 -07:00
Marc Blank 6fe5199154 Merge "New calendar sync adapter tests" 2010-07-10 15:38:58 -07:00
Marc Blank f115d31ae8 New calendar sync adapter tests
* Created MockProvider that can be used for testing the results of
  ContentProviderOperation's for Calendar/Contacts (we can't use these
  within our mock contexts because we can't instantiate the provider
  classes within the Email package)
* Wrote some unit tests for MockProvider
* Use MockProvider to test addEvent, in particular how a user's attendee
  status is stored, depending on whether the event is new or updated

Change-Id: I97f02d125eb7347726261e12ce70aadc539be1d4
2010-07-09 10:24:58 -07:00
Marc Blank 5fcbdcf59f Merge "Send intro text with SmartForward" 2010-07-09 09:40:46 -07:00
Marc Blank 80ee607a7c Send intro text with SmartForward
* We need to include the intro text (--Original Message--, etc.) to
  SmartForwards, and somehow this got in a past updat
* Add unit test for forwarding
* Fix unit test for reply so that it works localized

Bug: 2477988
Bug: 2685784
Change-Id: I8d92f00d37a434840ec3eb237f3901cd5dc7ad09
2010-07-09 09:39:58 -07:00
Marc Blank 5b02ecf87c Fix SmartReply/SmartForward in EAS 2.5
* We inadvertently broke this with a recent update that uses Uri
  encoding for ItemId and CollectionId in SmartForward/Reply commands.
  We need to allow colon (:) however for EAS 2.5; otherwise, sends
  fail with HTTP 500
* Update unit test

Bug: 2821684
Change-Id: Ia6bdd2169513d1c13a8174dd599477a35df950f2
2010-07-07 14:42:31 -07:00
Makoto Onuki 57f4d0222b Adding 2 utility methods for testing
expectThrowable() and waitUntil().

Change-Id: I8e3af97ed02254ef2fdc72afadea1911ed23e4ab
2010-07-02 15:30:23 -07:00
Makoto Onuki a0f1dd0a5c Merge "Cleaning up MessageView" 2010-07-02 13:31:26 -07:00
Makoto Onuki 44b5242edd Cleaning up MessageView
- Removed dead code/dead comment.
- Moved static utility methods to Utility.
- Renamed some methods.
- Changed the timing to call super methods.

Also:
- Internationalized formatSize()
- Added unit tests for createUniqueFile() and formatSize()
- createUniqueFile now uses File.createNewFile() instead of exists().

Change-Id: Ibc30e15b029ed5088954bd6fc9032e25dddf176e
2010-07-02 13:26:05 -07:00
Marc Blank 42ff939e3a Prevent MailService from potential looping due to EAS accounts
* The code assumed that all accounts used the scheduler in MailService
  whereas only those using MessagingController do so (i.e. EAS does
  not)
* Change setupSyncReportsLocked to set the syncInterval for accounts
  that don't use MessagingController to Account.CHECK_INTERVAL_NEVER
* Add unit test for the changed code

Change-Id: I74a3dae21d9ec16f9903bdf2a1c28092ae89cc50
2010-07-02 11:47:03 -07:00
Makoto Onuki 4e366b9995 Merge "Always use the mime-type "message/rfc822" for eml files." 2010-06-29 12:37:27 -07:00
Marc Blank 5bd2faee5e Preliminary GAL/Contacts integration for EAS
Change-Id: I9997ac96f83f427c71caf12d591ba6069bedf935
2010-06-29 11:49:04 -07:00
Makoto Onuki 1d0be30871 Always use the mime-type "message/rfc822" for eml files.
Bug 2795919

Change-Id: Ie20fccdad34d7d17d7444af25d3e57033a45de5a
2010-06-29 10:40:31 -07:00
Marc Blank 51f5b2f3fa Fix problem with unencoded data in URI sent to EAS
* We need to encode the itemId and collectionId for SmartForward and
  SmartReply
* Add unit test for the fix
* Small change + test to EasSyncService usage of URI encoding to use
  a non-deprecated method

Bug: 2787725
Change-Id: I428b308b56cc359b8cdd9e42bc3f42c65b6797dc
2010-06-28 21:25:53 -07:00
Marc Blank 8d8f86e899 Cleanup and speed up isMessagingController
* Use the new Account.getProtocol() method to determine whether an
  Account "isMessagingController" (i.e. uses the legacy controller)
* Cache the result of this test, so that it's only done once per
  Account
* Add unit test

Change-Id: I6a0ec789a84bdf30b55156e6337a627fb4e81a08
2010-06-28 10:21:45 -07:00
Marc Blank 663b57daa7 Fix GAL search in EAS 12.1
* We weren't sending the proper protocol version to GAL search, which
  causes errors when using 12.1
* The simple fix is to send the agreed upon protocol version, instead
  of the default (which is 2.5)
* Replace parsing of protocol version with lookup

Bug: 2793588
Change-Id: Ib2a255d8467004ce985d2d688b37066e1e09d78a
2010-06-23 16:48:46 -07:00
Marc Blank 9b4988de43 Implement support for new security policies
* Minimum complex characters
* Password history (i.e. disallow re-use of past n passwords)
* Password expiration
* Password expiration is NOT yet supported in the framework; there
  is a TODO in this CL and a trivial change will be needed when
  support arrives; for now, we report this as unsupported
* The two implemented policies are testable

Change-Id: I477adbc000577c57d1ab1788378c97a60018c10c
2010-06-23 14:51:59 -07:00
Marc Blank 391ae25c43 Handle viewing of attachments that are, themselves, emails
* Add intent filter for application/eml and message/rfc822 mime types,
  launching MessageView with a Uri
* Modify loadMessageTask to handle the Uri by parsing the attachment's
  input stream with Pop3Message.parse(), and then creating an
  EmailProvider message in a special Mailbox created to hold
  "attachment" messages
* Delete all "attachment" messages after the parent message is closed
* Add unit tests

Change-Id: I20276ee006b9f05b889f3c808d3dc407cde26d49
2010-06-22 18:39:18 -07:00
Andrew Stadler e4ecb50091 Convert AccountFolderList to use a Fragment
* Introduce AccountFolderListFragment and its layout
* Extract all list-related UI into it
* Fix leaking cursor in AccountsAdapter and add unit test

Change-Id: Ica566847d97927b736f515d434c6691c82343290
2010-06-18 15:32:10 -07:00
Marc Blank 1d6dab2956 Handle "Allow non-provisionable devices" properly
* Send policy key of "0" when validating; this gets us the policies
  even if "Allow..." is enabled (currently, we simply don't see the
  policies)
* If we don't support all of the policies, send back the response
  code indicating support for partial support.  If we get a positive
  response back, then we're good to go - the server allows devices
  with partial support.  Otherwise, we fail as we always have - with
  the toast indicating that the device doesn't support required
  policies
* Remove PolicySet.isSupported() and ensure proper field ranges
  within the constructor
* Update tests as appropriate

Bug: 2759782
Change-Id: I5f354a0e2d81844aff75d8a8a6de3b97f0020c1f
2010-06-16 13:14:36 -07:00
Marc Blank ca6647a679 Merge "Add tests for CalendarSyncAdapter" 2010-06-16 10:53:43 -07:00
Makoto Onuki 34f29c8a74 Test for interaction between ImapStore and vendor policy.
Change-Id: I092b3a0f2f40d9aa19f2f61066362099c8b3f50b
2010-06-15 13:44:31 -07:00
Makoto Onuki 601187db42 Introducing MessageListFragment.
- Extracted MessageListFragment out of the MessageList activity.
- This is basically pure extraction, with the following conceptual change.
  - Now the MessageList activity doesn't know the mailbox id or
    the account id.  If it needs these ids, it needs to ask the fragment.
  - MessageListFragment.LoadMessagesTask tries to determine the account ID
    if it's unknown.

Most code in MessageListFragment is directly copied from MessageList
with minimal changes (e.g. pass mActivity instead of 'this' as a Context).
There's a few cleaning up oppotunities.  I'll work on them later in a separate
CL.

Change-Id: Ie004cc49b429f2cd8f9de73df5abb94f3054ea0a
2010-06-14 10:20:29 -07:00
Marc Blank 1a3b2f7de2 Add tests for CalendarSyncAdapter
* Test for creation of a typical event
* Test for creation of an event with redacted attendees
* More to come

Change-Id: Ica117cd20a9e270ffe49efed75607e92b4d8ac90
2010-06-11 16:31:15 -07:00
Makoto Onuki 36d3dfaeac Extract MockVendorPolicy, add standard mechanism to inject it.
One thing that bothers me regarding the new ImapStore is that there is no
tests to verify if the way how getImapId() uses a vendor policy hasn't changed.
This part is hard to test with a real vendor policy, and it can easily be
overlooked even if it's broken.

This CL offers ImapStoreUnitTests a way to test the interaction between
getImapId() and a vendor policy.

Also fixed a bug in VendorPolicyLoaderTest where it assumed the test apk
package name is "com.android.email.tests", but it may actually be
"com.google.android.email.tests" now.  (Broken since the test makefile
used inherit-package.)

Change-Id: I8feb616ea28cb5cae5b4fba57e363771014ac599
2010-06-11 15:11:15 -07:00
Makoto Onuki 851f3219e2 Renaming MessageListAdapter to MessagesAdapter
in line with MailboxesAdapter.

Change-Id: I4ed387db2f5ce1f9bad282521c62eeec0c697db4
2010-06-09 14:43:43 -07:00
Makoto Onuki 0fb092b389 Fix for failing SecurityPolicyTests.
This fixes the following exception.

java.lang.UnsupportedOperationException
        at android.test.mock.MockContext.getApplicationContext(MockContext.java:82)

Bug 2725552

Change-Id: Iaca177defe5f5e836211c58270379da056fa64e0
2010-06-07 16:14:53 -07:00
Makoto Onuki 0a892ae04f Extract MessageListAdapter.
Change-Id: I0e441b7fff925c7703ab88ab54240c5b42d045c4
2010-06-02 16:37:47 -07:00
Makoto Onuki bf58053406 Follow-up to the new IMAP parser.
- Replace string literals in ImapStore with constants.
- Simplifies ImapStore.en/decodeFolderName
- Mix cases in the test data to test for case-insensitivity

Change-Id: I88424357227bcf78528df5e6a1c4ba45d54cc65b
2010-06-01 10:50:15 -07:00
Makoto Onuki 7e5ba0e1ea New IMAP parser to fix long-lasting problems.
- Almost completely re-wrote ImapResponseParser layer
- We no longer use simple ArrayList and String to represent
  imap response.  We have classes for that.  (Type safe!)
  These classes are also NPE-free.
  (which isn't necessarily a good thing, though)
- A lot of clean-ups and fixes in ImapStore.
- More tests for ImapStore.

Now ImapResponseParser moved to com.android.email.mail.store.imap.parser,
but inside, it's 99% new code.

This CL introduces many new classes, but most of them are small classes
to represent the IMAP response.

Problems that this CL fixes includes:
- Special characters in OK response
- Handling BYE response
- Case sensitivity
- ClassCast/ArrayIndexOutOfBound/NumberFormatException
- Handling NIL/literals at any position

Bug 2480227
Bug 2244049
Bug 2138981
Bug 1351896
Bug 2591435
Bug 2173061
Bug 2370627
Bug 2524881
Bug 2525902
Bug 2538076

Change-Id: I7116f57fba079b8a5ef8d5439a9b3d9a9af8e6ed
2010-05-28 15:59:09 -07:00
Marc Blank 637abf9852 Merge "Split UtilityUnitTests into medium and small test classes" 2010-05-28 13:29:36 -07:00
Marc Blank 654cc1f68f Split UtilityUnitTests into medium and small test classes
Change-Id: I382bb2bd94ba4d800e907f9c439b4e03f1f20ea4
2010-05-28 13:29:09 -07:00
Andrew Stadler 50adf5369c Merge "Refactor AccountsAdapter into its own class." 2010-05-28 13:26:46 -07:00
Andrew Stadler f3c285d4a3 Refactor AccountsAdapter into its own class.
* Extract AccountAdapter from AccountFolderList
* Use callback instead of hardcoded launch of MailboxList
* Unit tests

Change-Id: Icafce1ef73a99fb61985c649620440656f9b51a3
2010-05-28 12:54:56 -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
Marc Blank 838beeb621 am 719d29bd: am 4c8adbc4: am 027a6ddf: Merge "Fix bugs related to TZ handling for all-day events" into froyo 2010-05-25 13:12:34 -07:00
Marc Blank 719d29bdcd am 4c8adbc4: am 027a6ddf: Merge "Fix bugs related to TZ handling for all-day events" into froyo
Merge commit '4c8adbc4aa81308e57ae129e9587ec50483af6a8' into kraken

* commit '4c8adbc4aa81308e57ae129e9587ec50483af6a8':
  Fix bugs related to TZ handling for all-day events
2010-05-25 13:10:35 -07:00
Marc Blank 4c8adbc4aa am 027a6ddf: Merge "Fix bugs related to TZ handling for all-day events" into froyo
Merge commit '027a6ddfaa7228854cb3c4238434f87fc69078b6' into froyo-plus-aosp

* commit '027a6ddfaa7228854cb3c4238434f87fc69078b6':
  Fix bugs related to TZ handling for all-day events
2010-05-25 13:09:05 -07:00
Marc Blank 3e065170f3 Fix bugs related to TZ handling for all-day events
* In bug 2703075, all-day events from time zones at GMT or later
  appear a day early; this is because the time was calculated from
  the GMT date/time of the event rather than the local date/time of
  the event; this CL correctly changes this to use local date/time
* In bug 2707966, device-edited all-day events disappear in Outlook
  and OWA after upsync; this is due to the fact that we store all-day
  events in UTC on device, whereas we need to upload all-day events
  using the original (local) time zone.  In this CL, we save away
  the original time zone and use it on upsync
* In our decoding of Exchange time zone information, we default to
  local time when we can't find a time zone that matches the bias
  and DST information; we should really default to a time zone with
  the same bias, if one exists; we do that in this CL.
* Add/modify unit tests

Bug: 2703075
Change-Id: Id80c481ecc0eae980b2e91dae7f105f924cfca28
2010-05-25 11:46:44 -07:00
Makoto Onuki 32f8a49e01 Two new tests for the bottom half of ImapFolder.append().
They cover the cases:
- when OK response doesn't have APPENDUID.
- when APPEND fails.

Change-Id: I13a0fb8aaf2e1cbb5a1f055c9ce56e2891373ea0
2010-05-20 18:23:16 -07:00
Makoto Onuki cbe4ae9291 More tests for IMAP, clean up, and a few bug fixes.
- A few new tests in ImapStoreUnitTests.
- Added TODOs to ImapStoreUnitTests (for mainly NO response handling)
- Renamed ImapStore.releaseConnection to poolConnection.
- Fixed a bug in getConnection where it'd return a closed connection.
- Now getConnection() hanles BYE response for NOOP correctly and treat the
  connection as closed.

Change-Id: I48e5b89049338f7d4f1ac77cd7ac7243945a9575
2010-05-19 13:13:18 -07:00
Makoto Onuki 2552b7b705 More test for ImapStore/ImapFolder.
- Also, fixed a potential crash in getMessages().
  It could happen when a client is gettign a message list while
  another client is removing messages.

Change-Id: I04b1de6bc384cffb7a5286bcec0a349a3d62a623
2010-05-18 17:14:30 -07:00
Makoto Onuki 7d3519151a Tests for IMAP FETCH
Adding regression test for the new IMAP parser.

Change-Id: Iac7f5c022e44ca5f06f735e145af15cc459eb61f
2010-05-18 10:48:11 -07:00
Makoto Onuki 128fb393e8 Relax MIME date parser.
Make the date parser accept invalid dates like
"Thu, 10 Dec 09 15:08:08 GMT-0700" which was observed in an email from eBay.

Per RFC, timezone must be either obs-zone (e.g. "GMT") or +/- with 4 digits.
The GMT+/-digits format is not permitted.

Bug 2367124

Change-Id: I59968274160aeadea70223208b463ee692660056
2010-05-17 14:14:08 -07:00
Makoto Onuki 0a8030562a Fix flaky tests
Follow up to I3bf7d340.  Make sure temp directory is set before running tests.

Turned out Application.onCreate doesn't seem to be guaranteed to be run
before unit tests.

Without this, some tests may fail saying: "TempDirectory not set.
Application hasn't started??", if onCreate runs too late.

Change-Id: Ic5aee939a2c21f9579a643d0729dd0e9ba81022e
2010-05-17 14:07:34 -07:00
Makoto Onuki 9c9e757917 Add static method to get temp dir in Email.
I need to be able to get the temp dir from anywhere without Context
for the new IMAP parser.

Change-Id: I3bf7d34059399a8253c0760ebc392804ea434412
2010-05-13 18:27:34 -07:00
Makoto Onuki 31fa0172cf am d93f323f: am 29491840: Merge "Cleanup: Add @Override" into froyo-plus-aosp 2010-05-10 11:34:28 -07:00
Makoto Onuki d93f323faa am 29491840: Merge "Cleanup: Add @Override" into froyo-plus-aosp
Merge commit '29491840e62a3a21a9b8e4a0889450d2d0875255' into kraken

* commit '29491840e62a3a21a9b8e4a0889450d2d0875255':
  Cleanup: Add @Override
2010-05-10 11:30:36 -07:00
Makoto Onuki 29491840e6 Merge "Cleanup: Add @Override" into froyo-plus-aosp 2010-05-10 11:29:51 -07:00
Marc Blank 4880ab8641 am bf60edcc: am a25b1b03: am 85a63c3c: Fix issues with exception downloads 2010-05-10 09:53:54 -07:00
Marc Blank bf60edcc96 am a25b1b03: am 85a63c3c: Fix issues with exception downloads
Merge commit 'a25b1b03626c6c27c877671f1b6622b4ab022bbc' into kraken

* commit 'a25b1b03626c6c27c877671f1b6622b4ab022bbc':
  Fix issues with exception downloads
2010-05-10 09:49:54 -07:00
Marc Blank a25b1b0362 am 85a63c3c: Fix issues with exception downloads
Merge commit '85a63c3c2f2d00210e9f7957f3d217b7fd028dad' into froyo-plus-aosp

* commit '85a63c3c2f2d00210e9f7957f3d217b7fd028dad':
  Fix issues with exception downloads
2010-05-10 09:43:40 -07:00
Marc Blank 85a63c3c2f Fix issues with exception downloads
* It turns out that, in addition to other requirements of the
  CalendarProvider, there is another - that the ORIGINAL_INSTANCE_TIME
  also be set with hour, minute, and second as zero (in UTC)
* Change setTimes() to properly modify ORIGINAL_INSTANCE_TIME
* Also, there was a regression due to an incorrect validity test
  for events; this regression caused all exception downsyncs to fail
* Changed isValidEventValues() to be correct for both exceptions
  and original events
* Update tests for setTimes and isValidEventValues()
* This CL also fixes 2658988

Bug: 2664229
Change-Id: I9c8aea08e606ff58e5be37ca81a2d86a181c46f6
2010-05-07 15:47:57 -07:00
Makoto Onuki 165e8bfe7a Cleanup: Add @Override
(Note it's for froyo-plus-asop)

Change-Id: Ic4211c08586e33c44d5d6267c0c9d37f8c7cdc85
2010-05-07 15:28:26 -07:00
Makoto Onuki c563ce1b80 am b8970dab: am e46ac1a6: Cleanup imports. 2010-05-07 15:20:47 -07:00
Makoto Onuki b8970dabb6 am e46ac1a6: Cleanup imports.
Merge commit 'e46ac1a61f32bd762a879457b1850087a1ad3a8c' into kraken

* commit 'e46ac1a61f32bd762a879457b1850087a1ad3a8c':
  Cleanup imports.
2010-05-07 15:17:35 -07:00
Makoto Onuki e46ac1a61f Cleanup imports.
(Note it's for froyo-plus-asop)

Change-Id: Ia5b771cd41099ab486ba2e556b441fc7c0affe5f
2010-05-07 14:33:44 -07:00
Marc Blank a32e063036 am ab4daabd: am 8f255dde: Merge "Add checks for Event validity before commit" into froyo
Merge commit 'ab4daabd5ec99da549407ce87d46e24be261c4a6' into kraken

* commit 'ab4daabd5ec99da549407ce87d46e24be261c4a6':
  Add checks for Event validity before commit
2010-05-06 12:43:16 -07:00
Marc Blank 33f07963eb Add checks for Event validity before commit
* Enforce CalendarProvider2's requirements for valid Events
* Add unit tests for the new code
* Backport of change I42ad7acb from master
Bug: 2658149

Change-Id: I8151d035247a7dbb1fda3eae163b24ccfe055299
2010-05-06 08:28:34 -07:00
Marc Blank bc1a4753b1 Add checks for Event validity before committing
* Enforce CalendarProvider2's requirements for valid Events
* Add unit tests for the new code

Bug: 2658149
Change-Id: I42ad7acbcee3b6b831f805c59436017a32651f3a
2010-05-05 18:16:16 -07:00
Andrew Stadler b0c37bd8c0 am 1e037acd: am 7cdd6899: am a7628f3b: Merge "Better handling for untyped attachments" into froyo 2010-05-03 09:36:28 -07:00
Andrew Stadler 1e037acda7 am 7cdd6899: am a7628f3b: Merge "Better handling for untyped attachments" into froyo
Merge commit '7cdd6899fbe820af852974cd0b7025b72bfe242a' into kraken

* commit '7cdd6899fbe820af852974cd0b7025b72bfe242a':
  Better handling for untyped attachments
2010-05-03 09:34:02 -07:00
Andrew Stadler 80ebde2897 Better handling for untyped attachments
* IMAP/POP rely on sender to set mime type of attachments
* Which doesn't always work, because senders don't always provide it
* Remap using filename extensions, when needed
* This is applied as late as possible - in the MessageView, and in
  the content provider getType().  No changes to how we write databases,
  and no change to existing attachment rows.

Bug: 2356638
Change-Id: Ie69e3fd12f406aac803583f9d1299a8af4fba010
2010-04-30 15:01:10 -07:00
Marc Blank 34d94723b6 am 25fa6124: am 44ae6d2f: am f2d43c39: Merge "Update unit tests for invitation creation" into froyo 2010-04-29 20:33:10 -07:00
Marc Blank 25fa612444 am 44ae6d2f: am f2d43c39: Merge "Update unit tests for invitation creation" into froyo
Merge commit '44ae6d2fa2e79de533ceb1fdf50c578a4ed84a3f' into kraken

* commit '44ae6d2fa2e79de533ceb1fdf50c578a4ed84a3f':
  Update unit tests for invitation creation
2010-04-29 20:30:11 -07:00
Marc Blank 9294d8c030 Update unit tests for invitation creation
* Tests changed/added for exception/recurrence changes in CL50201

Bug: 2640878
Change-Id: I97e5557c198aa686d1705158f2c9087c1683590e
2010-04-29 11:03:37 -07:00
Marc Blank 52ab04a805 am ad7060ae: am f1fa44bd: am 2f1ce56f: Merge "Fix upload/download of attendee status" into froyo 2010-04-26 10:11:52 -07:00
Marc Blank ad7060ae18 am f1fa44bd: am 2f1ce56f: Merge "Fix upload/download of attendee status" into froyo
Merge commit 'f1fa44bdc064a6c01813c5380839b90bd0290d46' into kraken

* commit 'f1fa44bdc064a6c01813c5380839b90bd0290d46':
  Fix upload/download of attendee status
2010-04-23 17:27:10 -07:00
Marc Blank 8a19af3739 Fix upload/download of attendee status
* It turns out that the UI uses selfAttendeeStatus and the attendee's status
  from the Attendees table in confusing and undocumented ways
* selfAttendeeStatus is used in the UI, but only in certain cases. Generally speaking,
  the Attendees table status is definitive.  However, when the user sets his status
  from the UI, this data is reflected in the event's selfAttendeeStatus, since for EAS,
  the user is always the owner of his calendar
* On downsync,  we'll put the user's busy status into the Attendees table
* On upsync, we'll send busy status based on the user's attendee status in the
  Attendees table
* We'll use selfAttendeeStatus only to determine whether the user has manually changed
  his status via the UI (as before)

Bug: 2615586
Change-Id: I3a82474cfd07cbf5aa595e5214807cb55005cefa
2010-04-23 09:07:53 -07:00
Makoto Onuki 92db71e440 Merge "Send local IP address with EHLO instead of "localhost"." 2010-04-22 14:23:46 -07:00
Makoto Onuki 3844bbcaaf am 2ca8d734: am 6cfa8001: Merge "Fix failing unit tests" into froyo
Merge commit '2ca8d7347db3975746ad87347de57fd5800bf5d4' into kraken

* commit '2ca8d7347db3975746ad87347de57fd5800bf5d4':
  Fix failing unit tests
2010-04-22 13:24:40 -07:00
Marc Blank 0acd7e9c77 am d764ce7e: am 1880ad6a: Send correct busy status information in upsyncs to EAS
Merge commit 'd764ce7e4442b0027a891582cbdd728487a49f97' into kraken

* commit 'd764ce7e4442b0027a891582cbdd728487a49f97':
  Send correct busy status information in upsyncs to EAS
2010-04-22 13:23:55 -07:00
Makoto Onuki f4dac9f266 Send local IP address with EHLO instead of "localhost".
Bug 1515345

Change-Id: I181c9f0d79fbdf62f7df77f72a1ec9653797b6dd
2010-04-22 11:23:08 -07:00
Makoto Onuki 6cfa8001a8 Merge "Fix failing unit tests" into froyo 2010-04-22 09:51:21 -07:00
Makoto Onuki 25d55ed266 Fix failing unit tests
Bug 2614782

Change-Id: I7ed7bf61a567429017f64d9049577ec076331bb2
2010-04-22 09:18:42 -07:00
Marc Blank 1880ad6a83 Send correct busy status information in upsyncs to EAS
* Fix unit test that was failing

Bug: 2615382
Change-Id: I54c7bdd982d57528f55ce4f4c6804c9f532293fb
2010-04-21 18:25:16 -07:00
Marc Blank fc08120213 am a0c71419: am 21c04fe3: Merge "Further harden getListOrNull" into froyo
Merge commit 'a0c71419cedaa0f84d12da61e415642b79cc0a9c' into kraken

* commit 'a0c71419cedaa0f84d12da61e415642b79cc0a9c':
  Further harden getListOrNull
2010-04-21 08:18:04 -07:00
Marc Blank 07fb9f8bea Further harden getListOrNull
* Add a bounds check
* Add a test for ImapList

Bug: 2611022
Change-Id: I3ad88fbc8d3145298731ab19ef7ff68d4011bb00
2010-04-20 19:31:29 -07:00
Marc Blank 5ff98ba1ec am 825999f8: am 095eee41: Set selfAttendeeStatus and busyStatus properly on downsync/upsync
Merge commit '825999f815979519d8d80334a8c1ce0223a89ef2' into kraken

* commit '825999f815979519d8d80334a8c1ce0223a89ef2':
  Set selfAttendeeStatus and busyStatus properly on downsync/upsync
2010-04-16 13:55:04 -07:00
Marc Blank 095eee4156 Set selfAttendeeStatus and busyStatus properly on downsync/upsync
* Set selfAttendeeStatus on download from busy status
* Set busyStatus on upload from selfAttendeeStatus

Bug: 2587076

Change-Id: I34eaa0d3861bcec0cbfd51761b31965e44f5162b
2010-04-16 13:39:51 -07:00
Marc Blank ce2e1260bc am b8ef8a2c: am a97d8501: Merge "Properly decode a uid from the globalObjId in invites" into froyo
Merge commit 'b8ef8a2c1d18421a7d537dbc8d1ea88ffca95898' into kraken

* commit 'b8ef8a2c1d18421a7d537dbc8d1ea88ffca95898':
  Properly decode a uid from the globalObjId in invites
2010-04-15 13:48:03 -07:00
Marc Blank a97d85014f Merge "Properly decode a uid from the globalObjId in invites" into froyo 2010-04-15 13:41:04 -07:00
Marc Blank 7e30b2e22f Properly decode a uid from the globalObjId in invites
* Meeting invitations in EAS include a globalObjId.  It turns out
  that this id is EITHER the actual uid (if Exchange created it)
  or a wrapper for the actual uid (if some other client created it)
* To find out which case we're dealing with, we have to look at
  the base64 decoded string for the magic "vCal-Uid" substring
* If it's there, we pull the real uid out of the decoded string
* Otherwise, we build a hex strong from the decoded bytes
* Write unit test for this process

Bug: 2598201
Change-Id: I1cc40af6d1e45be44c19465eb8a4c31851ec8157
2010-04-15 13:12:40 -07:00
Makoto Onuki 6f83fe6317 am ad383ff1: am d2a0d233: Use consistent device-id even the device is wiped.
Merge commit 'ad383ff1231319c6ded4077b0d1415bf77bec70b' into kraken

* commit 'ad383ff1231319c6ded4077b0d1415bf77bec70b':
  Use consistent device-id even the device is wiped.
2010-04-14 22:22:18 -07:00
Makoto Onuki d2a0d23380 Use consistent device-id even the device is wiped.
Use hash of device id (TelephonyManager.getDeviceId()) instead of a random
value.

Bug 2596537

Change-Id: I22303f7287ee6e9edccec349d03f14adbd33f6f7
2010-04-14 21:39:18 -07:00
Makoto Onuki cda014c16e am 8dffa087: am 162b0171: Change account colors to what aren\'t used in Calendar.
Merge commit '8dffa087db44e27e5f0e5672b19fdb6975e614a7' into kraken

* commit '8dffa087db44e27e5f0e5672b19fdb6975e614a7':
  Change account colors to what aren't used in Calendar.
2010-04-14 16:30:27 -07:00
Makoto Onuki 162b017140 Change account colors to what aren't used in Calendar.
Bug 2535090

Change-Id: I252e04afa402303d226a56f1d7852f50dc26e2ec
2010-04-14 15:18:12 -07:00
Makoto Onuki 040f0e3c48 am 77275817: am 0f3d3601: Merge "Show device id on the exchange setting screen." into froyo
Merge commit '772758177e3dd4fcb1c9d534afec3007b59c8bf7' into kraken

* commit '772758177e3dd4fcb1c9d534afec3007b59c8bf7':
  Show device id on the exchange setting screen.
2010-04-13 17:32:00 -07:00
Makoto Onuki 12b4bc9e80 Show device id on the exchange setting screen.
I've attached a screenshot on the referenced bug.

Also fixed a bug in SyncManager.getDeviceId() where sDeviceId cache wasn't
working.

Bug 2591124

Change-Id: I4b58517c095a96d47fb57179d70091b2c7af5249
2010-04-13 17:10:26 -07:00
Andrew Stadler ead786d9b5 am ef01261a: am 9cc6f46b: Merge "Try TOP even on POP servers that fail to report CAPA" into froyo
Merge commit 'ef01261a8909ea3fe3e40b06cc537e0032d47898' into kraken

* commit 'ef01261a8909ea3fe3e40b06cc537e0032d47898':
  Try TOP even on POP servers that fail to report CAPA
2010-04-12 11:33:04 -07:00
Andrew Stadler 645fc28301 Try TOP even on POP servers that fail to report CAPA
* Ignore the results of CAPA and always try TOP
* If TOP returns -ERR simply fall back to (bad old slow) RETR
* Unit tests for positive & failure cases

Bug: 2588432
Change-Id: Ife4b551217de1025e14efc46074f16ef4ae99c6f
2010-04-12 10:56:55 -07:00
Andrew Stadler 5f95d68288 am 3839dc98: Merge "Improve MIME & SMTP compliance on outbound messages" into froyo
Merge commit '3839dc981f15bb7da5e7500ee175485dc85a6f6a' into kraken

* commit '3839dc981f15bb7da5e7500ee175485dc85a6f6a':
  Improve MIME & SMTP compliance on outbound messages
2010-04-08 10:03:11 -07:00
Andrew Stadler 6bcccf6284 Improve MIME & SMTP compliance on outbound messages
* Write MIME-Version: 1.0 in all outbound messages, not just those
  with multiparts.  This is required by RFC 2045.
* Unit tests

Bug: 1678296
Change-Id: Icf37d93b8b0150f490791792499865a60744adea
2010-04-07 21:46:15 -07:00
Makoto Onuki e2a076fdfd am af672452: Added a test for IMAP APPEND
Merge commit 'af6724527e564d35dd27ac35e24dbced554792e5' into kraken

* commit 'af6724527e564d35dd27ac35e24dbced554792e5':
  Added a test for IMAP APPEND
2010-04-06 14:43:22 -07:00
Makoto Onuki af6724527e Added a test for IMAP APPEND
It's a preliminary change for IMAP bug fixes.

Also,
- Fixed a potential bug in ImapFolder.setFlags where it'd throw
  StringIndexOutOfBoundsException if flags is empty.

- Added a generic flag to proguard.flags so that now all methods with
  the "ForTest" sufix are automatically preserved.
  Turned out it wasn't needed for this CL, but it should come in handy
  someday.

Bug 2538076
Change-Id: I49a08afc196c7b7f1f30477dfc38ac5381045d84
2010-04-06 14:33:43 -07:00
Andrew Stadler dc0753373e DO NOT MERGE. Handle STARTTLS when last line in EHLO response.
When receiving the EHLO response from the SMTP server, the multiline
answer has "-" prefix in all lines except the last line, where the
prefix is a blank. This is according to RFC 2821 section 4.2.1. This has
also been reported as issue 2309 at code.google.com.

Bug: 1744768

Change-Id: I3feccabed30767d2fa5b06352cd7d1c803e8d59c
2010-04-06 10:50:11 -07:00
Andrew Stadler a843d40ba1 Improve handling of unsupported security policies
* If the server asks for more than we can support, don't throw
  and error from PolicySet creation.  Let isSupported() do that.
* Overlong password lengths cannot be supported and isSupported is false.
* Overlong timeouts & max wipes can be reduced to supported
  amount (this actually increases security) and isSupported is true.
* Clean up an obsolete comment
* Unit tests

Bug: 2567804
Change-Id: I2d664a7f2a315b9f9bdcb867fe2cd98f74de6f66
2010-04-02 22:05:12 -07:00
Marc Blank 78021cbbf8 Don't add "Invitation: " to meeting invitations
* Turns out that most other clients omit this.
* This has the pleasing effect of fixing the referenced bug
* Update unit tests

Bug: 2561821
Change-Id: I39f7db7e05be590373cd5f3d9b23c7ee21bde4f7
2010-04-01 14:42:10 -07:00
Marc Blank cf274512ed Fix conversion of UNTIL date in RRULEs to EAS calendar dates
* Because we were sending these in the wrong format, upsynced changes
  were failing, with the result that both the original event and
  the "new" event (from the UNTIL date forward) remained in the calendar
* Fix is to send the proper format; unit test updated to reflect the
  change
* Also, we only send the date of an UNTIL, rather than the to-the-minute
  time; it turns out that EAS expects to see only a day for UNTIL.

Bug: 2561818
Change-Id: Ic4eacbe96c713d58c637386ceab2cf22ebe3c2d4
2010-04-01 10:13:00 -07:00
Marc Blank 1c48450c02 Fix the VCALENDAR we send with all day events
* We need to send date only (without time) in the VCALENDAR file for
  all-day events
* Add unit test for this case

Bug: 2561789
Change-Id: I33a43c7a248059c97482ca147a23af083744118a
2010-04-01 10:10:41 -07:00
Marc Blank 700b373007 Send CANCEL method with meeting cancellations
* We should be sending CANCEL as the method with cancellations
* Fix this and update unit test

Bug: 2527606
Change-Id: I2b982e4bfd1dbc57660cf578702edf49584d2957
2010-03-31 17:44:23 -07:00
Marc Blank a6e1f8d456 Add message text for invitation replies
* Updated unit test to make sure there's message text

Bug: 2548714
Change-Id: I70e05b72539ff9ba7d582a51421e5345aa6151e4
2010-03-29 12:07:09 -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
Marc Blank 802a7d69b5 Format cleanup for CalendarUtilities
Change-Id: I6633435cbe0ee55f58da76658d2ccb12f421e326
2010-03-25 17:43:24 -07:00
Marc Blank 82b2453b97 Clean up EAS -> TimeZone determination code
* Use one minute before/after for transition checking, instead of the
  sloppier early version
* Add tests for additional known time zones
* Change most methods in CalendarUtilities to package private (for use
  with unit tests)
* Clean up a little bad formatting

Change-Id: I9e5be5e1c859f2294adf06874459f7db15fb8c22
2010-03-25 17:26:30 -07:00
Marc Blank eba33f8b5a Don't send bare line feeds to EAS 2.5
* EAS 2.5 doesn't like seeing bare LF's in Calendar location
  and description, and Events including them won't sync back to
  the server
* Create a utility to replace bare LF's with CRLF and write
  unit test for the utility
* Fix the bug by using this utility

Bug: 2542220
Change-Id: I2c72d23f15e3a922ebe3585e063abe9fa9e2366f
2010-03-25 17:16:46 -07:00
Makoto Onuki fe61f358ab Moved fromUtf8 from TestUtils to Utility.
And cleaned up SimpleIcsWriter.toString().

Change-Id: I383d91256c48be5263c695c8e8dd151d0e95d0a6
2010-03-24 12:07:32 -07:00
Makoto Onuki 95492af7a1 Merge "Show a calendar invitation icon on message list." 2010-03-23 10:50:37 -07:00
Makoto Onuki 79b006a08b Merge "Fix failing unit tests." 2010-03-22 15:56:10 -07:00
Makoto Onuki 0fdcac8028 Fix failing unit tests.
Bug 2534698
Bug 2534665

Change-Id: If07fc7113b517059bee937d019d464e9c1bc600f
2010-03-22 15:01:33 -07:00
Makoto Onuki 20c067c67c Show a calendar invitation icon on message list.
Bug 2522928

Change-Id: Ib29c7ee187cb0d864849b83693906b0a3b490734
2010-03-22 13:46:35 -07:00
Marc Blank d5822018fb Clean up VCALENDAR/TIME_ZONE_INFORMATION code
* Fix the transition times so that they occur at the hour
* Remove an unused variable
* Fix a reference to Calendar.HOUR that should have been
  Calendar.HOUR_OF_DAY
* Confirm that unit tests work properly

Change-Id: I3eaf31d160e97b5f3ba59c83878359085aea960d
2010-03-22 11:28:40 -07:00
Marc Blank aec526f141 Add unit test for VCALENDAR generation from TimeZone
* Sanity check runs through every TimeZone and makes sure that there
  are no exceptions thrown
* Also, that we find at least 10x as many TimeZone's with RRULEs as
  those without (empirical)

Change-Id: I2f266ac9d2a839f053bb5fda10a5b77dc8dd2c04
2010-03-20 18:48:55 -07:00
Marc Blank 39ea302126 Send appropriate ics message for cancellations
* We were sending cancellations with a request for reply, which is
  incorrect
* Send the correct dats in the ics attachment
* Update unit test to reflect this

Bug: 2527606
Change-Id: I4cea0bb8f1c29a3cad8d09fd6a4750f7ab067229
2010-03-19 10:17:25 -07:00
Jim Shuma f7da371234 Merge "Add "vibrate when silent" mode to notifications" 2010-03-18 16:30:33 -07:00
Jim Shuma 9e2ddca59d Add "vibrate when silent" mode to notifications
* Add "vibrate when silent" choice in UI
* Add storage for it in Email's provider.  Existing accounts default to
  their current settings (always vibrate / never vibrate).
* Respect new mode when notifications are posted
* Updated existing unit tests

Bug: 2457183
Change-Id: I5c933ac39dbef8b2028255f330e0b084a445421a
2010-03-18 13:57:25 -07:00
Andrew Stadler aadee36a34 Merge "Eliminate duplication in Yahoo! sent mailbox" 2010-03-18 10:18:30 -07:00
Andrew Stadler c4fcd852ba Eliminate duplication in Yahoo! sent mailbox
* Yahoo! is not supporting search by UID so I can't identify the new
  the UID after I upload.  This inability to correlate the local and
  remote messages means that we wind up syncing the same message back
  down, in a loop, which spawns more messages.
* Yahoo! has partial support for UIDPLUS, and reports the new UID when
  I append (upload) messages.
* Modify IMAP parser to parse response lists
* When APPENDUID is reported, use it (and skip the search)
* Modify the few other existing users of response lists to use the
  parsed versions instead.  Provided a couple of lightweight utilities
  to make it easier to work with ImapList.
* Unit tests for most of it.
* Optimization: share a static date/time parser for all IMAP connections

Bug: 2448220
Change-Id: Ic10fc1a195ccf4671a498188cc8b17848c8d9df7
2010-03-18 10:11:08 -07:00
Andrew Stadler 6d55bb08fd Merge "Fix cases of attachments with no name" 2010-03-17 18:16:33 -07:00
Andrew Stadler 7d738cb7e8 Fix cases of attachments with no name
* Most clients send name= in the content-type, but a few clients
  send only filename= in content-disposition.
* There was code to handle both cases, but due to two typos, it didn't
  work.
* Most easily reproduced by sending from hotmail/live web client.

Bug: 2366961
Change-Id: I1d9a00b9b5fd1094cfb8566c3248d94286a8ae91
2010-03-17 17:59:09 -07:00
Makoto Onuki a29495c03c Merge "Add a flag to dump email messages." 2010-03-17 15:46:00 -07:00
Makoto Onuki dfeb1184eb Add a flag to dump email messages.
It's useful to debug MIME related problems.

- New MimeStreamParser.LOG_MESSAGE flag
- Cleaned up LoggingInputStream, which now supports all InputStream methods
  (e.g. close, available, etc.) properly.
- LoggingInputStream now dumps non-printable ascii chars as '\xXX'.

Change-Id: I4391e125abd418defc1dc21e4f35cf6ef8448acb
2010-03-17 15:44:56 -07:00
Marc Blank 0ed690bfb4 Send meeting invite mail as multipart/alternative
* Turns out that Exchange 2003 requires the ics attachment to be in a
  multipart/alternative, rather than a multipart/mixed MIME message
* Exchange 2007 accepts both types
* Therefore, we change our output for this particular situation, i.e.
  a single attachment that is an ics file, to multipart/alternative
* Rename FLAG_SUPPRESS_CONTENT_DISPOSITION to FLAG_ICS_ALTERNATIVE_PART
  and make this flag do double duty - 1) suppress the Content-Disposition
  header (also required by Exchange) and 2) send the message as
  multipart/alternative
* Add unit tests for Rfc822Output to check that mime parts are composed
  properly

Bug: 2516394
Change-Id: I60e26f57b8ecaf01d0340e7828533334e0e7d45a
2010-03-17 09:59:24 -07:00
Makoto Onuki 88a94bca19 Exchange calendar: fixes for the ICS writer.
- Now SimpleIcsWriter does the UTF-8 conversion, and folds lines according
  to the number of bytes in UTF-8.
- It now escapes special chars in TEXT values.  You can safely put , ; \ or
  line breaks. in summary, location, and description.
- Quotes all CN.  (leftover from Ibb8f155a)
- Replace "s in CN with 's (rather than removing them)

Bug 2508283
Bug 2515768

Change-Id: Ibdced53ee32bba950608d63f507b11b24eaad7b0
2010-03-16 13:05:34 -07:00
Marc Blank bf916efe95 Improve message text for invites w/ recurrences
* Add the (recurring) text when the invite is for a recurring
  meeting
* Add a test for message text creation

Bug: 2515474
Change-Id: Ifefbc2ba1ac444175180cb7a58f4ec554d9674a3
2010-03-16 08:45:59 -07:00
Marc Blank befa974de8 Fix utility that retrieves tokens from RRULEs
* The utility wasn't handling commas properly, causing the referenced
  bug
* Fixed the utility and updated the relevant test case

Bug: 2515488
Change-Id: Id229e50fcaaed1a0142db301eedaaba9209bed13
2010-03-15 14:04:19 -07:00
Makoto Onuki fc3fc5d26c ICS Writer: Quote common name.
Quote common name (CN) in ATTENDEE per RFC 5545.

Bug 2510783

Change-Id: Ibb8f155a43cbe43886b903472489563242cb6771
2010-03-15 12:23:47 -07:00
Makoto Onuki 20225d5760 Explicitly send ICS files in UTF-8.
- In memory attachments are now stored as byte[], not String.
  We can store any type of contents now.
- Added blob content_bytes to the Attachment table.
  The content field is now deprecated and not used.
- Explicitly convert ICS files to UTF-8.

- Added Utility.to/fromUtf8().

Bug 2509287
Change-Id: I3785a365a9a34039ec12ba82bd857dcdbc4de92d
2010-03-15 10:51:58 -07:00
Marc Blank 82e51e0631 Send email related to event exceptions
* We weren't sending out appropriate emails for exceptions and other
  event updates
* Write exception specific ics file code in CalendarUtilities (in
  the existing ics file creator)
* Send appropriate Update: subject for updated events/exceptions
* Compose simple message text consisting of:
  When: <time>
  Where: <location>
* Prepend message text for exceptions to indicate that the message
  relates to a particular instance of the event:
  This event has been canceled for: <date>
  The details of this event have been changed for: <date>
* New strings were added in CL#44141
* Updated CalendarUtilities tests

Bug: 2501270
Change-Id: I920de8120bc56d5bd565cbde26ff4807be41579f
2010-03-12 11:12:23 -08:00
Marc Blank ff556f7b5f Fix #2508283 (Improper wrapping of long text in ics attachments)
* Ignore CR and change LF into backslash + n
* Write unit test for handling of CRLF's
* Rename mLineCount to mColumnCount, which is more appropriate

Bug: 2508283
Change-Id: I8b2081aa474cb07b6cb09383ff6ac58a1dab1bba
2010-03-11 16:28:52 -08:00