Commit Graph

232 Commits

Author SHA1 Message Date
Jorge Ruesga 08ace26ed6 email: imap push
Change-Id: I8a184a5644e4322ee65d969e14cd47fe119f5df2
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
2015-10-18 14:05:32 -07:00
Jorge Ruesga 598a070c27 email: support for auto-sync multiple IMAP folders
This enables to auto-sync multiple IMAP folders, not only Inbox. Default to Inbox only.
This changes relays in the syncloopback attribute to configure the folders to add to
sync process.

Change-Id: I8973cfd6ddec33446256bc8b48418558e27596b5
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
2015-10-18 14:03:22 -07:00
Jorge Ruesga 8210da8b50 email: suggested contacts
This change adds support for suggested contacts (email addresses not in the contact
provider and received via email). The implementation creates a new separate
"extras" database (to avoid conflicts with future aosp changes). In the table
SuggestedContacts are stored every email address present in every email inserted
in the database.
This allow to display this contacts in the RecipientEditTextView when compose an email.
Suggested contacts are selected by account (only those ones received by that account).

This features is opt-out by default, but it can be activated in general settings by
choosing the suggested contact mode:

* none: Not active
* recents: Those received within the last 7 days
* all: All the suggested contacts

Change-Id: I156c3b1e2c4e4cff985a2183bc72b805bd596f3b
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
2015-10-18 14:03:21 -07:00
Ricardo Cerqueira 7fbf9f957c DBHelper: Support upgrades from CM11
Add the new columns when coming from v126, add the old ones when
coming from any other value (or creating) so that they're there
when the feature gets reintroduced

Change-Id: I48ec042b30afbcefd43bdad0042147b6b0d2249f
2015-10-18 14:02:20 -07:00
Anthony Lee 8b7fd49b13 Fix restoreBodySource key so it returns the correct value.
The previous version of this function would return the _ID value
instead of the SOURCE_MESSAGE_KEY value from the Body row.

Bug: 17720266
Change-Id: Ie4cfc988b0659892b68d31472ef0c41d4aa98c68
2014-10-21 13:19:45 -07:00
James Lemieux 40236a8931 Display sync errors using snackbar and not as a TL footer
b/16463253

The FAB compose button overlaps the action button found in the TL footer
when network errors occur during sync. To avoid this overlap, the snackbar
is used to display these errors and they no longer appear as a TL footer.

In order to signal the sync error to AAC for display in the snackbar, the
Folder.lastSyncResult needed to be encoded in the manner that AAC reads.
This was not happening for POP/IMAP/Exchange accounts, so a large portion
of this change is encoding that value properly every place it is written.

To ensure the value is read/written properly everywhere, common methods were
introduced in UIProvider that do this work. UIProviderTest was also added
to ensure the read/write methods agree with each other.

Finally, the display of the "Load More" TL footer was updated to match the
latest spec.

Change-Id: I9d3ae1157f288f05b0fed4d1385858f6c9ebfbf9
2014-09-29 17:51:27 -07:00
Martin Hibdon 3c2f782c35 When we migrate Exchange folders, set the sync status to INITIAL_SYNC_NEEDED
b/17443087
When we migrate exchange accounts, we copy mailboxes over to the
new account (in order to preserve sync frequency and window).
The problem with this is, you may have many accounts/mailboxes.
After starting the app, it may take quite a long time before all
mailboxes are synced. If the user visits some mailbox near the
bottom, they'll see a misleading "folder is empty" view.
Now, when migrating, we'll set the uisyncstatus to INITIAL_SYNC_NEEDED.

Here I needed to add INITAL_SYNC_NEEDED to the list of states
that EmailConversationCursor will consider incompletely loaded.

Change-Id: Idef13adf9d691c03665830a2f926b1806d7591da
2014-09-26 16:02:22 -07:00
Martin Hibdon 123d40283e Make sure to close a cursor
b/17570154

Change-Id: I759a116a14784e92e7fa7eb51755ceda3860550e
2014-09-24 11:30:52 -07:00
Tony Mantler 486e971066 Fix providers.xml alternate diversion
b/17048013

Change-Id: If2bc857266a6ba1445bf1fabbaed179c1b13a14f
2014-08-15 11:54:56 -07:00
Régis Décamps c3404cca71 Better documentation for "Account display name".
Give examples of what the display name is.

Change-Id: I2934dc9e8b95d0b32b9c1e9fab391d7ba9e997da
2014-07-10 19:54:02 +02:00
Tony Mantler 88580cd5e0 Merge "Unify settings activity" into ub-mail-master 2014-06-27 15:56:14 +00:00
Tony Mantler 06415a635f Unify settings activity
b/9566150

- Install PublicPreferenceActivity
- Create AccountServerSettingsActivity to contain all the crazy
    logic we don't want in AccountSettings
- Add restoreAccountWithAddress to Account
- Refactor almost everything out of AccountSettings
- Tidy the QuickResponse fragment
- Majorly refactor the AccountSettingsFragment to decouple it from
    the activity, and make it save settings immediately instead of
    when pausing
- Move login warning dialog to AccountSettingsFragment
- Tweak HeadlessAccountSettingsLoader

Change-Id: Ie69181d968b9c3e5940cfef9690b1f5c70e21aa8
2014-06-27 10:49:18 -07:00
Anthony Lee 3d16e5d4b9 Move over to the new AttachmentService.
Change-Id: I4a687b003884ea6a92a755fcbf394001bfc96a38
2014-06-25 09:56:29 -07:00
Paul Westbrook 4038f464de Enable supression of combined account
This enables the client of the provider to suppress the email combined
account.  Later, the UI can enable a combined account that spans all of
the account types

