Commit Graph

80 Commits

Author SHA1 Message Date
Scott Mertz 7f1a3b1f12 EmailTests: fix api change
Change-Id: I170478bb91d847ba9d42515c5d5c29a92f3765dc
2015-10-18 14:05:32 -07:00
Paul Westbrook d37ca267dd Clean up proguard test flags file
Change-Id: I2db858b59e0b1c6ff199aa7b11b99ee6e019ea72
2014-08-01 16:44:56 -07:00
James Lemieux 9250f47872 Unit Tests for serialization of Account and HostAuth objects
b/14998528

These are particularly important since they are stored in JSON form within the
Account Manager, so maintaining backward compatibility when future changes are
introduced is crucial.

Change-Id: I51333a364726a4c7e2fe88ee888e8c4cc11d962f
2014-06-09 16:18:27 -07:00
Tony Mantler 9b8dafe23a Add test for HostAuth parceling
b/14998526

Change-Id: Ic92424f6f2fc2eec261e2ce91158cc396eb24ffc
2014-05-15 23:24:05 +00:00
Tony Mantler 9a80ffce14 Handle attachment filenames with % characters
b/14571903

Change-Id: I3296bebfb4c6902750c68c9d3fb79ce644dbb137
2014-05-06 10:26:45 -07:00
Jay Shrauner 2fc13087e7 Parse abbreviated date fields
Add support for abbreviated dates with no timestamp (eg, "2009-01-02") to
parseEmailDateTimeToMillis.

Bug:14496986
Change-Id: Ifc77cb75fd9e23536b48c8f6ecefc0e2e8f1cc2c
2014-05-02 16:17:17 -07:00
Jay Shrauner 988d2b6e85 Fix Exchange crash when parsing abbreviated dates
Detect fully qualified and abbreviated date/time stamps in parseDateTime.
Previously parsed fully qualified forms like 20090211T180303Z; now also
parses 20090211.

Bug:14279251
Change-Id: I9a99ae16a5c1fe87b977fbebdba307baa653d539
2014-04-30 09:53:00 -07:00
Tony Mantler 3c73a04bec Continue purging the unused reply parts
Change-Id: I47b5bbe50ba36e68ad7ba80647f401b992660ba1
2014-04-18 14:04:23 -07:00
Tony Mantler 845db97119 Fix some missed class renames
Change-Id: I82c9e21049096525cc55fa57e5cc307844014832
2014-04-15 11:50:20 -07:00
James Lemieux 5057d6dffb Replying to a Message with an encoded email address shows the encoded address in the to field.
b/11658428

As per Yu Ping's advice, we alter the storage of all email addresses (from, to, cc, bcc and
replyto) to be stored in *decoded* format within our database. This makes them both human
readable when inspecting the database manually and alleviates the need to repeatedly decode
them before they are displayed anywhere in our UI layers.

As part of this bugfix, I resurrected several tests related to the LegacyConversions class out of
LegacyConversionsTests and into a new (not Suppressed) test class: LegacyConversionsTest

Change-Id: Ie2e3264646e25c08c4ba74f60b3e1090c052e6c6
2014-03-27 23:25:53 +00:00
Tony Mantler 38f9991634 Fix IMAP message upsync to include attachments.
b/13138456

Change-Id: If16b619a650c640a37cb4563750a6327a5e601e6
(cherry picked from commit 0c8696c2eb)
2014-03-27 21:23:32 +00:00
Tony Mantler 951eb080f9 Fix tests
b/13244976

Change-Id: I8aa00e32b1a2155242ed30a61b27db16fe15b605
2014-02-28 14:21:41 -08:00
Jerry Xie 3555dc03bf Add @SmallTest annotation to test classes so they get run in continuous
Change-Id: Ieb0e3af146a6668c813ff16a718221eae61e8e01
2014-02-19 20:13:59 -08:00
Tony Mantler feeb1e3ada Mark otherwise unused method as @VisibleForTesting
Also fix spelling cancellAllInterrupt -> cancelAllInterrupt

b/13082964

