Commit Graph

370 Commits

Author SHA1 Message Date
Scott Kennedy
048a2956da Revert "email: add support for Server Name Indication (SNI)"
This reverts commit 75cf76875e.

Bug: 13744933
Change-Id: I6ef39dfa13dcadc5a41c79f65bc0eed9d27dd447
2014-04-01 20:21:05 +00:00
Jorge Ruesga
75cf76875e email: add support for Server Name Indication (SNI)
Change the underlaying socket factory reference to SSLCertificateSocketFactory which
has support for SNI since 4.2, and remove the access to the obsolete methods from
the old factory reference.
This change will setup the socket with a proper hostname prior to the ssl handshake.

Change-Id: Ie537b1d8c3da33de3665e481320be134939155ca
Signed-off-by: Jorge Ruesga <j.ruesga.criado@gmail.com>
2014-03-31 10:54:16 -07:00
Martin Hibdon
524747f798 Merge "Upgrade my logging from .e to .wtf" into ub-mail-master 2014-03-27 20:19:15 +00:00
Martin Hibdon
8eaa3f029e Upgrade my logging from .e to .wtf
b/13640564

Change-Id: I360aa6bab99cc1c414b4f89fcfe3c82eb6e282c3
2014-03-27 13:17:15 -07:00
Martin Hibdon
d7dbf4201f Merge "Add logging to help track down a bug causing invalid credentials" into ub-mail-master 2014-03-27 20:05:31 +00:00
Martin Hibdon
5419284715 Add logging to help track down a bug causing invalid credentials
b/13640564

Change-Id: I1161764e1278375eb786689a11e6899e8363fc8b
2014-03-27 13:00:25 -07:00
Tony Mantler
0c8696c2eb Fix IMAP message upsync to include attachments.
b/13138456

Change-Id: If16b619a650c640a37cb4563750a6327a5e601e6
2014-03-26 11:49:38 -07:00
Anthony Lee
eba80c114e b/9564335. Add support for a maxAttachmentSize column in the Account
table and connect the data to the Settings object in the existing
location (SettingsColumns.MAX_ATTACHMENT_SIZE).

Change-Id: Iaf48995757511e1dfb65aa35ff6d81bbc47187bd

Conflicts:
	src/com/android/email/provider/DBHelper.java
2014-03-19 17:33:29 -07:00
Yu Ping Hu
8103f960d0 Add sync to IEmailService.
This supports the EasService design.

Yes, I just removed a startSync function from this interface last month. No,
I didn't quite know at the time that I'd be adding one back. :)

Change-Id: I19d9c7838473d8982560764fdba0056cba03d132
(cherry picked from commit 4a5b11d650)
2014-03-20 00:11:36 +00:00
Anthony Lee
70cb2878d7 Changed the IEmailService interface to accept and accountId in
the loadAttachment() call. This work was necessary to support
the new EasService & EasOperation infrastructure.

Change-Id: Idd507aec999596ccd4afa5f03ff2b3c2e38a9029
(cherry picked from commit efac8255ed75d22e60036e19e7a95f8407d18ad3)
2014-03-19 23:53:28 +00:00
Yu Ping Hu
701134953e Add pushModify to IEmailService.
This call lets the service know that the push settings for an
account have changed.

Change-Id: I7ed41853df6af6762c80283a2a3510ce41551657
(cherry picked from commit 446136a2278652c627068ecddff534de1ad431ab)
2014-03-19 23:51:14 +00:00
Yu Ping Hu
f679cd08d1 Delete unused functions from IEmailService.aidl.
Change-Id: I131d2d3436a50c94d664fc57c6514481d9afbc97
(cherry picked from commit 8ff6c107867bc2044ba50cad010dbf4a2e93436e)
2014-03-19 22:35:47 +00:00
James Lemieux
0dffe3afd7 Keep on getting a couldn't sign-in notification
b/11551107

This is caused by ImapConnection.doLogin() only throwing
AuthenticationFailedExceptions and not other varieties of exceptions.

While fixing this bug, I discovered that the ConversationListFooterView
that is displayed in response to a authentication failure contains a
button called "Sign In" that didn't actually do anything. I made it
navigate to the incoming account settings fragment where the user is
free to change the relevant account credentials.

Change-Id: I2c772ecab18f3e57059eceeae01de08f1fdab4c2
2014-03-07 16:38:47 -08:00
Tony Mantler
76472ae40c Merge setup fragments under a single activity
Change-Id: I10cf8bb9f6bc1a26ea97ae664f0196ae9e9493b5
2014-02-26 13:47:41 -08:00
Tony Mantler
822f17d6c1 Merge "Mark otherwise unused method as @VisibleForTesting" into ub-mail-master 2014-02-19 00:11:01 +00: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
Martin Hibdon
38fd08e470 Merge "Make settings flow work for OAuth" into ub-mail-master 2014-02-14 19:59:25 +00:00
Martin Hibdon
87de90282b Make settings flow work for OAuth
Now the password entry is removed from AccountSettingsBasics,
and the user is taken to either SignInActivity or AccountSetupType
after hitting the next button. This is a lot closer to the
desired setup flow as it allows for oauth signin.