Change-Id: I77e201f751019240af2274a1f74e2124b9889aab
2014-06-20 00:09:07 -07:00
Tony Mantler 51af59fc66 Remove unused preferences and dead code
Change-Id: Ica8bd735a91417ed44bd547ab7176832745d729e
2014-06-10 11:29:17 -07:00
James Lemieux 97fb20697c Merge "Unit Tests for serialization of Account and HostAuth objects" into ub-mail-master 2014-06-09 23:33:17 +00: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 524e0a5fbc am 73101f3a: Fix OAuth when changing credentials from settings
* commit '73101f3a7bc1e735199a7c2c18358e9db9af0bca':
  Fix OAuth when changing credentials from settings
2014-06-09 22:50:37 +00:00
Tony Mantler 73101f3a7b Fix OAuth when changing credentials from settings
b/15521401

Change-Id: I7909389943c8e3eefbef0699f1c7c9c338282ca5
(cherry picked from commit 994c282d80)
2014-06-09 22:45:45 +00:00
Tony Mantler 994c282d80 Fix OAuth when changing credentials from settings
b/15521401

Change-Id: I7909389943c8e3eefbef0699f1c7c9c338282ca5
2014-06-09 15:28:11 -07:00
Tony Mantler c1265d2090 Merge "Move email bodies to files" into ub-mail-master 2014-05-15 16:43:00 +00:00
Tony Mantler 34c2e1619d Fix FLAG_OAUTH usage
Also fix some excessive checking of incoming/outgoing settings fragments

b/14969455 b/14971192

Change-Id: I6cf83aa59d381d3bbfc33e0d4a6e133c1814ba69
2014-05-14 16:31:04 -07:00
Tony Mantler 82a207132b Move account backup/restore to userdata in AccountManager
Change-Id: Iea9f2a1b1f2d87e07d63cbb1df5a0d6355ea4031
2014-05-14 15:15:49 -07:00
Tony Mantler 7525feb244 Move email bodies to files
Change-Id: Icfd0c4ab2ad25cc02b45cf41e7a205c17948ef2c
2014-05-14 13:27:49 -07:00
Tony Mantler 8518665a04 Fix projection columns, begin removing another unused field
Change-Id: I89126dba47ed6e78c870d458c4f286a37f763a66
2014-05-13 15:41:39 -07:00
Tony Mantler 2f97a7c658 Clean up unused code and warnings in Account
Change-Id: I40475eb6c8afa6b7b28fd143b9ad4fd268ff4657
2014-05-13 10:46:30 -07:00
Tony Mantler 2f288864b6 Fetch email bodies using ContentResolver#openInputStream
This brings us further along the path to storing email bodies
outside of the database.

Change-Id: I96296114ade0d561df724878ed92999306bcd176
2014-05-08 15:50:57 -07:00
Tony Mantler d3154ecc6e Warnings and finals
Change-Id: Idc31b2f3376db73b90558fb22bdcdf4ff6f92b7d
2014-04-29 13:36:24 -07:00
Anthony Lee 533093abd7 Make sure that queries against the Body table have ID columns.
Performed some cleanup and updated the source key projection
to include an ID to make sure that EmailMessageCursor works
properly.

Change-Id: I272fac474de876fdd2a08136e0ba97b3f5dc2c7e
2014-04-28 16:11:04 -07:00
Tony Mantler 3c73a04bec Continue purging the unused reply parts
Change-Id: I47b5bbe50ba36e68ad7ba80647f401b992660ba1
2014-04-18 14:04:23 -07:00
Tony Mantler fd69e5b036 Purge unused/obsolete body fields
Change-Id: Idafa09b58f5753e4cb3cad754c861cc8e3d80c34
2014-04-17 14:32:10 -07:00
Tony Mantler 9caaebb142 Bypass the cursor completely when passing message within EmailContent contexts
We should investigate using PFDs when passing to the UI layer too, for consistency

Change-Id: I21ad1987926b93af20287ae8e49bfc7a4ad99570
2014-04-16 16:49:29 -07:00
Tony Mantler 3dd85723a1 Cleanup in EmailContent
Change-Id: Ifa251eb206779f59ea003f99395d454c7e407bc2
2014-04-14 12:54:39 -07:00
Tony Mantler 2aeb498d4e Fix attachment loading for messages which have been forwarded
These attachments have a contentUri where the attachment ID is not equal
to the ID of the actual attachment.

b/13900073

Change-Id: Ic62b8165be2e80bc47eac40dc9eb5ac53c3cd6c5
2014-04-08 14:18:56 -07:00
Martin Hibdon dc0ac5a316 Upgrade my logging from .e to .wtf
b/13640564

Change-Id: I360aa6bab99cc1c414b4f89fcfe3c82eb6e282c3
(cherry picked from commit 8eaa3f029e)
2014-03-27 21:30:46 +00:00
Martin Hibdon 7c8eee40c1 Add logging to help track down a bug causing invalid credentials
b/13640564

Change-Id: I1161764e1278375eb786689a11e6899e8363fc8b
(cherry picked from commit 5419284715)
2014-03-27 21:25:16 +00: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
Tony Mantler 76472ae40c Merge setup fragments under a single activity
Change-Id: I10cf8bb9f6bc1a26ea97ae664f0196ae9e9493b5
2014-02-26 13:47:41 -08: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
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 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
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
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 0b25179dab Allow database to hold oauth credentials
Change-Id: I127297fd78c7676995f1dcfa59fbbcafe4e72e8e
2013-12-09 16:18:28 -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
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
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