Change-Id: I2fef949bb351a536fdd0d7058b3df2b03eecb39e
2014-02-18 15:59:03 -08:00
Tony Mantler 877825cfb0 Deduplicate Address class
Change-Id: I50a6a61c78935a7ecfb56be0a5eaed644dea9ed0
2014-01-08 11:17:20 -08:00
Jerry Xie 7037a0bd3d Disable, suppress, remove broken and obsolete Email tests
Change-Id: Ia4dcba1c6966f23dd2a15e69324b7345aed8f944
2013-12-16 18:18:51 -08:00
Jerry Xie 17d3a29c9d Get Email units to compile
Change-Id: I171a0e2421c5006d9862ad94f886932146547020
2013-12-05 11:11:21 -08:00
Tony Mantler 2ed113c713 Foreign characters may be letters and digits, but they're not allowed in Uri/Url schemes
b/11356390

Change-Id: Ic510607ab5f671e3f3f474ea3c2f4af7e9966cb1
2013-10-31 16:39:03 -07:00
Tony Mantler c6953b7755 Reimplement QuickResponse support
b/8622751

Change-Id: Id079efcf34dce15b5f5057f937582c0e198d3d50
2013-08-16 14:08:54 -07:00
Scott Kennedy 560bfadc31 Unify LogTag
There is now only one LogTag class. The static initializer of
GmailApplication (existing) and EmailApplication (new) will now set
the log tag to "Gmail" and "Email", respectively. Up until that code
is run, it will be "UnifiedEmail".

"setprop log.tag.Gmail VERBOSE" (or .Email) will trigger all logs to
be printed as long as they go through LogUtils, regardless of what tag
is used by that individual log. This lets us still turn on logging
everywhere in one command, but also lets us use more descriptive tags
(like the class name).

And since we no longer have three com.android.mail.utils.LogTag
classes, builds will be much easier.

Also, we now use LogUtils everywhere.

Change-Id: I55f1c7a66ce50ead54877a13e40256422a56dc39
2013-06-05 20:06:15 -07:00
Yu Ping Hu 8e2c4056ca Clean up dead code. Should be a no-op for functionality.
Also includes a fix for saving a draft that's already
been saved (used to create a new one).

The following were unused:
- accountIdAddToField
- mailboxIdAddToField
- uisendmail
- uisavedraft
- uiupdatedraft
- uisenddraft

Deleting those also allows us to remove the translation
from the Bundle used by calls to the ContentValues used by
update (since the update paths are now gone).

Change-Id: I87f2875e3272177a128a8ff65541e51b1f2d05fc
2013-03-14 14:40:39 -07:00
Scott Kennedy 7fdde9bb4a Cache column name/indexes so we can use getColumnIndex()
MatrixCursor doesn't do this, so we need to add our own cache.

Depends on Ia5ffd31f54a2a335f495df5e0d1a0886ee08c14b

Change-Id: Ica78e3cec747bf86fcef16508156e359216c64fe
2013-02-06 17:09:42 -08:00
Marc Blank e714bb9d15 Convert authorities, intents, and account manager types
* Tested ok on wiped Nexus
* Tested ok on S3
* Upgrade verified on Nexus

Change-Id: If5d4ce594f8a309cdb59589d10b1d33f3b79326c
2012-08-31 23:26:36 -07:00
Marc Blank 03cd72805d Revert to old Email app
* These are the last sources in the ICS-MR1 tree

Change-Id: Ida4651bddd92a06a518d00f3e1f275ab3a80c8ae
2012-04-25 13:58:23 -07:00
Marc Blank bf5caf97c5 Notify by mailbox, rather than account
* Update EmailProvider, removing two no-longer-used columns in Account and
  Mailbox

Change-Id: Ie0f10eb0ca315d73e82be968f7760a51a239ba3f
2012-02-24 14:51:59 -08:00
Andy Huang 358a815701 Style cleanup in email message header to make it more like Gmail
Linkify email addresses in expanded message details
Remove divider line in upper header on phone
Embolden sender name
Twiddle expanded details line spacing and padding to match Gmail
Add space char to collapsed details recipient enumerator (comma)