Ideally this is not what we will ship for Algol, but it put us
in a state where we could ship if we had to.

Change-Id: I5b28bccd27c515572e4947ca877bd1772732507d
2014-02-14 11:55:26 -08:00
Anthony Lee
c165d9bd77 Merge "Introduce an SSL handshake timeout value of 30 seconds." into ub-mail-master 2014-02-13 19:15:42 +00:00
Anthony Lee
37a4c65e58 Introduce an SSL handshake timeout value of 30 seconds.
Motorola 0009-IKXREL1KK-5011 patch. Hanging on an SSL handshake is
a real situation that needs to be handled. 30 seconds is more than
enough of a timeout to abort on a potential hang. The coincidental
thing is that there was a fix that was made a while back to email 1
that addressed the same issue in similar code. You can reference it
here: b/7583420.

Change-Id: I0533e57f8c5d45d241adb7f37d54ebe1f0ad9368
2014-02-13 08:32:10 -08:00
Anthony Lee
6ef1621f44 In 4.4 unbindService can return other RuntimeExceptions outside of
IllegalArgumentException.  Make sure we catch it.

This fix comes from Motorola 0007-IKXREL1KK-3886 but part of that
patch was reverted because we already had found and fixed the
other problem.

Change-Id: I0b6aa1f91e7d2fa4dfc3af5ff590781c8812c14e
2014-02-12 14:08:40 -08:00
Tony Mantler
cd45d20256 Merge "Fix content observing" into ub-mail-master 2014-02-07 18:44:23 +00:00
Tony Mantler
0f8d16f56a Fix content observing
b/12834957

Change-Id: I00e2fc48e1d78665e0cdcfc3f4fb483f5a047252
2014-02-05 16:58:54 -08:00
Martin Hibdon
58fbd2a477 Add sign in Activity
This allows the user to choose which type of authentication
to use for existing IMAP accounts.

Change-Id: Ib44364a1059a2c4b8a7a0fa66b14cd042b28770e
2014-02-05 13:10:11 -08:00
Tony Mantler
7ee567f1b4 Merge "Clean up AccountSettingsFragment loading" into ub-mail-master 2014-01-30 23:04:10 +00:00
Tony Mantler
062f27fa37 Clean up AccountSettingsFragment loading
Also extend EmailContent to allow registering a ContentObserver

b/12816752

Change-Id: Ida873ac10101af92c627858d1d86c3a5ccd4ab26
2014-01-30 14:05:20 -08:00
James Lemieux
1fa303478c Eliminate redundant methods in Address class
THIS DOES NOT CHANGE ANY EXISTING FUNCTIONALITY.

Address.pack() has been removed and all calls replaced with its synonym Address.toHeader().
Address.unpack() has been renamed to Address.fromHeader() to follow the new naming convention.

In days of yore, pack() and toHeader() used to do different things. Now they are identical and
thus one is superfluous. We have standardized on toHeader() and fromHeader().

Change-Id: Iac91c966eb6c1477f8dba0dd2ae01c84b359e539
2014-01-22 16:15:57 -08:00
Martin Hibdon
e8eb6e659b Make OAuth work
Now you can authenticate your account using oauth
for google hosted accounts (e.g. google.com, gmail.com)
The setup ui is still not up to spec.

Change-Id: Ib2826653550a823b4d1b8739c1e483746cccbc22
2014-01-03 14:05:46 -08:00
Martin Hibdon
ab29555b72 Log the stack trace if we do a DB operation on the UI thread
Change-Id: I0b9e7fff502ef5ee0f8b373cb3352958b8de08c2
2014-01-03 09:07:01 -08:00
Tony Mantler
1a1064c488 Update target SDK to 19, and add uses-sdk tag for emailcommon
Change-Id: I9ec3cd29d841f82ba4d8466f1f3cdcc20b634626
2013-12-20 15:21:01 -08:00
Martin Hibdon
05723aa0f6 Don't put Credentials in HostAuth parcels
The problem is that exchange isn't compiled with this
change, so HostAuth parcels to or from exchange fail.
Ultimately, we'll need to probably create a HostAuth2
object or something along those lines. For now, just
change the format of HostAuth parcels back, so they
stay compatible with exchange, I'll figure out a real
solution later.

Change-Id: I9c8c8639b7b474fe82dfdc37a9e51a0451820105
2013-12-10 17:12:00 -08:00
Martin Hibdon
44a6fc31a2 Merge "Allow database to hold oauth credentials" into ub-mail-master 2013-12-10 00:27:32 +00:00
Martin Hibdon
0b25179dab Allow database to hold oauth credentials
Change-Id: I127297fd78c7676995f1dcfa59fbbcafe4e72e8e
2013-12-09 16:18:28 -08:00
Tony Mantler
fb9deb96c3 Make intents more explicit
also fix intent strings.