Bug: 5520692
Bug: 5520787
Change-Id: Iad4a265168d111aa01654a33a9a14f7968fc3181
2011-11-02 15:50:00 -07:00
Marc Blank 0ff0e155c5 Fix findExistingAccount to treat underscore properly
Bug: 2318959
Change-Id: Ia39ed29084dc8111c61ff552fa65519789b7c23a
2011-10-20 18:41:26 -07:00
Ben Komalo 81a153463b Remove "Move" action on POP.
Bug: 5010614
Change-Id: If0a94840e9dc104566ba39d2e3240883dab5bba0
2011-07-20 13:21:06 -07:00
Makoto Onuki 8de5bda815 Close cursor properly.
Also, don't issue separate query()s for each recent mailbox.

Bug 4977956

Change-Id: I3ccd437a7efd5c3599c4a1952ba091a7b3b815bf
2011-06-29 19:21:14 -07:00
Marc Blank 244d306ebb Remove more useless code
* Strike another blow for sanity!

Change-Id: Id95b441f9577abda66f04113793d6b1c60500ebe
2011-06-29 14:07:25 -07:00
Marc Blank 77160c8c08 Merge "Don't cache ImapFolders" 2011-06-29 13:34:44 -07:00
Marc Blank 2720a818d5 Don't cache ImapFolders
* ImapFolder is currently very unsafe for use by multiple threads,
  causing, among other things, the referenced bug
* Since ImapFolder is very lightweight, there's no particularly good
  reason to be caching them anyway
* Rename isOpenForTest to isOpen

Bug: 4972084
Change-Id: I2bf17b9cfc8549a222e991f3e59abfd00a4d3afd
2011-06-29 13:02:55 -07:00
Makoto Onuki 50d934360d Fix the "onPostExecute executed even when cancelled" issue
Renamed onPostExecute to onSuccess and made sure it won't called
if a task is cancelled in time.

Also removed isCancelled().  To implement it right we should make sure
that onPostExecute() isn't finished when setting mCancelled, but it's a bit
of a pain to implement right, and we don't really have to use it.

Change-Id: I3a0baf504506ffc4952a5553f7098a8415842fa3
2011-06-29 10:22:38 -07:00
Makoto Onuki 6b968c1dce Introducing DelayedOperations
This helps post runnable to the handler and cancel pending runnables
at once.

It'll be used for delay-call methods that initiate a fragment transaction,
and cancel then in onSaveInstanceState().

Change-Id: Ib8bdb0e676e756854ab067a27e5e0f397219a4b4
2011-06-27 17:00:50 -07:00
Makoto Onuki 80d3875d30 Action bar: Use laoder to get current mailbox info
Before this CL, we had this crazy plumbing from MailboxListFragment
to ActionBarController to update the current mailbox name/message count.

This wouldn't work on 1-pane, so now ABC just gets the current mailbox id
from UIC and loads the name/count with its own loader.

Also...
- Fixed bug 4904450 and bug 4460470: Now we consistently use FolderProperties
to get proler display names and message counts.

- Renamed some confusing names in AccountSelectorAdapter

Change-Id: Ic7bea6da6d2859006fb8f9263024c7d5e62b1e7f
2011-06-23 16:06:45 -07:00
Marc Blank 6e418aa41a Improve EmailContent caching...
* Guarantee that up to 16 Account (with HostAuths), and Policy rows
  are always cached.  Also, 6 commonly used Mailboxes per Account
  (Inbox, Outbox, Drafts, Sent, Trash, and Search)
* Precache these rows when EmailProvider starts up
* Ensure that newly added, precachable rows are cached when created
* Clean up some inefficient/wrong caching code
* Fix a commonly called method in NotificationManager in which we
  load a single Mailbox row using selection vs withAppendedId
* Confirm that we don't read from the database in typical use and
  heavy message loading
* Add a special URI for finding mailbox by type (using the cache)
* Add special-case code for EmailContent.count(Account.CONTENT_URI)
  which is used in a number of places (including on the UI thread)
  and whose value is easily determined
* Add a special URI to get the default account id
* Confirm that all unit tests work

The goal here is to be able to load all Account, HostAuth, Policy,
and Mailbox objects (by id) without worrying about disk access.
There will still be a single disk read for uncommon Mailbox reads,
but this should be considered acceptable.

Change-Id: Ibc9aa7acc73185e360b0b6f3053b90a985e97210
TODO: Unit tests
2011-06-21 21:39:19 -07:00
Makoto Onuki ce4cce05b2 Fix failing tests
Fixed activity tests and and activity.setup tests.

Bug 4762098
Bug 4766087
Bug 4590590

Change-Id: Ifbd49f38c59854c65b6c48a1b03ca8153bfa558b
2011-06-21 11:18:32 -07:00
Jorge Lugo ae95fbf4d0 Merge "Added quick responses." 2011-06-20 15:10:06 -07:00
Jorge Lugo 5a3888f35b Added quick responses.
Added "Insert quick response" button to MessageCompose's action bar. Clicking
it opens dialog with available quick responses. Selecting one of the responses
will insert it into message body at the current cursor location. Also added
menu in account preferences to create, edit, and delete quick responses.

Change-Id: I85f3f6b36801cf112ec9d7c31135a917456173d7
2011-06-20 13:31:50 -07:00
Marc Blank 627bc6ed57 First implementation of IMAP search
* Broke up synchronizeMailboxGeneric into three pieces; it's still
  horrible, but this at least stops my eyes from bleeding
* Remove unused method/tests from Folder interface

Change-Id: Ib4d979536be657137cf70ca535cf429d707be41b
2011-06-16 20:26:52 -07:00
Marc Blank f5418f1f93 Move Account into its own top-level class
Change-Id: Ide7c991b7d4d418dbe17164421425bf898ba64ee
2011-06-13 15:37:22 -07:00
Marc Blank 85e4c101b0 Remove storeUri's except during auto-setup
* Remove per-store limitations
* Use constants for VISIBLE_WINDOW, rather than having the
  potential for differences between Stores

Change-Id: Idd5e0874bba6e3390e4f093bcb03f4b1bb399c11
2011-06-09 13:34:43 -07:00
Todd Kennedy 7984aa60a0 Add new field to mailbox test
there's a new field in the mailbox class that was causing a unit test failure.

bug 4552358

Change-Id: Id17a99b55248cdc9e4c5ea455506f72e52687599
2011-06-09 10:14:52 -07:00
Ben Komalo 724c3a81cd Introduce scheme name escaping in SSLUtils.
Change-Id: I73f19e7d40d0b19dfd41cfaf7db0879ef2e3a3ea
2011-06-08 13:33:38 -07:00
Ben Komalo 313586c8eb Introduce client cert alias for HostAuth.
Some email servers require client certificates to be presented to
establish an SSL connection. While this certificate will be maintained
by the system key store, we need to store the "alias" of the certificate
stored in that system store.

Wiring up to use the actual alias will be done in future CL's. It is
currently unused.

Change-Id: I8d1290151342daea9ceb0df8a4088405b44faa81
2011-06-07 18:48:23 -07:00
Marc Blank 75a754660e Update searchMessages API
* Store various search parameters in a new parcelable class

Change-Id: Iadec6a803b1bf17d89cd401c3fca1cb0ad3340d4
2011-06-02 21:41:17 -07:00
Ben Komalo 12b82d9374 Move HostAuth to top level class.
No other changes made.

Change-Id: I1c6497c98abc0f99443ea42d8aed6295b263c123
2011-05-19 15:28:48 -07:00
Makoto Onuki 4c4e4c3515 Clean up the method to build message list selection.
- Moved the method to EmailCommon.
- Use *_SELECTION for magic mailboxes
  (meaning we now use subqueries for magic mailbox selections, rather than
   building the mailbox ID list by ourselves)

Change-Id: I3ebf6af62fd912fea6faea0f75e05fc61c87af3b
2011-05-16 11:08:05 -07:00
Ben Komalo e0bb7e7909 Make Mailbox parcelable
Also fix unit tests

Change-Id: I5f64f53b278b7bc27053d831760b155532a14e33
2011-05-13 18:35:08 -07:00
Ben Komalo 53ea83ebf9 Move Mailbox to top level class.
No other changes made.

Change-Id: I3d8f3c521dc0d902be313b25252b4b6a4a96e7ee
2011-05-13 17:42:02 -07:00