Change-Id: I880fd6cd6192ae43002e1ddc8558f823141c5952
2013-12-09 10:18:34 -08:00
Jerry Xie
b174976d59 Merge "Get Email units to compile" into ub-mail-master 2013-12-05 22:04:13 +00:00
Jerry Xie
17d3a29c9d Get Email units to compile
Change-Id: I171a0e2421c5006d9862ad94f886932146547020
2013-12-05 11:11:21 -08:00
Martin Hibdon
e62688f0d6 Add configuration for oauth providers
There is now an xml file that holds parameters for oauth
providers, and entries in providers.xml can specify that
they can use oauth.

Change-Id: Ibce5b207f83ce9c773f8f713be9e73bb068070ed
2013-12-03 16:27:08 -08:00
Tony Mantler
34662f11b2 Save policy when saving account
Also add a loader to AccountSecurity, and ignore when a policy contains unsupported requirements.

b/11790165

Change-Id: Idd651153848eea3216656047c5aba3bbd750ca0a
2013-11-27 14:42:49 -08:00
Yu Ping Hu
a702a7bbd8 Merge "Fix account deletion when removing security policies." into ub-mail-master 2013-11-25 23:38:03 +00:00
Yu Ping Hu
a60550e0eb Fix account deletion when removing security policies.
- Delete accounts, not just account data.
- Wait for PIM data to get deleted before proceeding.
- Reconcile after deleting an account.

Bug: 11856902
Change-Id: Ie52b7c583688bf48a33bcf6b4e555b8c055b476c
2013-11-25 12:50:28 -08:00
Tony Mantler
4b629cf258 Null check certificate alias before trying to configure it
Bug: 11678638

Change-Id: Ia12789ac3553ef959a8c9bbf13f017b1a154f560
2013-11-15 20:51:00 +00:00
Yu Ping Hu
8fde9e27f8 Merge "Check for ArrayIndexOutOfBoundsException" into jb-ub-mail-ur10 2013-11-13 17:32:14 +00:00
Alon Albert
cde694c5e1 Check for ArrayIndexOutOfBoundsException
Quoted text pos may be out of bounds of message body.
This may be caused by the pos being calculated in html while the message is being
sent as plain text. A seperate CL will attempt to address the root cause. This
is a last resort so we don't crash.

Bug: 11538910
Change-Id: I326ebe56ee15368983caa2fa76605e7658dab014
2013-11-12 15:33:45 -08:00
Martin Hibdon
e39f2b0f27 Add fallbacks if sentDate is not set
b/11520812
This should make behavior better if the imap server
does not set the date header.

Change-Id: I593e14ce0a94179a39779ec47831fb8d3caef95b
2013-11-12 11:52:01 -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
Yu Ping Hu
5181cd6d4a Add a provider call to get device friendly name.
For now, it sends the device model name as friendly name, in lieu
of actually having a user-supplied friendly name. This is wrong
for at least two reasons:

1) We need to have an actual user-supplied friendly name, but that's
   not easy to find.
2) This really shouldn't be a provider query -- it should be something
   the Exchange can know locally (ideally this is a system preference
   but that's not currently implemented). This workaround just lets
   us have some reasonable value that we can update easily.

Bug: 11161234
Change-Id: If83ad768736de19c9d0e833d1f86a6ce9daf5039
2013-10-30 11:50:41 -07:00
Yu Ping Hu
feacaf6351 Do not try to load nameless attachments.
Bug: 11347094
Change-Id: I46321755cebe25858c0188f35270d428dfe4a435
2013-10-25 14:21:02 -07:00
Martin Hibdon
c86fbb5bcb Add an additional mailbox key column to message table
b/11294681
The problem is that when we try to open an attachment for a
message in search results, it fails. The reason is that part of
loading the attachment, we need to open the remote folder the
message is in. For search results, the message's mailboxKey is
the special fake "search_results" folder, which doesn't actually
exist on the server.
For this change, I've added a new column called "mainMailboxKey".
For search results, this column will be populated with the real
mailbox the message is in. It will be blank for other messages.

This is a quick and low risk fix for this bug, but it's kind
of awkward. We would prefer to do one or both of the following
some time after MR1.

1. Make the "search_results" folder be a virtual folder, the same
way that unread, starred, and other virtual folders are. For these,
there is actually no mailbox row in the database, just some
queries that check various flags in the messages and behave
like folders in the UI. The messages actually still reside in the
real folders.
2. Remove the requirement to open the folder at all to load the
attachment.

Change-Id: I825ab846f78bf8b041a5d1d579260dc5d7b4c522
2013-10-23 14:58:57 -07:00
Yu Ping Hu
d0b81a0d06 Treat updates into non-existent body rows as inserts.
Bug: 11245727
Change-Id: I648b0267e9149f3f431ce01be9789087f73edab1
2013-10-21 16:35:45 -07:00
Yu Ping Hu
a5a28ffb63 Do not require RPC for getCapabilities.
Bug: 11241892
Change-Id: I3da136c9035414c821ee2038da01134c551bb9dd
2013-10-18 14:09:09 -07:00