Commit Graph

4787 Commits

Author SHA1 Message Date
Martin Hibdon ad94ecc471 Fix account setup test
Change-Id: I7c1b785e5aa29cc7f47920d857441f1a09f05b21
2014-02-18 12:25:41 -08:00
Martin Hibdon 0962a44fc4 Merge "Update layouts for setup" into ub-mail-master 2014-02-14 23:42:22 +00:00
Martin Hibdon da9c2d66f6 Merge "Remove some security violating logging" into ub-mail-master 2014-02-14 23:40:13 +00:00
Martin Hibdon b94bfc31cd Remove some security violating logging
Change-Id: Icf53b132516be5f1b392fb9bd3a8970634212642
2014-02-14 15:36:38 -08:00
Martin Hibdon 8919f5738d Update layouts for setup
Change-Id: I5508f6f8640ffdf60f8d1d7282cc7ed3ce30f86c
2014-02-14 15:29:56 -08:00
Martin Hibdon b9f8dbce19 Change account settings buttons back to text
We actually only want the nav arrows on initial
account setup, not in regular settings.

Change-Id: I02e153638e5df29c1fd7aa134db36bde9fc0666e
2014-02-14 13:30:02 -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
Martin Hibdon 7b42720199 Fix some more setup layouts
This moves the nav buttons to the bottom of the screen, and
improves tablet layouts.

Change-Id: I20642c81b96307e4f45b1b3ad1337d4ff5aafd2e
2014-02-10 15:45:33 -08:00
Martin Hibdon 0c1617f6aa Fix the layout for the sign-in activity
Now, the forward and back buttons on part of the activity,
like the rest of setup.

Change-Id: I4c94b8e0ad79c972e2f79be67b80d51f2d19ca30
2014-02-10 15:14:56 -08:00
Tony Mantler cd45d20256 Merge "Fix content observing" into ub-mail-master 2014-02-07 18:44:23 +00:00
Martin Hibdon 3aa8013065 Update some setup layouts to use the new buttons
The layouts are still not all up to spec, but we're using
the right buttons now.

Change-Id: Iba22bb12d45f7510345f801f21cfc79728b314e4
2014-02-06 16:11:50 -08:00
Tony Mantler d006fc94a8 Merge "Convert MailboxSettings to a fragment and fix threading" into ub-mail-master 2014-02-06 20:00:30 +00:00
James Lemieux 7c413c6d51 Merge "Mail in Sent, Drafts and Outbox should show addressees, not sender." into ub-mail-master 2014-02-06 18:32:31 +00:00
Tony Mantler 0f8d16f56a Fix content observing
b/12834957

Change-Id: I00e2fc48e1d78665e0cdcfc3f4fb483f5a047252
2014-02-05 16:58:54 -08:00
James Lemieux 6f4a9eb876 Mail in Sent, Drafts and Outbox should show addressees, not sender.
b/10847599

This is the second attempt at fixing this bug. The strategy has
changed entirely to accommodate GMail as well as reuse formatting
rules that squish the list of conversation participants into an
abbreviated line for display in conversation lists.

ConversationInfo used to include a List<MessageInfo> which was
used to answer questions about which senders had read which
messages in the thread. This has been removed and replaced with a
List<ParticipantInfo>. The backend should populate that list with
appropriate conversation participants (e.g. recipients of the last
message in the case of Sent, Drafts or Outbox; senders for all
other mailbox types)

Change-Id: I32dcc2a255cccaf06c5976633380b2443729f357
2014-02-05 16:00:58 -08:00
Martin Hibdon 636239f417 Merge "Add sign in Activity" into ub-mail-master 2014-02-05 21:26:03 +00: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 94456929ff Merge "Enable d@d.d debugging" into ub-mail-master 2014-02-04 20:53:12 +00:00
Tony Mantler d88f132147 Don't try to toggle next button state when the fragment isn't attached
b/12886252

Change-Id: Ie19d8e946139d317f7e867449141dcfd82c510f8
2014-02-04 10:03:08 -08:00
Tony Mantler 70f25e15c9 Enable d@d.d debugging
Change-Id: I16fee21f3b7af0ae653580b5c0fd8b1da6a5d3ae
2014-02-04 09:51:52 -08:00
Tony Mantler 10e9bd96de Convert MailboxSettings to a fragment and fix threading
b/12838753

Change-Id: I58ae069e2e2860c0f7919f44ce125b0c3aad1969
2014-01-31 13:15:42 -08:00
Martin Hibdon cbab7b409d Fix the build
I left an abstract function unimplemented, but didn't realize
because the function was added to the interface in a very recent cl.

Change-Id: I2b091ed284c256e1624633be6a598ff2798075c0
2014-01-30 16:11:04 -08:00
Martin Hibdon 78280d51db Merge "Use the AuthenticationView for outgoing" into ub-mail-master 2014-01-30 23:29:14 +00:00
Martin Hibdon 9755267336 Use the AuthenticationView for outgoing
Change-Id: I42a6a8e0dfb271f22bbf1d2d18138d27809744bc
2014-01-30 15:20:15 -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
Martin Hibdon d23fa61a01 Make certificate selector work
Change-Id: Id1ae8c9bb9467effc8feca9d915dc4927c4bbe25
2014-01-30 12:54:49 -08:00
James Lemieux 8a41d9fd10 Merge "Eliminate redundant methods in Address class" into ub-mail-master 2014-01-30 19:08:04 +00:00
Martin Hibdon 26ff609ebf Fix a crash trying to use AuthenticationFragment
Putting authentication in a fragment was a problem, it
means that we need fragments as children of other fragments.
While this works in theory, it adds a lot of complexity.
Now, authentication is done with AuthenticationView,
which is just an extension of LinearLayout.
Currently, this does not yet handle adding certificates
for exchange accounts, but I'll fix that ASAP. As it is,
this is better than the current state, which crashes on
account setup 100% of the time.

Change-Id: I4274e7250f97012c3dc476003fd36fb960f2b728
2014-01-29 21:45:31 -08:00
Martin Hibdon 155bc17928 Merge "Create AuthenticationFragment" into ub-mail-master 2014-01-29 19:23:26 +00:00
Martin Hibdon 9195a12024 Create AuthenticationFragment
This is one fragment that holds all types of
authentication information, e.g. password,
OAuth info, and client certificates. What gets
displayed depends upon the type of account it is
dealing with.
So far this is only used in AccountSetupIncoming,
but later it can be added to other settings fragments.
There are still some issues with this, but I'd like
to check it in sooner than later to unblock other
work.

Change-Id: Iea675ad5c1727f32ca0baa270dfa793ab7109993
2014-01-29 11:20:53 -08:00
Tony Mantler 231bd8a53c Merge "Move account force-creation to onResume()" into ub-mail-master 2014-01-28 21:52:02 +00:00
James Lemieux 2d9cee433d Merge "Hardware Search button doesn't work" into ub-mail-master 2014-01-28 19:42:25 +00:00
Tony Mantler adf6cbed87 Move account force-creation to onResume()
Otherwise the fragment we query for the values isn't fully created yet.

b/12762185

Change-Id: I39ffa578e4bd6f6b5080112fa3cc617bbecbe158
2014-01-28 11:21:36 -08:00
James Lemieux 1988228999 Hardware Search button doesn't work
b/11689324

In Jelly Bean, the hardware button has been redirected to always open Google Now by default. But
Email does run on Ice Cream Sandwich and on that platform the hardware search button should invoke
a local search of Email. The issue at play here was that IMAP accounts weren't reporting themselves
as being capable of a remote server search, even though they are in practice. Adjusting this
capability fixes the issue.

Change-Id: I829d08d3bb9c8d09beacc85fe8b5903a8565d178
2014-01-28 11:10:05 -08:00
Tony Mantler b7361cf741 Merge "Don't add the initial account setup flow fragment to the back stack" into ub-mail-master 2014-01-28 19:07:16 +00:00
Tony Mantler dcf7274a1c Merge "Public constructors for fragments" into ub-mail-master 2014-01-23 00:31:36 +00: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
Tony Mantler 2ae3941a93 Don't add the initial account setup flow fragment to the back stack
b/12669681

Change-Id: I39c969d0667c4a394b46adacf58ce02f99c8a52b
2014-01-22 10:59:22 -08:00
Tony Mantler d44a802928 Merge "Save setup flow state when persisting activity state." into ub-mail-master 2014-01-22 18:27:42 +00:00
Tony Mantler e7f938d85c Save setup flow state when persisting activity state.
b/12664693

Change-Id: I90c98f720b4d1976f1982e778370a4218fa9832c
2014-01-21 15:13:53 -08:00
Tony Mantler ff8d375376 Public constructors for fragments
I don't know why I keep forgetting these...

b/12663972

Change-Id: Ibd17aa72bf3a71db0f089de003d30678a81655c8
2014-01-21 21:59:09 +00:00
Tony Mantler 5bbbe11596 Remove obsolete debugging code
Change-Id: I522a5a67ac0f4cf54834e03fd1ff1fe7f580c943
2014-01-17 14:59:33 -08:00
Tony Mantler 7e4daecc9a Merge AccountSetupNames and AccountSetupOptions
Change-Id: I5946e90e56b1fc725522d41e2e33d8125900a871
2014-01-16 14:18:58 -08:00
Tony Mantler bc089edacf Merge "Split AccountSetupOptions into Activity and Fragment" into ub-mail-master 2014-01-13 19:16:03 +00:00
Tony Mantler 499ac7b063 Split AccountSetupOptions into Activity and Fragment
Change-Id: I995c24315a26d14fbff9f1acd1bb7711403f418c
2014-01-10 16:43:36 -08:00
Martin Hibdon d710956640 Merge "Allow the quick response fragment to be displayed" into ub-mail-master 2014-01-09 22:06:16 +00:00
Martin Hibdon 0c7ff00df4 Allow the quick response fragment to be displayed
b/12442602

Change-Id: Iebd3ea3cd7b4120ae1690f8aba25d78e03d64b58
2014-01-09 13:58:16 -08:00
Martin Hibdon 6ae3bbfb72 Merge "Fix an oversight that wouldn't let us use oauth for dasher" into ub-mail-master 2014-01-09 21:52:36 +00:00
Tony Mantler f8b253d564 Merge "Split AccountSetupBasics into Activity and Fragment" into ub-mail-master 2014-01-09 21:51:07 +00:00
Martin Hibdon 3cba65acec Fix an oversight that wouldn't let us use oauth for dasher
b/12457993

Change-Id: I1ec31a17e292a76b26db5b5e75c51929d38c1f2d
2014-01-09 13:43:40 -08:00
Martin Hibdon c9ee5a389a Fix a crashing log line
b/12471608

Change-Id: I6d78c21c362f83322bf156e59ccb0935ff572772
2014-01-09 11:30:23 -08:00
Tony Mantler 9fad8219da Split AccountSetupBasics into Activity and Fragment
Change-Id: Ib002d84497517b2e5687515693c0e1085b110c85
2014-01-08 15:50:42 -08:00
Martin Hibdon 3f1d67533b Merge "Fix a privacy violating log" into ub-mail-master 2014-01-08 18:07:38 +00:00
Martin Hibdon 4e952d9cf4 Fix a privacy violating log
Change-Id: I0c49fde90e4c14e6751a927d0963533092fbef52
2014-01-08 09:30:16 -08:00
Martin Hibdon afecc01461 Add some logging to figure out why oauth signup fails
Change-Id: Ie706c54c1fb78c4da94cea091201d715251e1c46
2014-01-07 17:29:23 -08:00
Andrew Sapperstein e684f7d03c Merge "Support inline image UI changes in Email b/5555553" into ub-mail-master 2014-01-08 00:56:09 +00:00
Martin Hibdon 78d168c19d Fix a crash bringing up settings
Change-Id: If29fc7a4113ed7245cd82e6b26c63f08f4b9db2d
2014-01-07 16:41:43 -08:00
Martin Hibdon bc5a832da1 Allow oauth to be used for any account
This is needed to allow authentication for dasher accounts.

Change-Id: Ic743cf5e027cb9dfbc85896ebae975a3ea40d7bc
2014-01-06 15:41:45 -08:00
Tony Mantler e31fe0d47b Typo: CONVERSATION_PROJECTION_QUERY_CURSOR_WINDOW_LIMT
Change-Id: I5e28bc618a38e12f171b12f71352838b4f27dbbc
2014-01-03 15:44:12 -08:00
Martin Hibdon 37e2cbb005 Merge "Fix a case that would leak connections if an exception happens" into ub-mail-master 2014-01-03 22:47:20 +00:00
Martin Hibdon 9fe8131c3f Fix a case that would leak connections if an exception happens
Change-Id: I9f50911344e04f22e15bf9ba0c95f4e1b1422923
2014-01-03 14:33:28 -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 ff1ee36cb5 Close Imap connections when we are done using them
Also, clean up when we create and lose track of ImapStores.
Prior to this we were creating them often, and losing track of them,
which renders useless a lot of the complex logic in ImapStore devoted
to reusing connections.

Change-Id: I771d4e46d0c1cb9b605c43d9cbae6e52f5894745
2014-01-03 14:01:04 -08:00
Martin Hibdon 5f4fb9bb14 Merge "Close Imap connections when we are done using them" into ub-mail-master 2014-01-03 21:59:34 +00:00
Tony Mantler 885ec98307 Merge "Split AccountSetupNames into Activity and Fragment" into ub-mail-master 2014-01-03 20:57:01 +00:00
Andrew Sapperstein aef86e3501 Support inline image UI changes in Email b/5555553
A small CL to make sure email keeps compiling
and has the same behavior as before.

If Email wants to support long press to view image,
additional work needs to be done on the email side
in order to enable the full functionality.

Change-Id: I8e7cbdf2a2eee452fe9597097b77db5c8052d7fe
2014-01-03 11:12:14 -08:00
Tony Mantler 129e122608 Merge "Disable the compose activity when there are no accounts configured" into ub-mail-master 2014-01-03 18:31:34 +00:00
Tony Mantler 82b784b7c1 Merge "Re-background loading in AccountSecurity" into ub-mail-master 2014-01-03 18:30:59 +00:00
Martin Hibdon 6348f97c4b Merge "Fix a crash when bring up settings" into ub-mail-master 2014-01-03 17:42:54 +00:00
Martin Hibdon 15b06c2080 Fix a crash when bring up settings
It is now required that any activity that extends
PreferenceActivity implement isValidFragment.

Change-Id: I3ef79430b7f176186493bd09af693b48f8c040a1
2014-01-03 09:30:44 -08:00
Martin Hibdon 5de5354918 Update some error logging
Now it logs stack traces of exceptions, and does not use
exception.toString() as the format specifier, which can be
dangerous.

Change-Id: If841426067017c574c4aff88b8d8ae6b49ee867a
2014-01-03 08:54:34 -08:00
Tony Mantler 00219e9fb9 Make the notification coalescence set thread-local
b/12197387

Change-Id: I36e49f43fa405e14bf507ef46e0d7c825240b628
2014-01-02 16:16:08 -08:00
Tony Mantler 65b3850706 Set image loading to "ASK_FIRST" for all accounts
b/12217358

Change-Id: If3664c29e5920f29a2bba0136d61ac5c0a2fe0dc
2013-12-19 09:50:01 -08:00
Tony Mantler dc7fe8964c Disable the compose activity when there are no accounts configured
b/10042454

Change-Id: I45767d3e727b4c1fe858d80ca2e063b491827302
2013-12-17 14:24:37 -08:00
Tony Mantler 2d92d29c9f Clean up unused variables, sprinkle in some finals
Change-Id: I16126bbe2c56b63b332c3871f0e0731ae7940b55
2013-12-17 11:31:28 -08:00
Tony Mantler d7655067e4 Re-background loading in AccountSecurity
This time use a loader and post from onLoadFinished

b/11987449

Change-Id: Ibf64dbb6aebad4d5d7d8ee8cdb0980240b86ec35
2013-12-16 15:47:58 -08:00
Tony Mantler aaa5b71cec Split AccountSetupNames into Activity and Fragment
Change-Id: Ie42bbbc0c5a4cc5402d6df2837894b5eddd52501
2013-12-16 14:52:32 -08:00
Tony Mantler b9d071a493 Null check cursor
Mock provider is returning null on this query in testing.

b/12085240

Change-Id: Ifa5edc03707a6050acdbd5184a44409d46004e7e
2013-12-13 13:44:05 -08:00
Jerry Xie 2bf9590ddd Fix SQLite update query
Change-Id: I54a5e2f29e1e171901e7087e27d132256460f0f5
2013-12-10 16:46:45 -08:00
Tony Mantler b14f1a45a8 Merge "Convert SetupData into a retained fragment" into ub-mail-master 2013-12-10 19:24:16 +00: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 9c8c471f97 Convert SetupData into a retained fragment
This will keep it from being recreated quite as much while off-thread tasks are possibly mutating it.

Change-Id: Ic9873489906339c33a76b8a600c0fc28016debc4
2013-12-09 12:02:12 -08:00
Tony Mantler 471e792ab4 Merge "Pass projection into getVirtualMailboxRow() and getVirtualMailboxCursor()" into ub-mail-master 2013-12-09 18:45:58 +00:00
Tony Mantler e046d47c53 Pass projection into getVirtualMailboxRow() and getVirtualMailboxCursor()
b/10912870

Change-Id: Ief5137d113e91ee66318effdf4359629a8133131
2013-12-09 10:39:18 -08:00
Tony Mantler 10a5f9dba0 Merge "Make intents more explicit" into ub-mail-master 2013-12-09 18:28:59 +00:00
Tony Mantler 1644749d1b Merge "Clean up dead/weird code." into ub-mail-master 2013-12-09 18:22:08 +00:00
Tony Mantler fb9deb96c3 Make intents more explicit
also fix intent strings.

Change-Id: I880fd6cd6192ae43002e1ddc8558f823141c5952
2013-12-09 10:18:34 -08:00
Tony Mantler a4436636ba Merge "Coalesce notifications while in applyBatch" into ub-mail-master 2013-12-09 18:06:31 +00:00
Martin Hibdon c35e5257d8 Merge "Add temporary code to do oauth authentication" into ub-mail-master 2013-12-09 00:43:56 +00:00
Martin Hibdon 874d25ff70 Add temporary code to do oauth authentication
This just adds an oauth button to the accountSetupBasics
screen, which will launch a webview and go to the google
authentication page.

Change-Id: I09d5182fa6081fb94b40e7910b71afbbee70387e
2013-12-06 17:39:23 -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 5632d4449b Merge "Add configuration for oauth providers" into ub-mail-master 2013-12-04 00:29:17 +00: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 da6848056c Don't use a loader here, because we'll crash when committing fragment transactions
TODO: Fix the foreground provider calls later.

b/11972196

Change-Id: I0af6455447a2b37ff08c449efc1abf508254df19
2013-12-03 13:50:56 -08:00
Tony Mantler 57a821368a Retrieve the user's real name from the system
Also use a loader instead of an async task.

Change-Id: Ie9c033be0807bebdb559d9ce255a49b52a00134a
2013-12-02 13:34:44 -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 c80688903d Line length
Change-Id: I50cf8aef2de5ec490cc081a1c67e6f3727b15cb1
2013-11-22 16:08:06 -08:00
Tony Mantler 5ec2108cf0 Clean up dead/weird code.
Change-Id: I27da217fc919bee6804b12ee8ec5f5a78b1ee410
2013-11-22 10:36:09 -08:00
Tony Mantler 8196f82ce2 Use update notification intent to trigger notifications
This ensures the SuppressNotificationReceiver object quiesces the notification while we're viewing the folder

b/11789666

Change-Id: I98f388844b29458e7ea7deee398f7d8536b1919c
2013-11-21 13:18:57 -08:00
Tony Mantler 32786342d9 am 6953d595: Null check service info
* commit '6953d5951fed975d2569ec46bd544ce21e6860dc':
  Null check service info
2013-11-19 16:56:58 -08:00
Tony Mantler 6953d5951f Null check service info
b/11754422

Change-Id: Iae3c87c894eb3d16880768a3b8894e43d75a5878
2013-11-19 15:45:07 -08:00
Yu Ping Hu 583743db02 am bc8bc050: During upgrade, ignore protocols whose strings don\'t change.
* commit 'bc8bc050b080287c35241f5ab0c310bbbdb6e805':
  During upgrade, ignore protocols whose strings don't change.
2013-11-14 18:38:04 -08:00
Yu Ping Hu bc8bc050b0 During upgrade, ignore protocols whose strings don't change.
Copied from https://googleplex-android-review.googlesource.com/#/c/389215/
in order to submit for ur10, also made a minor change to early out when
we know it's a no-op.

Bug: 11258856
Change-Id: I28415e97225a216c16abb6ad7c48a860c5370173
2013-11-14 18:19:12 -08:00
Tony Mantler 05649dca2f Coalesce notifications while in applyBatch
Also divert all notifications through notifyUI()

Change-Id: If3b1ee05a8933bed5718e7b90137dbb0139a761a
2013-11-14 10:39:21 -08:00
Yu Ping Hu 3d899bcebe am fabb15fa: Merge "Add fallbacks if sentDate is not set" into jb-ub-mail-ur10
* commit 'fabb15fafe32ead0a84c7970ed390baaa81cd7c9':
  Add fallbacks if sentDate is not set
2013-11-13 09:35:47 -08:00
Yu Ping Hu fabb15fafe Merge "Add fallbacks if sentDate is not set" into jb-ub-mail-ur10 2013-11-13 17:32:06 +00: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
Martin Hibdon 19591ef035 am ad0e4288: Merge "Fix an infinitely retrying download problem" into jb-ub-mail-ur10
* commit 'ad0e42887f900cc5966ae3a74b4beb903c8c0072':
  Fix an infinitely retrying download problem
2013-11-12 11:32:10 -08:00
Martin Hibdon ad0e42887f Merge "Fix an infinitely retrying download problem" into jb-ub-mail-ur10 2013-11-12 19:28:59 +00:00
Yu Ping Hu cb7fcefde8 am 99ee8eb0: Merge "Null check for getServiceInfo" into jb-ub-mail-ur10
* commit '99ee8eb04418ee4797082770f34ada6f96d36bd7':
  Null check for getServiceInfo
2013-11-12 11:07:59 -08:00
Tony Mantler ea0989043a Null check for getServiceInfo
b/11538007

Change-Id: I8b06f22373c3a389939614e9c24bbe143b6fc289
2013-11-11 15:47:19 -08:00
Alon Albert 0a4debe0a5 am 802bf1b4: Ignore Messsages With No Timestamp
* commit '802bf1b4a7e36caa84d790198abc8421873b821c':
  Ignore Messsages With No Timestamp
2013-11-08 16:57:25 -08:00
Alon Albert 802bf1b4a7 Ignore Messsages With No Timestamp
When calculating oldest local message

Bug: 11520812
Change-Id: I0e70431d57235b5f97a3cd01c35af1b61e3dad7e
2013-11-08 16:20:52 -08:00
Martin Hibdon 272b317f3d Fix an infinitely retrying download problem
b/11436795
If an attachment download fails due to a timeout, or
an exception being thrown from startDownload(), we'd call
cancelDownload() on it. But this didn't actually cancel,
it would remove it from the inProgres list, but leave it
in the list of all downloads, so we'd immediately retry it.
This is bad for two reasons:
1. It can starve out other attachment downloads that could
have been successful.
2. It will keep attempting to do network work, even if it's
hopeless, forever, draining battery.
Now, if an attachment download fails in this way, for the first
few times, we'll move it to the tail end of the list of
downloads we'd like to perform. If it fails more than 10 times,
we'll give up completely. Giving up is not permanent, if we
have a reason to attempt a download again (such as the user
tapping on it), then it will get added back to the download
service and retried.

Change-Id: I5364a7d8b4b25ce299b8dcf061db6e9ce12daf75
2013-11-08 14:05:46 -08:00
Yu Ping Hu 47395c3729 am 1580fcac: Merge "Hack to make the Conversation View footer reload when a POP message finishes loading" into jb-ub-mail-ur10
* commit '1580fcacc0125e3c6f013821d6890436b97e96c1':
  Hack to make the Conversation View footer reload when a POP message finishes loading
2013-11-06 18:05:32 -08:00
Yu Ping Hu 63c5adbc1e am 8846a12c: Merge "Correct some logging in ADS" into jb-ub-mail-ur10
* commit '8846a12c9480799e6a6ade983f7bbcbcb38cca81':
  Correct some logging in ADS
2013-11-06 18:05:31 -08:00
Martin Hibdon ce99df0b3c am 80e9fa84: Merge "Update the duplicate message deletion trigger" into jb-ub-mail-ur10
* commit '80e9fa84b8061805485452f9d2d38c3c010cc993':
  Update the duplicate message deletion trigger
2013-11-06 18:05:31 -08:00
Yu Ping Hu 1580fcacc0 Merge "Hack to make the Conversation View footer reload when a POP message finishes loading" into jb-ub-mail-ur10 2013-11-07 02:03:08 +00:00
Yu Ping Hu 8846a12c94 Merge "Correct some logging in ADS" into jb-ub-mail-ur10 2013-11-07 00:38:58 +00:00
Martin Hibdon 80e9fa84b8 Merge "Update the duplicate message deletion trigger" into jb-ub-mail-ur10 2013-11-07 00:38:56 +00:00
Martin Hibdon 1ad443612d Correct some logging in ADS
b/11436795
Some of the logging I enabled here actually causes an
exception to be thrown because the format didn't match
the args in the log command.

Change-Id: If86942e64927c0e8df7573ef099824899e20c289
2013-11-06 15:47:16 -08:00
Martin Hibdon 13ff5b86ac Update the duplicate message deletion trigger
b/11535121
Now we only delete messages with the same serverId and account
if the account is an exchange account.

Change-Id: Ic2ebb465ccdb38724b88daac8ac40771c7a24bed
2013-11-06 14:55:42 -08:00
Martin Hibdon 5e78ddd2a0 am 580b3f7b: Merge "Fix attachments in search results" into jb-ub-mail-ur10
* commit '580b3f7b380cb72ed66bb92a68e2b194344ce97b':
  Fix attachments in search results
2013-11-06 12:24:39 -08:00
Martin Hibdon d482cbd54b Fix attachments in search results
b/11294681
We had some really broken logic about handling search
results.
In IMAP search, we would request, in a single pass,
FLAGS, ENVELOPE, STRUCTURE, and BODY_SANE. BODY_SANE means
the first N bytes of message content, whether it be from
the message text or attachments. This is different from how
sync works: In sync, we get FLAGS and ENVELOPE in one pass,
and in a later pass get STRUCTURE and first body part text
for each message.
If the total size of the message exceeded the maximum limit
for BODY_SANE, then we'd mark the message as partial, which
would cause us to create a dummy attachment in copyMessageToProvider().
This is a weird solution to the problem of POP messages not
being completely loaded, because in POP message body and
attachments can't be requested separately, so the dummy attachment
just signified that we needed to fetch more data.
This system fails completely on IMAP, because just fetching the
rest of the body will not get you the attachments.

But even if that code is disabled, attachments in search results
still didn't work properly. For reasons I don't yet understand,
if we requet both STRUCTURE and BODY_SANE at the same time, either
we don't received the full attachment metadata, or we ignore it, and
only use the attachments whose contents could actually fit in the
limit imposed by BODY_SANE. So attachments that didn't fit,
or didn't completely fit, would either be missing or corrupt
and unretriveable.

So, end result: It's not clear why we were trying to load
BODY_SANE all in one pass, unlike how it works for sync.
In fact, the way sync does it now makes a lot of sense: We
load FLAGS and ENVELOPE data (small) and put the in the DB
immediately so they can be displayed. In the second pass we
load the (potentially large) structure and message body. If this
is the right solution for sync, it's probably the right solution
for search. So now, that's what we do.

There is cleanup I'd like to do post MR1: Some code is duplicated
between sync and search that could be consolidated, but we're in
low risk mode now so I only changed search code.

Change-Id: I11475e290cda04b91f76d38ba952679e8e8964d5
2013-11-06 10:53:07 -08:00
Tony Mantler ec1fb96505 am 06e140e4: Update messaging when autodiscover fails due to an auth error
* commit '06e140e4a42c11e60331229963d27548ea35551c':
  Update messaging when autodiscover fails due to an auth error
2013-11-05 17:20:37 -08:00
Tony Mantler 06e140e4a4 Update messaging when autodiscover fails due to an auth error
b/11538085

Change-Id: I76689cbd89eef233588804edeb3893f1ad36bebe
2013-11-05 16:14:56 -08:00
Tony Mantler 62604b1a44 Hack to make the Conversation View footer reload when a POP message finishes loading
Get rid of this later when we stop using dummy attachments for "Load More"

b/11439833

Change-Id: Ia0ea9408fb74b6c305de43eada306c5df4c5fd59
2013-11-05 11:22:12 -08:00
Yu Ping Hu 0fb9b9efe6 am 294a4248: Merge "Fix off by one error." into jb-ub-mail-ur10
* commit '294a4248beae466c7aa19ad5b5683d35ed053f7a':
  Fix off by one error.
2013-11-01 17:27:04 -07:00
Yu Ping Hu 294a4248be Merge "Fix off by one error." into jb-ub-mail-ur10 2013-11-01 22:19:38 +00:00
Yu Ping Hu 1a6a3fe797 Fix off by one error.
Bug: 11475318
Change-Id: I046fc66713c54f355a3dc4e6b7b7b288a1450326
2013-11-01 10:36:44 -07:00
Martin Hibdon 2d49f0df50 am c085911e: Merge "Add logging to see why attachments fail to load" into jb-ub-mail-ur10
* commit 'c085911eeeb18059be403b1a506d50f2cc807b43':
  Add logging to see why attachments fail to load
2013-10-31 18:26:30 -07:00
Martin Hibdon c085911eee Merge "Add logging to see why attachments fail to load" into jb-ub-mail-ur10 2013-11-01 01:22:15 +00:00
Tony Mantler a3e839cca9 am 3ddd39b6: Merge "Don\'t add Quick Response menu if there\'s no mReplyFromAccount" into jb-ub-mail-ur10
* commit '3ddd39b6f1e3bfa0b10443627dd14067502941dd':
  Don't add Quick Response menu if there's no mReplyFromAccount
2013-10-31 14:15:46 -07:00
Martin Hibdon 5ed194434f Add logging to see why attachments fail to load
b/11436795
Now, if we ever insert or update an attachment to have
a blank location, we'll log a warning with stack trace.
Also, logging from ADS now uses the same log tag as everything
else, so we'll be able to see it without needing to turn
on some funny log tag.

Change-Id: Ic566cd87e8893128d074b897d7594a01ae12bc8c
2013-10-31 14:11:41 -07:00
Tony Mantler 3ddd39b6f1 Merge "Don't add Quick Response menu if there's no mReplyFromAccount" into jb-ub-mail-ur10 2013-10-31 21:11:32 +00:00
Tony Mantler b0d82fecff Don't add Quick Response menu if there's no mReplyFromAccount
b/11361756

Change-Id: I880d8f2089c1a50d13367b6fcf64344070280e27
2013-10-31 10:43:29 -07:00
Yu Ping Hu 0fe768e40c am 6ceae42b: Merge "Add a provider call to get device friendly name." into jb-ub-mail-ur10
* commit '6ceae42b30e03399513b29d401319666915096d5':
  Add a provider call to get device friendly name.
2013-10-30 16:10:13 -07:00
Yu Ping Hu 6ceae42b30 Merge "Add a provider call to get device friendly name." into jb-ub-mail-ur10 2013-10-30 23:07:52 +00:00
Tony Mantler 81bedbef2e am 2a33eccd: Merge "Don\'t initiate fragment transactions from onDestroy()" into jb-ub-mail-ur10
* commit '2a33eccd19ac32bb75f419b6379586de903c78af':
  Don't initiate fragment transactions from onDestroy()
2013-10-30 14:15:07 -07:00
Tony Mantler 2a33eccd19 Merge "Don't initiate fragment transactions from onDestroy()" into jb-ub-mail-ur10 2013-10-30 21:12:06 +00: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
Alice Yang 8e3bd14c27 Merge "Always ask before displaying images for Email" into jb-ub-mail-ur11 2013-10-30 17:58:20 +00:00
Alice Yang 24a489c3de Always ask before displaying images for Email
In Gmail, we are adding a setting that automatically shows external
images instead of asking user first.  Email app should preserve old
behavior.

Bug 11158252

Change-Id: I8b04a1ec31638d756dfee2da8ab2e8178a709416
2013-10-30 10:07:59 -07:00
Alon Albert 3e8e59798b Null Protect Account Info
Bug: 11355850
Change-Id: Idb42769b3009787efb4edfe2ffbd65171cd8d8d8
2013-10-29 16:47:24 -07:00
Tony Mantler 9460be06aa Don't initiate fragment transactions from onDestroy()
b/10918608

Change-Id: I649c5f86e5f77fa2ade33345969a44ffebb463b9
2013-10-29 15:44:34 -07:00
Alon Albert ae46818a19 Disable Move Actions for POP3 Folders
Bug: 11311812
Change-Id: I5813281cca76b9b4a373b5b40dbbd1909800f951
2013-10-29 11:06:36 -07:00
Tony Mantler 19b89b4bea Merge "Oh account name/email mixups, I've missed you so (no I haven't)" into jb-ub-mail-ur10 2013-10-25 20:14:38 +00:00
Tony Mantler 20367f1589 Oh account name/email mixups, I've missed you so (no I haven't)
b/11341847

Change-Id: Ib3d13e28f742e6cac84795d46121e4be2994abba
2013-10-25 10:02:06 -07:00
Yu Ping Hu 7b7d7d5cb5 Fix DB upgrade code.
Bug: 11294681
Change-Id: I7333aabbdb9e45154d83386b85398e6d108e5bf2
2013-10-24 19:58:40 -07:00
Yu Ping Hu 66f85c878c Merge "Add an additional mailbox key column to message table" into jb-ub-mail-ur10 2013-10-24 22:59:40 +00:00
Yu Ping Hu 4b73385ecb Merge "Prevent a NPE in ImapService search handling" into jb-ub-mail-ur10 2013-10-24 22:56:29 +00:00
Martin Hibdon 7dad461e9e Prevent a NPE in ImapService search handling
b/11339972

Change-Id: Ief34e6e1fd59d029847dc8525a34f20ea9de26b1
2013-10-23 16:44:31 -07:00
Tony Mantler 340a29e5fa Merge "Restore sender snippet for nested folder teaser." into jb-ub-mail-ur10 2013-10-23 22:42:39 +00: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
Tony Mantler 4cece307c4 Restore sender snippet for nested folder teaser.
It's a bit ugly, but it's much better than firing up a new loader for each subfolder.

b/11288044

Change-Id: Ia568f82ccd615ee950944d411c30f9470a55aea9
2013-10-23 14:30:59 -07:00
Tony Mantler e3cf91af61 Set parentServerId for IMAP folders to prevent fixup code from resetting parentKey
b/11355523

Change-Id: Idbef28cdbbc0eac50552fabeb24e2ec49a6cd042
2013-10-23 14:14:21 -07:00
Tony Mantler bf39d1166c Merge "Coalesce notification updates to avoid spamming the notification tray" into jb-ub-mail-ur10 2013-10-22 21:57:41 +00:00
Justin Ho 3cc5e68bd2 Merge "Change trigger to allow duplicate messages in search folders" into jb-ub-mail-ur10 2013-10-22 03:34:23 +00:00
Martin Hibdon ac40b86485 Change trigger to allow duplicate messages in search folders
b/11294681
b/11325976
The problem is that when we get a message as part of a search
result, we'll end up deleting that message from the inbox (or
whatever folder it's currently in). This is because there is
a trigger that deletes messages if a new message is inserted
that has the same serverId and account.

Now, messages with duplicate serverId/account combinations are
allowed if one of the messages is in a SEARCH type folder.
Also, make a change so that when a message comes down in
a search result, we do also copy it into the primary mailbox
that message resides in, we only add it to the SEARCH folder.
Prior to this there was some code that intended to put
the search result message into the regular mailbox it's supposed
to be in, so that we'd have correct state in that message.
Unfortunately, there are several problems with this:
1. The code didn't work, it would make a copy in the regular
folder, and then unconditionally move it to the search folder.
2. If we leave this code in place, putting the message
temporarily into the regular folder still activates the duplicate
message deletion trigger, wiping out the original copy, even with
the update to the trigger.
3. It's unclear that it's even desirable to load the search
result message into the regular folder. It could be a very old
message that would not have been synced before, leaving a large
gap in your inbox, which is confusing and could interfere with
IMAP syncing.

Change-Id: I34671a3b677ab42a3efd0d170a6ebd9246ec493d
2013-10-22 02:26:15 +00:00
Yu Ping Hu b8ef7da634 Merge "Treat updates into non-existent body rows as inserts." into jb-ub-mail-ur10 2013-10-21 23:46:14 +00: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 1fb5fa6981 Merge "Populate real name in From: field" into jb-ub-mail-ur10 2013-10-21 22:46:55 +00:00
Yu Ping Hu 7b28bb95a3 Merge "Update the folder sync status while searching in IMAP" into jb-ub-mail-ur10 2013-10-21 18:47:09 +00:00
Tony Mantler 632ee24d48 Populate real name in From: field
b/11246653

Change-Id: I8629ba655b99629f7b14f857acb67cb8453ddb8b
2013-10-18 16:49:56 -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
Alon Albert 7c8d480276 Merge "Handle User Refresh in Edge Cases" into jb-ub-mail-ur10 2013-10-18 18:15:38 +00:00
Tony Mantler a2b82c1a92 Coalesce notification updates to avoid spamming the notification tray
b/11115818

Change-Id: I1d8bfbb87c279c9967eee7295f31ddd7728b200c
2013-10-18 10:24:44 -07:00
Alon Albert 8c989772df Handle User Refresh in Edge Cases
Handle the following edge cases when a manual refresh is triggered:
* No connectivity
* Low storage space
* Timeout (sync not started)

Bug: 11241113
Change-Id: I580235d633fcb65999c0bfe8bf383c9c8ba72110
2013-10-18 09:32:47 -07:00
Tony Mantler af52f20930 Update the folder sync status while searching in IMAP
b/7538620

Change-Id: I7bb0c706fd63b1fe7d20dc0f186934e0dcac2f06
2013-10-17 16:07:21 -07:00
Tony Mantler 164677131a Merge "Don't bail out of downloading an attachment if the size is delcared as zero" into jb-ub-mail-ur10 2013-10-17 18:07:46 +00:00
Yu Ping Hu c084e8188d Merge "Don't allow duplicate messages to appear in Sent folder" into jb-ub-mail-ur10 2013-10-17 17:41:32 +00:00
Tony Mantler 4aaf3f2e33 Don't bail out of downloading an attachment if the size is delcared as zero
b/11225306

Change-Id: If67401dd3e6b652b03fba2e71cfc82fdae80ccb2
2013-10-17 09:46:03 -07:00
Martin Hibdon 37b539063d Don't allow duplicate messages to appear in Sent folder
b/11224731
There is a problem in ImapService.processPendingUploads().
It was trying to process updates to existing messages
as uploads. This is wrong, it means that marking a sent
messages as Read can cause it to be uploaded again,
resuling in a new message being created.

Change-Id: I502df52a7b315daeee10c1041db8f30dbfd2c04e
2013-10-16 22:46:25 -07:00
Tony Mantler 7acf30e9ab Make sure account upgrade code always runs before reconciling
b/11240251

Change-Id: Id6d6ad98b729757991b19c8dcd84822d6216f9a0
2013-10-16 17:14:54 -07:00
Martin Hibdon 85d2190552 Clear all "drafts" related flags from email when sending
b/11224331

Change-Id: I1df8ea3e0e24b050cd391dea454124e06988bf7d
2013-10-14 17:42:02 -07:00
Yu Ping Hu ec0bb58b9a Merge "Fix folder list loading." into jb-ub-mail-ur10 2013-10-14 21:51:14 +00:00
Yu Ping Hu 1004d74f2c Fix folder list loading.
We used to do N+1 DB queries when our list has
N folders in it. Now just do 1 and be smarter about
how we read our values out of it.

Bug: 11112954
Change-Id: Icde0b979ca985e63d6ceba05c3a63f3a9b7e3566
2013-10-14 14:47:33 -07:00
Tony Mantler efd835acea Fix threading issues in EmailDownloadService
b/7257927

Change-Id: I390ced0eee18ff324032481ae55c31f5d4b26ffd
2013-10-14 12:25:04 -07:00
Martin Hibdon 6df3709128 Merge "Correct syntax for IMAP date range search" into jb-ub-mail-ur10 2013-10-14 04:46:53 +00:00
Martin Hibdon 35cdca3fb4 Correct syntax for IMAP date range search
b/11183568
We were surrounding the data parameters with
double quotes. Apparently some servers do not
accept this, and they aren't present in the
imap spec.
However, we've been running with the quotes
for several months now, and it seems to work
on most servers. I'm afraid of changing this
right now, it might cause other servers to fail.
So now we'll try the query without quotes, and
if we get an exception, fall back to the old
style query with the quotes.

Change-Id: Ifb7b1a6dd4a9f7bb6b38bd1611c64e2bddb2e188
2013-10-13 21:44:52 -07:00
Yu Ping Hu ac93f838b8 Only fake the footer for mailboxes that sync from server.
Bug: 11193271
Change-Id: I7bc8903889ae4f91065cdb4696128a4eed62844f
2013-10-12 15:15:33 -07:00
Tony Mantler 67e78a67ba Merge "Clean up usage of Account.name when accessing account/folder prefs" into jb-ub-mail-ur10 2013-10-12 01:34:50 +00:00
Tony Mantler 32614f3746 Clean up usage of Account.name when accessing account/folder prefs
b/11185963

Change-Id: Id928732bee5f67887252b1f949a8e4d396fffaa6
2013-10-11 16:44:57 -07:00
Alon Albert 9a342b3147 Cleanup Logs
Bug: 11149133
Change-Id: I764e2e3a8c37769d2e788688cf50789d0f22e9d3
2013-10-11 15:31:24 -07:00
Martin Hibdon e7f61f403c Merge "Always fix parent keys on startup of email" into jb-ub-mail-ur10 2013-10-11 22:24:34 +00:00
Martin Hibdon f7078466c3 Always fix parent keys on startup of email
b/11174975
There are already several database fixing steps that
occur when the database is opened, add another one
to correct uninitialzed mailbox parent keys.
This is because we use a two pass system for adding
mailbox rows, first to insert the rows, and second to
assign parentKeys to child rows. We need two passes
because we may insert a child row before its parent,
so the parent's rowId is unavailble. But if the process
dies before the second step is complete we'll be in
an inconsistent state.

Change-Id: Ifaeeaca7e82c1e99656033bc1a9f25d7acb67517
2013-10-11 15:18:41 -07:00
Tony Mantler ec2b661acb Merge "The ServiceMap caches locale-dependent strings. Destroy it on configuration changes." into jb-ub-mail-ur10 2013-10-11 21:37:44 +00:00
Tony Mantler 03dc3f22d1 Combined account name is locale-dependent. Notify on locale changes
b/10784192

Change-Id: I2a9783f19709ff5cf0ab5a4a14ab1ad60b71d821
2013-10-11 14:20:03 -07:00
Tony Mantler 3a8c86b182 The ServiceMap caches locale-dependent strings. Destroy it on configuration changes.
b/10785115

Change-Id: I39df8a002cafdbaf4d41c9916d62a79a03d48804
2013-10-11 13:18:36 -07:00
Martin Hibdon ed4e1c5039 Merge "Disable sync settings controls for drafts folders" into jb-ub-mail-ur10 2013-10-10 23:40:19 +00:00
Martin Hibdon cb30243fe1 Disable sync settings controls for drafts folders
b/11158759
Make the default sync setting for drafts folders 0
(never automatically sync), and disable the settings
control so that it cannot be changed.
Also add a db upgrade step to set any existing drafts
folders to not sync, and clean up any Exchange synced
draft messages.

Change-Id: I256bde231d722089ef2a623482f570a20eccf1de
2013-10-10 16:29:42 -07:00
Tony Mantler 11fb2d161e Merge "Use the correct widget provider class" into jb-ub-mail-ur10 2013-10-10 21:06:42 +00:00
Martin Hibdon 9e608aa5a1 Update logging in AttachmentDownloadService
This is related to b/11081672.
The logging needed to track this down was tied to
MailActivityEmail.DEBUG, which is tied to a setting that
no longer exists.

Change-Id: I0a23508832ead6ab3cc613a82e0831986b0af49b
2013-10-10 12:41:23 -07:00
Tony Mantler 8117953140 Merge "Add null check before passing from address to Rfc822Tokenizer" into jb-ub-mail-ur10 2013-10-10 18:45:49 +00:00
Martin Hibdon 03f56f2c1a Merge "Allow multiple mailboxes to be synced in a single request" into jb-ub-mail-ur10 2013-10-10 18:31:17 +00:00
Tony Mantler 22f0c87d5f Add null check before passing from address to Rfc822Tokenizer
b/11167816

Change-Id: I13671d953b067ecc5becf160eab52be30e4f1354
2013-10-10 10:35:58 -07:00
Martin Hibdon 56aba8d843 Allow multiple mailboxes to be synced in a single request
b/11103878

Change-Id: Ic6abf51457fe94e89fe51b461da4371f50e0fe86
2013-10-10 09:30:31 -07:00
Tony Mantler 5da03b90e2 Merge "Temporary workaround for ConversationCursor missing updates" into jb-ub-mail-ur10 2013-10-10 16:20:00 +00:00
Paul Sliwowski b5341fac10 Merge "Fix bugs when screen is rotated when creating account." into jb-ub-mail-ur10 2013-10-10 03:00:43 +00:00
Paul Sliwowski d7ed294dd1 Fix bugs when screen is rotated when creating account.
Bug: 11136893
Change-Id: I1d21c1f427370a2de57d89be802cac253ad33bd5
2013-10-09 19:49:29 -07:00
Martin Hibdon 7c03217316 Add a retry backoff/limit policy to attachment download
b/11081672

Prior to this, any time the AttachmentDownloadService
got a CONNECTION_ERROR, it would just instantly retry,
without any limit on the number of tries. This is bad
if the server is in a funny state, we'll just keep spamming
it with multiple connection attempts per second. Also,
this kills the client device's battery and responsiveness.

Now, it will retry instantly five times, and then retry on a
10 second delay 5 more times. After that it will give up.

Even if it gives up, if the user visits an email with an
attachment, or taps on an attachment to expand it, we'll
start the process over. So we shouldn't have permanent
apparently data loss, even if we fail on the first 10 tries.

I'm not certain that this is the best backoff/limit policy,
maybe we should add a delay after even the first connection
error. But I'm hesitant to change this at this point, it's
possible that something is relying on this behavior and
we don't have a lot of soak time left.

Change-Id: I53d75d5d214ccca887a89cf65b799fe640cc9bc5
2013-10-09 16:32:08 -07:00
Tony Mantler e12b22148f Temporary workaround for ConversationCursor missing updates
Launch a 2-second delayed message to send a second notification on the folder change update

b/11027351

Change-Id: Ia0a22be79f4a74c6857517cc21e2313cea9cc0e9
2013-10-09 16:15:29 -07:00
Tony Mantler 37aa460ef7 Use the correct widget provider class
b/11043157

Change-Id: Icb4e6408535ca4cc055581ca7e8bd74c83aeecdf
2013-10-09 15:52:16 -07:00
Tony Mantler 4b32e54309 Merge "Update widgets on provider instantiation." into jb-ub-mail-ur10 2013-10-09 20:27:42 +00:00
Tony Mantler 06009f28f0 Merge "Parse "From" addresses when constructing ConversationInfo" into jb-ub-mail-ur10 2013-10-09 17:33:48 +00:00
Tony Mantler 73379a2729 Parse "From" addresses when constructing ConversationInfo
Fixes sender image tiles

b/11120430

Change-Id: Ie53e2a01cfffd70318fad7cd1cbc2565f1bbb87b
2013-10-09 10:29:36 -07:00
Martin Hibdon 529bdeaec1 Always close the connection after trying to load attachments
b/11081672

Change-Id: Ibe804713492b37f5579fb20a0da7292e82cb5341
2013-10-08 16:48:52 -07:00
Tony Mantler 02b9ac1b95 Update widgets on provider instantiation.
b/11043157

Change-Id: I439a67447875b6f9ba818b2c2cb95c83db034896
2013-10-08 11:55:39 -07:00
Tony Mantler 805bc397bd Merge "Populate the snippet in ConversationInfo" into jb-ub-mail-ur10 2013-10-08 16:22:58 +00:00
Tony Mantler b62486b019 Populate the snippet in ConversationInfo
b/11111973

Change-Id: I8a4e824ad4c708fba8013221279a0b1ac6df7a8c
2013-10-07 16:50:55 -07:00
Tony Mantler 5d47ee0f87 Store the total count of search results in the database only
b/11027351

Change-Id: Ibb63bd7b80ff0af653cca4424dd2d17168262710
2013-10-07 14:40:14 -07:00
Yu Ping Hu 1265011585 Merge "Don't push things that haven't performed initial sync." into jb-ub-mail-ur10 2013-10-04 21:41:13 +00:00
Yu Ping Hu 3f24a9e2c7 Don't push things that haven't performed initial sync.
Also remove the ping kick.

Bug: 11081520
Change-Id: I21d5050886b2c352771013f4f3e5b9282482d508
2013-10-04 14:36:43 -07:00
Tony Mantler d946f8319a Merge "Reply-all setting is modified at runtime, don't cache it in a static map" into jb-ub-mail-ur10 2013-10-04 21:21:26 +00:00
Tony Mantler 7c24f48a37 Merge "Remove notifications while we still know what type of account this is" into jb-ub-mail-ur10 2013-10-04 20:28:42 +00:00
Tony Mantler b424ffa65b Reply-all setting is modified at runtime, don't cache it in a static map
b/11066041

Change-Id: I4e14c3add3fe2503e8369dbb7ef976e110ef2fee
2013-10-04 13:25:26 -07:00
Martin Hibdon 387612f469 Merge "Fix display for inlined and non-inlined attachments" into jb-ub-mail-ur10 2013-10-04 20:13:16 +00:00
Tony Mantler ac1d3249fb Remove notifications while we still know what type of account this is
Also add null check just in case

b/11070468

Change-Id: I187b9b084512a2b994f4a0a3b750ade5eee50624
2013-10-04 12:27:20 -07:00
Martin Hibdon fc8a57bb29 Fix display for inlined and non-inlined attachments
b/11069575
The problem is that the UI_MESSAGE query strips out
any inlined attachments, but the UI_ATTACHMENTS query
does not. This means that we display all attachments
at the bottom, regardless of whether or not they're
inlined, but the formatting is wrong because when we measured
we only had the non-inlined attachments.
Maybe we should not display the inlined attachments at
the bottom, but right now if we do that, it's impossible
to save an inlined image. So for now, I'm just making
UI_MESSAGE query keep the inlined attachments so that
both queries have the same behavior.

Change-Id: I155f5bb74dbfbc8dbf02b56dca58fbca3da5da78
2013-10-04 12:13:02 -07:00
Tony Mantler 840408c41c Remove mAmAccount from the email provider account object
b/11070468

Change-Id: I51bad4be41800e4cd6dae42744005ade784cdf82
2013-10-04 10:21:25 -07:00
Tony Mantler f086deac70 Change notification code to key off android.accounts.Account
b/11023774

Change-Id: I6dd267591148378265b0f12c7ea6d74b450a0f3d
2013-10-03 13:26:55 -07:00
Paul Sliwowski 7df98d0a6d Fix autodiscovery failed dialog.
Bug: 11030161
Change-Id: Id97766969608016efe068e5c142407ad94438b05
2013-10-02 16:00:33 -07:00
Martin Hibdon 921c04d2ac Add some logging
Change-Id: Ib26ffad0bb6841361b8ee7be4ee2a6255d509ae2
2013-10-01 17:08:16 -07:00
Tony Mantler 768c6b86db Don't show "No messages" when starting a search on Exchange
Also clean up some finals

b/11027351

Change-Id: Ib76cc90b04acb531d53b2d6bdc4e3b0ad911f72c
2013-10-01 12:02:47 -07:00
Tony Mantler 53ecec0ad4 Merge "Only return messages that are unread and unseen for an unseen query" into jb-ub-mail-ur10 2013-09-30 23:34:19 +00:00
Tony Mantler d4a06f409d Only return messages that are unread and unseen for an unseen query
b/10970849

Change-Id: I23d40fc39987fab35521f1dd75f4631f1fae16d5
2013-09-30 15:32:42 -07:00
Martin Hibdon 2cf965b85f Merge "Make draft attachments work correctly" into jb-ub-mail-ur10 2013-09-30 22:23:42 +00:00
Martin Hibdon f484751e06 Make draft attachments work correctly
b/10968838
The main problem here is that Ui Attachment was always using
a content Uri that was generated using the attachment's account
Id and rowId. This works correctly for attachments in messages
we have received, but it does not work for drafts: Draft attachments
are not stored in the normal place, rather, they are stored in
the cache directory. There is an additional column in the
Attachment table, called cachedFile, which is not replicated in the
Ui attachment. That's okay though, if we have a cachedFile, then
when we are populating a Ui Attachment, we should just use that
for content Uri.
Also, I discoverd that for draft attachments, we were not correctly
setting the account key. That didn't turn out to be the problem,
but I'm fixing it anyway because it will cause problems later on.

Change-Id: I0143ba824f3a5bfcd77f32828931b94d6977626f
2013-09-30 15:08:45 -07:00
Tony Mantler b38c7d1c37 Avoid ANR due to looking up account info on the main thread
b/10987175

Change-Id: I7344e2717ab1b9557385eb6eb9e7962461b10c9d
2013-09-30 12:31:52 -07:00
Yu Ping Hu 125cbdf9d4 Make certain we don't use a null account.
Bug: 10965484
Change-Id: I525d32fcbde0fbbe0bec467814cf4f09a3de38fe
2013-09-29 18:09:17 -07:00
Yu Ping Hu 85ad73aecd Pass the correct id to getAccountManagerAccount.
Bug: 10965484
Change-Id: I8e1aab4810da4673313b10231592283736a92ef9
2013-09-29 16:12:52 -07:00
Alon Albert c4d139c4f4 Auth Notification
Some changes that allow a notification to open Account Settings for a specific
account

Bug: 10930585
Change-Id: Ib329e339b405ccbc0631d5ce6a23bf8fa6d62b83
2013-09-27 17:52:48 -07:00
Yu Ping Hu 386c8ccbf9 Merge "Kick the push once an hour, in case it fails." into jb-ub-mail-ur10 2013-09-27 21:18:10 +00:00
Martin Hibdon 9d3e01c589 Set the client cert from AccountSetup
b/9661767

Change-Id: I292ff5e190ed56077a04e37869e18a46f5473985
2013-09-27 13:47:16 -07:00
Yu Ping Hu 69418d0460 Kick the push once an hour, in case it fails.
Bug: 10954795
Change-Id: If6325c04b2011fb476f20f1419afaee13a786d3c
2013-09-26 22:20:20 -07:00
Yu Ping Hu 5e8d8c1f80 Modify ping on settings changes.
Bug: 9020744
Change-Id: I0dfa2b8e9d999072b8201da61916372ca1a5b08b
2013-09-26 18:33:13 -07:00
Yu Ping Hu 6580e50031 Fix a bad log message.
Bug: 10950496
Change-Id: I06c5e20eea9090bbfc6d0c12d8ce8e31d47f52a2
2013-09-26 14:15:50 -07:00
Tony Mantler e43fbd05de Merge "Fix account matching at initial screen to match against email address" into jb-ub-mail-ur10 2013-09-26 20:45:55 +00:00
Tony Mantler 463584d23f Fix account matching at initial screen to match against email address
b/10210901

Change-Id: I64d60ca33a42a19e085dd98a7a61d68ac30027f9
2013-09-26 13:41:09 -07:00
Martin Hibdon 7140095932 Merge "reduce the length of a log tag to a legal amount" into jb-ub-mail-ur10 2013-09-26 20:35:03 +00:00
Martin Hibdon fead9986c1 reduce the length of a log tag to a legal amount
Change-Id: I6f18b9aa893cdccfebf24885b4668a50472af802
2013-09-26 13:29:24 -07:00
Martin Hibdon 780e92aea3 Merge "Handle it if an fetchPart has no content-encoding" into jb-ub-mail-ur10 2013-09-26 20:28:32 +00:00
Martin Hibdon 312aa85609 Handle it if an fetchPart has no content-encoding
b/10855399

Change-Id: Ic2a8b51d095fe44f180ba2f2171dc70a9df10a1d
2013-09-26 13:10:48 -07:00
Alon Albert feb2c387b0 Upsync Exchange Folders on syncedMessage updates
On updates to content://com.google.android.email.provider/syncedMessage
request a sync for the folder the message is in.

We need to do this because Exchange sync adapter is marked as
android:supportsUploading="false" so notifySync() doesn't work.
Neither does adding a UPLOAD extra to the sync request. If we do that, the
request is dropped.
This means that the sync request will also downsync the folder but t's probably
a good thing anyway.

We could add our own version of UPLOAD extra if we really want to prevent downsync.

Bug: 10678136
Change-Id: I14f06c4da905560716773d31d59388d2e6d25635
2013-09-26 11:16:23 -07:00
Martin Hibdon bf49e99569 Merge "Move calendar and contacts to the new account on upgrade" into jb-ub-mail-ur10 2013-09-25 22:15:22 +00:00
Tony Mantler bc5653471c Merge "Separate the account name from the account manager's account name" into jb-ub-mail-ur10 2013-09-25 22:10:56 +00:00
Yu Ping Hu 229e173010 Merge "Disable account setup debug screen." into jb-ub-mail-ur10 2013-09-25 21:56:15 +00:00
Tony Mantler 1082ed9430 Merge "Match against both account name and type when reconciling accounts" into jb-ub-mail-ur10 2013-09-25 21:24:52 +00:00
Tony Mantler 5757047f33 Merge "Make sure the account check dialog doesn't outlive the account check fragment" into jb-ub-mail-ur10 2013-09-25 21:24:35 +00:00
Tony Mantler ed0ee50a12 Match against both account name and type when reconciling accounts
b/10210901

Change-Id: Ice60ab64a2f7287be9ee639e5777f85bda4bd390
2013-09-25 13:34:04 -07:00
Tony Mantler d8ee809ac2 Make sure the account check dialog doesn't outlive the account check fragment
b/10918608

Change-Id: I65725b8935b2902ff926ba333cd41a3c1545f332
2013-09-25 11:24:55 -07:00
Tony Mantler d17359c2b4 Notify on message Uri when a message is deleted.
b/10919322

Change-Id: I0b39bcbc2e03c45fc0c161211c7cdacd97791c15
2013-09-25 10:09:01 -07:00
Martin Hibdon 3aad3fcb8b Move calendar and contacts to the new account on upgrade
b/10805685

Change-Id: I08de135f166ad10812c9318efe649694e5c448d0
2013-09-24 17:02:08 -07:00
Tony Mantler 7349fbff64 Separate the account name from the account manager's account name
b/10894178

Change-Id: Ie64ae00e4fd382fb03fc7c87ea91c7aff8fc8f43
2013-09-24 16:41:50 -07:00
Tony Mantler bab16f9161 Merge "Virtual folders are valid folders, don't kick back to the inbox when we're viewing them" into jb-ub-mail-ur10 2013-09-24 18:58:43 +00:00
Tony Mantler 96192ef342 Virtual folders are valid folders, don't kick back to the inbox when we're viewing them
b/10847930

Change-Id: I182fee7d6caa5c4a67911c0c8e969d8668ac87d0
2013-09-24 11:42:21 -07:00
Tony Mantler 4f32213ebe Missing part of I27ad5ee75df669315e03c9ccc299bfc8eacbb53b
Change-Id: I207898b4f6f9148758d4ee1c6a82cbb387570240
2013-09-24 11:25:36 -07:00
Tony Mantler e54d6957db Clear out erroneous sync values for IMAP mailboxes on upgrade
b/10695945

Change-Id: Ic68c9ef0baa25eae40631184cf0322ff26c9e5ab
2013-09-24 11:08:33 -07:00
Martin Hibdon 1290f376c0 Merge "Improve display of attachments in pop" into jb-ub-mail-ur10 2013-09-24 04:14:18 +00:00
Scott Kennedy 0203a06c87 Ensure we have all columns in combined view
I added these to real mailboxes for hierarchical folders, but we
also need them in combined view.

Bug: 10891994
Change-Id: Iaa291fb9a9cd6039fb4d347309ce3a37aa64392a
2013-09-23 14:08:36 -07:00
Martin Hibdon aad690f699 Improve display of attachments in pop
b/10714298
This is related to this CL in UnifiedEmail
https://googleplex-android-review.git.corp.google.com/#/c/363626/1

Change-Id: Idea2827791ed52e7558b11aaea07b1f3f1764db5
2013-09-20 17:39:05 -07:00
Scott Kennedy bba11cdec9 Merge "Hierarchical folders in conversation list" into jb-ub-mail-ur10 2013-09-20 22:59:28 +00:00
Scott Kennedy fc5aae98e7 Hierarchical folders in conversation list
Use something similar to the sectioned inbox teaser.

This change allows displaying sender snippets in the teaser.

Bug: 9604590
Change-Id: Ib27f002ab8cbd2315d95d46eeb1735aa6b594db5
2013-09-20 17:46:27 -04:00
Tony Mantler ef0c53e15f Fake syncing while we're waiting for the sync to start
b/10695945

Change-Id: I6a32c45facaa0c2c888726e2276d07b7c5e46689
2013-09-19 12:19:02 -07:00
Tony Mantler 1ced0e3001 Merge "Update mailbox status according to current sync status" into jb-ub-mail-ur10 2013-09-19 02:11:46 +00:00
Tony Mantler 27de0b24b2 Merge "Use unified strings for sender image preference and switch to checkbox" into jb-ub-mail-ur10 2013-09-19 02:11:25 +00:00
Tony Mantler 04dbb647ff Update mailbox status according to current sync status
b/9177086

Change-Id: I24a7d26b7d7e5ee68ede003e823c1b80abaf56d3
2013-09-18 15:20:59 -07:00
Tony Mantler acfbeb812b Use unified strings for sender image preference and switch to checkbox
b/10693718

Change-Id: Iec81347915611f81ded0c62ca37c401fdb28ae9f
2013-09-18 14:02:22 -07:00
Martin Hibdon ed60a4026b Merge "Clear exchange sync keys upon app upgrade" into jb-ub-mail-ur10 2013-09-18 19:09:14 +00:00
Tony Mantler ddb6c2da8d Merge "Don't disable the back button when the account name fields are invalid" into jb-ub-mail-ur10 2013-09-18 19:08:28 +00:00
Tony Mantler 0bfeb90e41 Don't disable the back button when the account name fields are invalid
b/10695553

Change-Id: I32df55594784e24263dede9b767786ccdc83662c
2013-09-18 11:56:47 -07:00
Tony Mantler 75e71b3b97 Merge "Don't return a null cursor from queries to uimessages" into jb-ub-mail-ur10 2013-09-18 18:03:59 +00:00
Tony Mantler 2c3328bfd7 Don't return a null cursor from queries to uimessages
b/10807214

Change-Id: Ia49dae8bd50773097bb1082c2bc5cf264a76ce55
2013-09-18 10:53:58 -07:00
Tony Mantler 3ba1ed1b88 Merge "Fix use-after-null in AccountSetupIncomingFragment" into jb-ub-mail-ur10 2013-09-18 03:18:57 +00:00
Tony Mantler 648a067056 Fix use-after-null in AccountSetupIncomingFragment
b/7967233

Change-Id: I69b7ea521416815fce3bb9e45b38c996b9cea17b
2013-09-17 16:51:52 -07:00
Martin Hibdon 7d6d8c87f8 Clear exchange sync keys upon app upgrade
b/10211620
The problem here is that on app upgrade, we need to change
the types of all email accounts. To do this, we have to
create new accounts and delete the old ones. This resulted
in calendar and contacts data getting deleted.
But we were copying over the last sync keys from the old
account, so on the next sync, we would only get new data.
This means that all of the data that we had gotten on
a previous sync would never be sent again, so calendar
events and contacts would be missing forever.
Now, we just don't migrate the old sync keys. This means
that on the next sync, we'll get all data, and restore
our original state.
This is still not ideal, because it means that any locally
created data that has not yet been synced will be lost
(b/10805685), but it's much better than it was.

Change-Id: I150c4dbdf490a8f3880261e2469795896ebfeab5
2013-09-17 16:43:07 -07:00
Tony Mantler 4265ade29a There's no such thing as a wrongly incomplete account
b/9856118

Change-Id: If2d2c50989285a13eb0ae29961733e472e26c978
2013-09-17 16:03:14 -07:00
Yu Ping Hu e3a4a1b25d Remove dupes before syncing new messages.
Bug: 10440557
Change-Id: I4ade38a8bb15cbc22b6c10a5f270274fef6f1fca
2013-09-17 10:02:45 -07:00
Tony Mantler 106970b83e Merge "Notify when message changes (mostly for saving drafts)" into jb-ub-mail-ur10 2013-09-17 01:34:06 +00:00
Tony Mantler c637bff198 Notify when message changes (mostly for saving drafts)
b/10785769

Change-Id: I1ad8e0583ddaa9fa4fcc45906745980f103ec1fa
2013-09-16 16:15:32 -07:00
Yu Ping Hu d672b0eb2b Merge "Fix MessageStateChange to include mailbox id." into jb-ub-mail-ur10 2013-09-16 22:56:11 +00:00
Martin Hibdon 26ee7c9875 Merge "Make sync settings less confusing." into jb-ub-mail-ur10 2013-09-16 19:28:32 +00:00
Tony Mantler 1cede71194 Merge "Fix "Load More" for IMAP search" into jb-ub-mail-ur10 2013-09-16 19:18:02 +00:00
Martin Hibdon 0e550e0857 Make sync settings less confusing.
b/10602459
It was possible to turn off syncing for an account in global
settings, but we'd continue displaying some sync frequency
in the in-app settings.
Now, we only display the sync frequency if sync is actually
enabled. If it's disabled we always display "never". Also,
when the user changes a sync setting, if it's set to "never",
we leave the frequency in the database as it is, but disable
sync for that account. If it's set to anything else, we store
that in the database and ensure that sync for the account is
enabled. This means we should not have any apparent disagreement
between in-app settings and global settings as to whether or
not syncing will happen.

Change-Id: I1cc54e76aafd25dc4db0f1b713e7d7cbc30bf77f
2013-09-16 11:57:35 -07:00
Tony Mantler 7d761f3de3 Fix "Load More" for IMAP search
Also kill some warnings while I'm at it.

b/8607507

Change-Id: I8bfa90e9144d71e964799d6f2dab5e79f48b277f
2013-09-16 11:56:11 -07:00
Yu Ping Hu e984940465 Fix MessageStateChange to include mailbox id.
Also ignore messages without server ids for moves and
state changes.

Also cleanup to match needs of EAS upsync.

Bug: 10678136
Change-Id: Id4d5229b8479e61bd718b707b0d2bc77a9e68046
2013-09-15 15:43:35 -07:00
Yu Ping Hu c48670a569 Only set sync mailbox to inbox if none was specified.
Follow up to I9e62d5de10222f1d81b47a68dd0b3ab05de5436d.

Bug: 10729228
Change-Id: I8100a0a5d965e4c4c86dccb6c94dfe26cc6e49a0
2013-09-13 17:54:50 -07:00
Martin Hibdon 1a7838eed7 Update folder structure on every POP or IMAP sync
b/10729228

Change-Id: I9e62d5de10222f1d81b47a68dd0b3ab05de5436d
2013-09-13 13:42:42 -07:00
Alice Yang 17d014dfdf Disable attachment previews
Change-Id: Ic2314f89b813956a6351bed51bfa6881e51605ff
2013-09-13 00:43:55 -07:00
Martin Hibdon 24bb2dabd9 Kill the process when an account is deleted.
b/10653370
This prevents NPEs if a serviec happens to still be running
when an account is deleted.
This mirrors a similar pattern in the gmail app.

Change-Id: I6fd8ae5ffe41580df0a321ec22535403e3f32eee
2013-09-12 18:21:18 -07:00
Martin Hibdon 64690e9452 Merge "Delete POP emails when they are removed from the server" into jb-ub-mail-ur10 2013-09-12 21:55:19 +00:00
Martin Hibdon e25e6b2937 Delete POP emails when they are removed from the server
b/10461973

Change-Id: Iccd455b4b71d83318c7f5429f399fe5db2558e42
2013-09-12 14:38:55 -07:00
Tony Mantler da42d856b8 Don't skip attachment saving if the attachment is not yet saved.
Also tidy up warnings

b/10461356

Change-Id: I65ac4c5b512cd67a39c81606391a2b044213f269
2013-09-12 11:04:49 -07:00
Tony Mantler 4f63f1eec1 Merge "Purge views after they're supposed to be destroyed to avoid spurious callbacks" into jb-ub-mail-ur10 2013-09-12 16:28:07 +00:00
Martin Hibdon 92e13548ed Merge "Fix a bug in Pop3 sync" into jb-ub-mail-ur10 2013-09-12 00:49:58 +00:00
Martin Hibdon 85ff07a00a Fix a bug in Pop3 sync
b/10413188
There are still several issues with attachments generally,
but this fixes the most glaring problem: We were short circuiting
in a loop that needed to populate a hash table of remote message
Ids, so not all of them would be present. The later code intended
to load attachments expected it to be fully populated.
There are still several problems, notably that if downloading
doesn't work, it just spins forever, but this fixes the first
problem.

Change-Id: I2b23dcb841edabe108096933fea2350ef61a10f1
2013-09-11 17:19:00 -07:00
Tony Mantler ecac654c66 Purge views after they're supposed to be destroyed to avoid spurious callbacks
b/10565885

Change-Id: I7ef18fdac566975d15ffd1a19f756a5e5d2aee8a
2013-09-11 16:47:47 -07:00
Tony Mantler 463ed11857 Disable account setup debug screen.
b/10446166

Change-Id: I6703c1950559e9896f168a0cbaec10040eac9589
2013-09-11 15:17:42 -07:00
Tony Mantler 78c166b4cc Disallow duplicate accounts
b/10210901

Change-Id: I11b759246fafabafe29fd8f4d20f6e973f9679a4
2013-09-11 15:15:38 -07:00
Tony Mantler de8b97c72e Postpone initialization of notification URIs until the EMAIL_PACKAGE_NAME is known
b/10693908

Change-Id: Ia232dda55e03e02db24040b9d17c383addaff0b0
2013-09-11 11:48:38 -07:00
Tony Mantler 2bae64df29 Merge "Notify combined account when individual accounts change" into jb-ub-mail-ur10 2013-09-11 16:21:34 +00:00
Tony Mantler fc906340f9 Notify combined account when individual accounts change
b/10610684

Change-Id: I675a5b2dfd9ccdb412f2746f5785c8f1141f6a76
2013-09-10 16:44:13 -07:00
Tony Mantler 9e9caaee7c Reorder db update/notify and clean up warnings in EmailProvider
Change-Id: I6c65c18ea19bd1afd956b455ac296a4c2d402662
2013-09-10 16:20:31 -07:00
Tony Mantler 2fb5d2f9dd Don't spam the log with null columns.
My bad.

Change-Id: Ia9bcf2b09f905e3f720814b50453df59d5341038
2013-09-10 11:38:34 -07:00
Yu Ping Hu ca79aba675 Add the MessageMove & MessageStateChange tables.
We need to track changes that need to be unsynced. Because
Exchange handles moves differently from other changes, we
create two different tables. The tables are structured as
change logs to better handle error cases.

Change-Id: I4df90c75f36707fa117aed9718508426e60e0749
2013-09-09 15:47:26 -07:00
Tony Mantler 582bc439ea Tidy warnings
Change-Id: I08517af26c27a85fddabccf15dd1a50316df5b5c
2013-09-09 09:52:54 -07:00
Tony Mantler 33bc3df32b Always mark messages as seen when we return to the folder list
b/10533884

Change-Id: If1e0774b70a379884cc435fab9965d39531efb58
2013-09-05 14:10:56 -07:00
Tony Mantler 19c11c0b77 Merge "Tidy warnings in AccountSettingsFragment" into jb-ub-mail-ur10 2013-09-05 18:04:07 +00:00
Tony Mantler 39f29d0481 Tidy warnings in AccountSettingsFragment
Change-Id: I933529dac9f37d0734fa7b98a43e8f41eb143698
2013-09-05 11:00:06 -07:00
Scott Kennedy e743a06ddf Allow going back to search results
If you went from search results to conversation view, then hit the
back button, we were taking you out of search results to the inbox,
because we didn't know you had search results.

Now, we're tracking this (through the use of a folder type), so we
take you where you should go.

Bug: 10591438
Change-Id: I12ad81323fe3e1f199d9dd06a1a4e18f765b01ee
2013-09-04 14:24:00 -07:00
Tony Mantler 67855d3117 Merge "Make UnsavedChangesDialogFragment public so the framework can find it" into jb-ub-mail-ur10 2013-09-04 19:03:21 +00:00
Tony Mantler 6f3a94cca1 Make UnsavedChangesDialogFragment public so the framework can find it
b/10611121

Change-Id: I9daab10d49b492950f2032ee1edf4ca07a3e7ef8
2013-09-04 11:57:54 -07:00
Andrew Sapperstein 66520b3145 Remove CAN_HOLD_MAIL folder capability.
b/9623931

Change-Id: Ic15860d46a6adf8d313536b68ce8e0fad1d97810
2013-09-03 15:16:59 -07:00
Tony Mantler 26cd5e024c Don't store the account creation/modificaiton state in a singleton
b/10460757

Change-Id: I7f0bea69f843f9061d1cfa9277c99d36705aceaf
2013-09-03 14:15:32 -07:00
Andrew Sapperstein 5dcb447c04 Moved some stuff from Email to Unified.
b/10542802.

Change-Id: I9623ce85cae6f67ec647e1712e8c392a35311171
2013-08-29 17:41:26 -07:00
Martin Hibdon f1e3a72d62 Merge "Correctly fix an outOfBounds error" into jb-ub-mail-ur10 2013-08-28 23:42:42 +00:00
Martin Hibdon 35957ffcf6 Correctly fix an outOfBounds error
b/10380970

Change-Id: I58a57c7a659bb92ba6b6dbf0cbb099d0d252cc37
2013-08-28 16:22:09 -07:00
Martin Hibdon 037e4ad330 Merge "Prevent simultaneous imap and pop syncs" into jb-ub-mail-ur10 2013-08-28 22:30:33 +00:00
Martin Hibdon 466eb2dcd2 Prevent simultaneous imap and pop syncs
b/10527550
I'm not yet sure why we're getting this started
in multiple threads, but the methods where the sync
occurs are now synchronized so they can't happen
at the same time.

Change-Id: Icf7afd336ed056bb42df84b8634117afa8f31213
2013-08-28 15:11:59 -07:00
Paul Westbrook e4ac06080b Don't use implicit events
Bug: 10189773
Change-Id: I4579f2e465bd23b8ab4cdf291bfbe80cf6518328
2013-08-28 14:31:09 -07:00
Martin Hibdon 0c8df56a0a When loading local messages, don't filter messages by time
b/10508861
Temporary fix for this.
For some reason, we're getting messages loaded with the wrong
date being stored. If we have a message with date = 0, and we
filter out anything older than 24 hours, then these messages
with the wrong date won't get loaded into our localMessageMap.
Then we won't recognize that message is already present locally,
and we will fetch a duplicate.
I don't yet know why we're getting the date wrong.

Change-Id: Ic91cd263198ee944eddbaf1d90080e8285a5df6a
2013-08-27 15:50:09 -07:00
Tony Mantler 7be030ec8e Remove pointless parent class EmailPreferenceFragment
Change-Id: Ia384d92632100c2adfb22c22c03d4755250e388e
2013-08-27 14:22:17 -07:00
Scott Kennedy 0a710bde68 Fix notification preference migration
These settings need to be migrated from the database, not the
SharedPreferences file that likely shouldn't even exist.

Everything added to Account.java was removed in
Ie6ec389b5b5d2e7ab1b299d0877811ae716526e2
when it was believed to be unnecessary.

Bug: 10211615
Change-Id: If6193758febda8a3272d82792492503549a44e32
2013-08-26 14:19:54 -07:00
Tony Mantler 076ab83074 Minor warnings tidy
Change-Id: Ib2a85ca838ae521377855b916c57bb7bd00c42f3
2013-08-26 10:17:14 -07:00
Yu Ping Hu c76d008c90 Merge "Add the moved messages query." into jb-ub-mail-ur10 2013-08-23 22:54:14 +00:00
Yu Ping Hu 336e65b6e1 Add the moved messages query.
Change-Id: I6dea8055c5d1a4195b9613f684fbd1f5e8d807fd
2013-08-23 15:50:10 -07:00
Tony Mantler ed4accb24f Clean up warnings, finals, dead and useless code
Change-Id: I8225a78c3b1712479bb5752161e3585a2bc2be2e
2013-08-23 14:43:31 -07:00
Tony Mantler 21b95c1071 Check for null cursor in EmailPreferenceMigrator#migrate()
b/10456199

Change-Id: I3586fbb1aadbcc7e93208aa35ce948b133737d11
2013-08-23 11:43:49 -07:00
Tony Mantler 4727dc2903 Add TODO for debug variable for entering debug screen
See b/10446166 for STOPSHIP notice to disable debug screen before shipping

Change-Id: Ic0c845b558a2b745bc5015beb3eac3864165670d
2013-08-23 10:50:52 -07:00
Tony Mantler 219c3b5b84 Tidy up warnings in account setup fragments
Change-Id: I078df83dbc4afd10c0783a98bfbb23bced12489c
2013-08-22 15:09:42 -07:00
Yu Ping Hu f89b69abb0 Merge "When adding an account, permit precisely 1 email address." into jb-ub-mail-ur10 2013-08-22 00:37:05 +00:00
Yu Ping Hu aba5a30c78 When adding an account, permit precisely 1 email address.
Bug: 10357463
Change-Id: I310647e48f21be2942f2ad375b0e2e19c1af9015
2013-08-21 17:21:48 -07:00
Martin Hibdon b4d4729fa2 Merge "Add PingDuration to the Account table" into jb-ub-mail-ur10 2013-08-22 00:17:25 +00:00
Martin Hibdon 52135c6e87 Add PingDuration to the Account table
b/10328857
this is so that we can keep the current ping
duration and restore it on startup.

Change-Id: I7ae11fd21687cb9013222924934154c5ebe1f7e7
2013-08-21 17:00:55 -07:00
Yu Ping Hu 4525565948 Improve synchronization in EmailProvider.
It's possible to have multiple EmailProviders.
Also get rid of references to the multiprocess attribute.

Bug: 10388165
Change-Id: Ic6be363eaee20b3b5deddc7b3054d1a7419483a1
2013-08-20 15:06:06 -07:00
Tony Mantler c0a1a81543 Make EmailProvider URL matcher init threadsafe
Also remove mysterious extra indentation

b/10388165

Change-Id: I9a6f16c58e31653e5c47ff2898f66a44412b8a33
2013-08-20 09:58:17 -07:00
Scott Kennedy 8bdf037f9c Remove an unused constant
Change-Id: I4aaf0237719078731e3eb0c2434485530e653c86
2013-08-19 21:27:24 -07:00
Yu Ping Hu ab45810839 Merge "Disable policy listing in account settings." into jb-ub-mail-ur10 2013-08-20 02:05:54 +00:00
Yu Ping Hu 4df4c1c2d8 Disable policy listing in account settings.
It wasn't working right anyway.
Also, fix a problem where account settings were
not being fully initialized.

Bug: 8384097
Change-Id: Ia60ace2ce618b64fe4ad5ef8d8ac547a086a26d5
2013-08-19 18:52:44 -07:00
Martin Hibdon b940ed8adf Fix an OutOfBoundsException
b/10380970
This could happen if the response to the POP3
RETR request did not contain a content length.

Change-Id: I99ad93ec71ba917e0f36bee204d7f8d05c79c5ff
2013-08-19 17:07:05 -07:00
Yu Ping Hu ea69cbe533 Merge "Fix attachments when policies change." into jb-ub-mail-ur10 2013-08-17 02:26:40 +00:00
Yu Ping Hu 901faf1bfb Allow deletion from virtual folders.
Bug: 10367404
Change-Id: I869dfc5af7064e2992bbd47c89fd990e2caaa701
2013-08-16 18:30:44 -07:00
Yu Ping Hu 940a335bab Fix attachments when policies change.
This used to be done in the Exchange code, but it's more
appropriate here.

Change-Id: Ie2bd5722bda46741d367eef3a2e9d2493c3cc4e3
2013-08-16 17:46:01 -07:00
Paul Westbrook 908fac0b24 Fix NPE
Bug: 10292690
Change-Id: I34714a6a07bcaba3d20fdae32ee6b129c74c8a32
2013-08-16 15:53:36 -07:00
Tony Mantler dae31e6c28 Merge "Reimplement QuickResponse support" into jb-ub-mail-ur10 2013-08-16 21:57:33 +00:00
Martin Hibdon 1a0aa22dc0 Cut down on some unneccesary allocations
We were always allocating a one element array in
a loop. We can just keep create one array and
reuse it.

Change-Id: Ia44f0b711ef48fb87030c3f09f3f9fb654717b7a
2013-08-16 14:19:07 -07:00
Tony Mantler c6953b7755 Reimplement QuickResponse support
b/8622751

Change-Id: Id079efcf34dce15b5f5057f937582c0e198d3d50
2013-08-16 14:08:54 -07:00
Paul Westbrook 7985b43ab7 Add public no-arg Fragment constructors
Bug: 10311630
Change-Id: I0243462cdc28b9af3151754a8c8583330418579b
2013-08-13 16:43:34 -07:00
Martin Hibdon 66ac290b35 Fix a bug causing duplicate messages to be added
The IMAP time based query only takes a date, not a
date/time. This means that if we want to load all
messages since, for example, Aug 11 at 3:00 PM,
we'll actually get all messages since Aug 11 at any time.

Our local query actually took into account the time, so
when we loaded a map of local messages, it would not
always include all of the same messages that the IMAP
query would. This meant that if we processed a message
that was in our IMAP query window but not our local query
window, we'd always think it was a new message even
if it wasn't.

It's easy enough to increase the size of our local query
window so that it will definitely include all of the
messages the IMAP query might return, but this adds
a new problem: It's no longer safe to delete any local
message that did not come back in our IMAP query result.
Since our local query may include a larger time window
than the IMAP query window, we need to check each message's
timestamp, and only delete it if it is inside the remote
query time window.

Change-Id: Ib3c1bbe8f3db05720d32a981483676afa6d6c38b
2013-08-12 17:22:24 -07:00
Tony Mantler cef6c19be2 Move the "Add new quick response" button into the action bar
Change-Id: I433fb686837d0de125fb277f5055bc33b7769eff
2013-08-12 12:04:43 -07:00
Paul Westbrook 8c13dcd950 Merge "Fix problem in IMAP with non-roman locales" into jb-ub-mail-ur10 2013-08-12 19:02:39 +00:00
Paul Westbrook ae29fb76f0 Fix problem in IMAP with non-roman locales
This is a partial cherry-pick of:
https://android-review.googlesource.com/#/c/57514/1

Change-Id: I1dea4d5bf0bd02fec2baf5763f5864c3eb32f744
2013-08-12 11:43:44 -07:00
Tony Mantler 948e503b4a Merge "Continue rewriting QuickResponse support" into jb-ub-mail-ur10 2013-08-12 18:42:49 +00:00
Tony Mantler 6d24534804 Continue rewriting QuickResponse support
Change-Id: I95530e84d91f4becb3de5280af83ce546e1ed093
2013-08-12 11:40:16 -07:00
Alice Yang 50f0cba92c Merge "Sync disabled tip" into jb-ub-mail-ur10 2013-08-12 05:38:59 +00:00
Yu Ping Hu 4ef1f6a689 Merge "Synchronize all access to the EmailServiceInfo map." into jb-ub-mail-ur10 2013-08-09 20:41:47 +00:00
Paul Westbrook 3b758913be Merge "Use DatabaseUtils method instead of query()" into jb-ub-mail-ur10 2013-08-09 19:19:44 +00:00
yi.jang 44e1603155 Use deleteDatabase method to improve safety of DB file handling
Deleting .db files can make malformed database issues
when WAL(write ahead logging) mode is enabled.
EmailProvider doesn't use WAL mode currently,
But it has to be fixed because it might cause the problem in the
future.

Change-Id: Ie0313c5d253f3080401b00b197e7cbf97f25423c

Conflicts:
	src/com/android/email/provider/EmailProvider.java
2013-08-09 11:58:15 -07:00
Yu Ping Hu b5eed31d1b Synchronize all access to the EmailServiceInfo map.
Bug: 10255995
Change-Id: I36bee575a923b5c8bfbaea7babdf9f2c5e9bd378
2013-08-09 11:51:53 -07:00
yi.jang a674551464 Use DatabaseUtils method instead of query()
Use DatabaseUtils.longForQuery() method instead of SQLiteDatabase.query().
This reduces processing cost of database cursor.

Change-Id: Ibe53645b32a4de1ab6518f879e564ddf8f75d822

Conflicts:
	src/com/android/email/provider/EmailProvider.java
2013-08-09 11:50:27 -07:00
Tony Mantler fdb0fc712a Merge "Start cleaning up QuickResponse code" into jb-ub-mail-ur10 2013-08-08 02:21:18 +00:00
Yu Ping Hu bf0911f3de Disable attachment preview pref.
Bug: 10232077
Change-Id: If1ed251d63befd40dc55ada2da7c56f5ac611c68
2013-08-07 18:09:13 -07:00
Tony Mantler 05273f8309 Start cleaning up QuickResponse code
Change-Id: I76b5adbe8e05713c44d11a2e51d317cae6266a56
2013-08-07 16:57:21 -07:00
Martin Hibdon d42e14ad72 Merge "Implement two part imap sync" into jb-ub-mail-ur10 2013-08-07 20:30:00 +00:00
Martin Hibdon c75f5880ab Implement two part imap sync
b/10075523
Now, every 15 minutes we'll sync the last 24 hours.
Every 4 hours we'll perform a full sync, which will
take either the last 7 days, or until the oldest message
we already have locally.

Change-Id: Idc55a46a28af2a68cc324e414d51d88373941595
2013-08-07 12:26:24 -07:00
Mark Wei 034149b586 Add a setting for attachment previews.
Bug: 10131520
Change-Id: I782b331971272203d1b36a578cf6a149793b10e6
2013-08-07 10:55:59 -07:00
Alice Yang f1284d4d55 Sync disabled tip
Bug 9825835

Change-Id: I5fd692c7cd8a03d3b8ea140f2d6e8919bd293904
2013-08-07 08:31:29 -07:00
Yu Ping Hu c3ceed6894 Fix ui notifications on folder list changes.
uifolders and uiallfolders cursors now setNotificationUri on
the appropriate uri. That uri is notified whenever:

- A folder is inserted, deleted, or modified.
- A message is inserted or modified (since this can affect
  message counts).

This second one is still not quite right: there are some
conditions where counts aren't updating correctly.

While I was here, I renamed the notification uris to
avoid collisions between different versions of the app.

Bug: 9111855
Change-Id: Ia29bb6a65b4f673bf352fdf0e14270b3f1443ca8
2013-08-06 20:37:35 -07:00
Yu Ping Hu 6edccbf1f1 Fix capabilities to allow discarding drafts.
Bug: 10098652
Change-Id: Iebceb203cd054a1550f7c1f118841a77429f853a
2013-08-06 20:20:15 -07:00
Yu Ping Hu 9d628b4c41 Merge "Fix icons for unread virtual folder." into jb-ub-mail-ur10 2013-08-06 00:50:53 +00:00
Yu Ping Hu 5e5b08dcce Fix icons for unread virtual folder.
Bug: 9594158
Change-Id: I9e00e89fe74c43c99b8cb67e068aa06593c79413
2013-08-05 17:34:08 -07:00
Martin Hibdon d7384918e7 Merge "Fix a couple of bugs in imap synching" into jb-ub-mail-ur10 2013-08-05 19:30:38 +00:00
Martin Hibdon fda9d945e7 Fix a couple of bugs in imap synching
b/10111339
b/10125810
The first problem was that the imap BEFORE clause
is exclusive, so messages on the date given in
BEFORE will not be sent. Now, on the sync for the
most recent messages, we will just not specify a
BEFORE clause, so we can always get the most recent
messages even if our clock drifts from the server.

The second is that some imap servers do not accept
time information on the query dates, and that causes
errors. The imap spec defines the BEFORE and SINCE
clauses to come with a <date> only, not a time,
and although it seems that at least some imap servers
handle that, it can't be expected to always work.

Change-Id: Ibf41c6f7600b9f9537bc6d13b59873ee36798e1e
2013-08-05 12:27:13 -07:00
Yu Ping Hu bcd81d96a4 Report message count for folders where total count < 0.
Local-only folders will set total count = -1 to signify that
they should never sync with server.

Change-Id: I6034633e453343f14faac077902e67ea4e6b0a35
2013-08-02 12:23:19 -07:00
Yu Ping Hu 431811986f Merge "Move required system folder types to Mailbox." into jb-ub-mail-ur10 2013-08-02 01:18:34 +00:00
Martin Hibdon ef576c8e6c Merge "Update pop3 syncing" into jb-ub-mail-ur10 2013-08-02 00:44:39 +00:00
Martin Hibdon b177af7534 Update pop3 syncing
b/9857766
If we currently have zero messages (i.e. initial sync of
a new account) we will load the most recent 100 messages.
On subsequent syncs, we will load more recent messages
until either:
1. We have loaded 100 and not yet past any of the messages
we already had locally, or
2. We encounter messages that we already had locally, and
then load "deltaMessageCount" additional messages past
the ones we have locally.

Change-Id: I8b34409dcdaceff2d2e1906174241a74f2331688
2013-08-01 16:25:26 -07:00
Yu Ping Hu eb4ee8a7aa Move required system folder types to Mailbox.
I'm formalizing the concept of folders that must exist,
and the list of such folders should be accessible to all
sync adapters.

Change-Id: I9e4d2d51aa495d211eab2d1e36c3fa197a1ac00d
2013-08-01 16:19:28 -07:00
Yu Ping Hu a5355442a0 Merge "Improve message counting, ah ah ah!" into jb-ub-mail-ur10 2013-08-01 17:30:12 +00:00
Scott Kennedy 41d5342d98 Merge "Refactor PreferenceMigrator" into jb-ub-mail-ur10 2013-08-01 17:03:46 +00:00
Scott Kennedy 9e521deb6b Remove some warnings
Change-Id: Ie5adc71af6b6cec316c5186ac0566c02a4fc1bff
2013-08-01 08:47:51 -07:00
Scott Kennedy 60a9b7ecfb Refactor PreferenceMigrator
Do the same thing as with LogTag, so that we don't have the same
class name in the same package name in three projects.

This makes IDE builds much easier.

Change-Id: I6c9235ab231e1c04ba87c5da627094c7258a5edf
2013-07-31 22:40:08 -07:00
Yu Ping Hu 5ff368b845 Improve message counting, ah ah ah!
- Restore message_count in the database.
- For UI queries on outbox, trash, and drafts,
  use message count instead of total count.

Note this won't be the right thing to do when we properly
sync trash & drafts, but we'll address that when those syncs
are fixed.

Bug: 10098601
Bug: 10113686
Change-Id: I647c74396ee12ed981d89bfb654cc6d0a25cac95
2013-07-31 14:27:01 -07:00
Yu Ping Hu ef0d98155c Fix settings menus.
- Account & general fragments need to clear to remove
  "Add account" for phone & 7".
- 10" needs to therefore specify their menus in order to
  have "Add account".

Bug: 10097087
Change-Id: I133db9b9f7f6610ae30b46927ffcb8a9e4df4c0a
2013-07-30 18:51:01 -07:00
Yu Ping Hu e95b9bb3e4 Merge "Delete most of IEmailServiceCallback." into jb-ub-mail-ur10 2013-07-30 03:21:10 +00:00
Yu Ping Hu 2075c97f60 Delete most of IEmailServiceCallback.
The old callback mechanism is deprecated, in favor of making
calls on the ContentProvider.

Bug: 9842867

Change-Id: I65f559e593cda24456c4ffb96f785e054626dd0b
2013-07-29 20:04:42 -07:00
Paul Westbrook 6dd7bd29e9 Load large POP attachments
Load large attachments from a partial POP message

There will be a new change that improves the UI for loading
the rest of the message

Bug: 8651782
Change-Id: I075de1e82e27cf2018607eef50143850e8fecaf2
2013-07-29 18:58:37 -07:00
Paul Westbrook c362f66ee1 Merge "Stop crashing with POP attachments" into jb-ub-mail-ur10 2013-07-29 18:30:03 +00:00
Paul Westbrook 8fe7811241 Stop crashing with POP attachments
This is the first part of the change to fix POP attachments.
A following change will handle these partial messages better

Bug: 8651782

Change-Id: I8d00866207dedf63805e0eecab9555c28104f2dc
2013-07-29 11:21:22 -07:00
Tony Mantler 6cf15e66bc Re-add the demon "Add New Account"
b/10041669

Change-Id: I2b1db0a063ec292b33ec8f176b739c1c4422a040
2013-07-29 11:19:23 -07:00
Yu Ping Hu 48b14fde96 Fix all periodic syncs on upgrade.
Bug: 9844218

Change-Id: Ibacb309752b076faa3f96b5ad57dc121efd79bcb
2013-07-26 18:19:01 -07:00
Yu Ping Hu 02f0b1eee8 Remove MailService.
Change-Id: Ibffd0c9fb0eed4822dff28d1577fb455736cffd1
2013-07-26 17:38:07 -07:00
Yu Ping Hu 30b28286aa Merge "Cleanup service loading." into jb-ub-mail-ur10 2013-07-26 23:38:44 +00:00
Yu Ping Hu 47bcb5a21a Cleanup service loading.
Authenticator upgrading no longer uses the services file
to specify upgrades, so we can remove the fields associated
with that functionality.

Change-Id: I2122f18614d714a3d5a565fb4a6a547ddc010b6f
2013-07-26 16:23:27 -07:00
Yu Ping Hu afe097f318 Simplify account reconciliation.
- Rather than handle by type, do them all at once.
- Simplify when reconciliation happens.

Bug: 9056861

Change-Id: If264678c82c63090246ef8ff857c8e46f6672c85
2013-07-26 16:06:14 -07:00
Martin Hibdon e821797f27 Merge "Update IMAP sync method" into jb-ub-mail-ur10 2013-07-25 01:08:40 +00:00
Martin Hibdon 2503179606 Update IMAP sync method
Now it syncs using a date range query.

Change-Id: Ia520fbbe39521b1356acaf0fe764f9bdcc1aeb82
2013-07-24 17:57:07 -07:00
Yu Ping Hu b3cb475fd2 Fix DB upgrade code to set lookback correctly.
Rather than use null, just force the valid default value.
Also rename SYNC_WINDOW_UNKNOWN to SYNC_WINDOW_ACCOUNT to
better reflect how it's actually used.

Bug: 9989995
Change-Id: I8d0b466fe3bc2e4c651c309d4815cea201058d22
2013-07-24 16:07:33 -07:00
Yu Ping Hu 1c3ec5f6c0 Merge "Move authenticator upgrade to app upgrade time." into jb-ub-mail-ur10 2013-07-23 01:16:50 +00:00
Yu Ping Hu 462da178b1 Move authenticator upgrade to app upgrade time.
This used to run when the app first initializes the service map.

Bug: 9391930
Bug: 9971936
Change-Id: Iebaeb2dc94ef62edb0be0a7d5a008a26c4f5edfb
2013-07-22 17:33:57 -07:00
Tony Mantler a48929fac4 Purge the demon "Add New Account"
b/9857109 b/9685360

Change-Id: If5c3d6ea4b59cacf8196cdda67fbaeb6e2afa03e
2013-07-22 13:48:53 -07:00
Yu Ping Hu 9a1f00bee4 Change deleteAccountPIMData to take emailAddress, not id.
By the time the remote call actually runs, the account
may be deleted from the DB, so the account id is likely
useless.

Bug: 9021105
Change-Id: If28b4b8c4b5c52be35c6ff68b326c4ea28d7f7b4
2013-07-19 18:42:43 -07:00
Scott Kennedy 281c6365fb Add a new FolderUri
This will allow us to add query parameters such that Uris will still
appear to be equal, regardless of differences in the parameters.

Bug: 9780067
Change-Id: I483d009fe3681ec3d4323b3ca95dff8ca9f4ffde
2013-07-16 12:12:23 -07:00
Paul Westbrook ccf730fbe5 Migrate "show sender image" to UnifiedEmail
Bug: 9497358
Change-Id: Iefe39052fb7d53de02535ef98b45c66f1f918209
2013-07-15 18:17:10 -07:00
Yu Ping Hu d5acf0bbc0 Explicitly pass a callback when loading attachments.
This is part of moving away from the explicit setCallback,
which either has race conditions or is very noisy, or both.
(Each IEmailService call that wants callbacks should just
pass the callback explicitly.)

I'm not yet changing how the services actually handle the
call. Each protocol will need to fix this on their own.

Bug: 9735207
Bug: 9842867
Change-Id: If8cf69ffe82f3544ace9e58b1db5a183f38d038a
2013-07-15 21:54:02 +00:00
Paul Westbrook 765fa9e27e Remove STOPSHIP logging
Bug: 8132946
Change-Id: I1f14a75c4dd334c4ae04cb0d79409cd072f2be08
2013-07-15 12:03:25 -07:00
Yu Ping Hu 070569b46c Merge "Remove the folder structure daily sync for push accounts." into jb-ub-mail-ur10 2013-07-15 17:54:45 +00:00
Yu Ping Hu 05cf8a1c1f Remove the folder structure daily sync for push accounts.
Turns out that you don't need it -- Exchange has a way to
tell the client when folder changes occur.

Change-Id: If8089d9fe55e7ece407acf2f0dae977dced522b4
2013-07-15 09:29:05 -07:00
Paul Westbrook b2c7bcff78 Set the correct account uri to message
Bug: 9595801
Change-Id: Ie3a92c2194caf77ef6f3286e9dcb43684a0b32f4
2013-07-12 18:15:46 -07:00
Paul Westbrook 8a289cb07c shorten log tag lengths
Bug: 9815409
Change-Id: Ied2ef86ec204d005c246444906d7a385e939043e
2013-07-12 10:27:56 -07:00
Paul Westbrook dbb8b75a4b Fix feedback from Email settings
Bug: 9428466
Change-Id: I6816976b858a6a15da7d643320983208287a463a
2013-07-11 13:13:11 -07:00
Vikram Aggarwal 50f645e019 Parent folder as a URI
Email populates the URI correctly

Bug: 9694857 Populate folder.parent correctly in the provider

Change-Id: Ia509e1dbb2805a752805ba443527c3013715db24
2013-07-03 15:56:58 -07:00
Yu Ping Hu 9c45527779 Allow account setting screen without outbound hostauth.
We have a way to handle lack of outbound host auth, and it's
a legitimate state for Exchange accounts (since it's unused
anyway).

Bug: 8631134
Change-Id: I99863f627c4f364e61f7a4b99dea3e2606a55275
2013-06-27 13:05:18 -07:00
Scott Kennedy 229c070b0b Change the concept of a default account
The user no longer has control over this. Now, the "default" account
(which is only used for prepopulating the name of new accounts is
either the last used account (to be defined), or the first account in
the database.

This removes a setting, and simplifies a lot of code.

We may also want to auto-select the default account when entering the
compose screen from the combined view, but we do not currently have
an easy way to do that.

Bug: 7442992
Change-Id: Iff5bb36d8cbd327334211b670fa4851cbda6b9a0
2013-06-27 10:22:22 -07:00
Andrew Sapperstein cdee4b0c11 Use resource strings for system folders.
Fixes b/9193813. Previously we returned
a value from the database in all cases.
This meant that system folders were not
translated.

Change-Id: Ife568651886bfb6de76221b8bc5d013dac8fa21a
2013-06-26 18:20:10 -07:00
Scott Kennedy 1b8e0fa23f Clean up a bunch of warnings
Bug: 9565838
Change-Id: I5e95562bbf463f057cbcc4a9884427a774473b45
2013-06-25 15:34:32 -07:00
Yu Ping Hu 038924037b Fix mailbox sync options.
- Change mailbox sync interval to be a boolean.
- Decouple Inbox settings from account settings.

Change-Id: Id02d43b281f323ca4db499ce97e8f4bb6d82c2bb
2013-06-24 19:38:35 -07:00
Andrew Sapperstein 478417a794 Support eml attachments in email.
Change-Id: I76274540d00a292d5a8f777d75d8e9f7b2ef3a51
2013-06-21 11:38:13 -07:00
Yu Ping Hu a54ee609cd Convert Mailbox syncInterval column to boolean.
We are no longer doing per-mailbox sync intervals; instead,
mailboxes opt in to syncing, and the account sync interval
controls what happens.

Change-Id: I8ae32ea25079abbb63bb6a6a282bf5c06de73fca
2013-06-20 18:38:48 -07:00
Yu Ping Hu 6f2beeb59a Add "account only" periodic sync for push accounts.
EAS push only gets changes to the contents of collections,
but not for changes to accounts or folder structure. This
adds a new sync type to fetch only accounts, and adds a
periodic sync of this type for push accounts.

Change-Id: I1e9337252dbb5e53db3f7c5953e089de2c69d18c
2013-06-20 15:46:29 -07:00
Mark Wei 650f50023a Merge "Fix IMAP attachments REDOWNLOADING." into jb-ub-mail-ur10 2013-06-20 00:42:13 +00:00
Mark Wei 8f474dc02f Fix IMAP attachments REDOWNLOADING.
Previously, if you clicked Download again, you will never be able to view that
attachment again.

Change-Id: Ie944becaf8c89a1a27b8625af4795550e9213f5e
2013-06-19 17:35:37 -07:00
Yu Ping Hu e7ebb5de04 Remove references to deprecated sync states.
Change-Id: Ib22bac766fb0ac4d6e764ee92b56a8026baee852
2013-06-19 17:10:43 -07:00
Yu Ping Hu f44697e158 Merge "Return null instead of crashing when querying a bad folder." into jb-ub-mail-ur10 2013-06-19 01:24:35 +00:00
Yu Ping Hu 70500d2253 Return null instead of crashing when querying a bad folder.
Bug: 9250557
Change-Id: Ic0074fa1f6db53a7495c7de48a8f42158a0ea1d9
2013-06-18 18:13:45 -07:00
Paul Westbrook e7d539ddf9 Update the signature summary
Bug: 9480853
Change-Id: I8996efa268c906485ee1d5cfcf0f883d40927009
2013-06-18 16:33:20 -07:00
Yu Ping Hu aa0ca16a27 Remove references to account mailbox.
Exchange implementation no longer uses them.

Change-Id: I221a914f2428c0c7989f79392ca82f7a8f4b1c52
2013-06-17 19:51:47 -07:00
Yu Ping Hu 21b2522d7f Remove auto sync windows.
Also includes other DB upgrade code.

Bug: 8668336
Bug: 9226612

Change-Id: Id9664fd8cda466ec34862a793e41cbcce78efb4c
2013-06-14 18:26:42 -07:00
Paul Westbrook 525e8ad321 Move support for settings menu to UnifiedEmail
Move the base settings menu to UnifiedEmail

Bug: 9393150
Change-Id: Ifa69125d84802a0d7dd2275e4704ec7a4d1fb2f1
2013-06-12 23:52:43 -07:00
Scott Kennedy 380985add9 Merge "Move to Inbox" into jb-ub-mail-ur10 2013-06-12 20:02:12 +00:00
Scott Kennedy 1079b6e962 Move to Inbox
Add a new Account setting field: Uri moveToInbox
This contains the Uri to use for the "move to inbox" action, which
may differ from defaultInbox.

There is no Move to Inbox in Email right now.

Bug: 9256654
Change-Id: I7c81c8115eda83123a09a9b7da7adf97a3c79964
2013-06-11 19:56:44 -07:00
Yu Ping Hu 6fadd5a0bd Add some null checks.
Bug: 9393662
Change-Id: I8c47b701062fb91e0e622644a26b470e78f62014
2013-06-11 16:56:06 -07:00
Paul Westbrook 38f22dbf08 Use "show pictures" code from UnifiedEmail
Bug: 9320770
Change-Id: I701a93e2f09b8405a2c4bc56f7793f5abadbcd1e
2013-06-07 18:09:57 -07:00
Paul Westbrook 5a3fe57f4e Fix logging crash
If the string contains a character that is intrepreted by the
string formatter, this would throw an exception

Change-Id: I60cccb539bf197fa555d8d1f0fa1bdca3e07114e
2013-06-06 17:20:52 -07:00
Paul Westbrook 555bd3c0b7 Don't show search folder
In folder lists, don't show the search folder

Bug: 9227357
Change-Id: Ic0b8a39929f6d2528f445d3746c4eb1915275593
2013-06-06 11:06:38 -07:00
Scott Kennedy 4c47dadf18 Merge "Unify LogTag" into jb-ub-mail-ur10 2013-06-06 18:03:53 +00:00
Paul Westbrook c1d56928b2 Add a limit to the Conversation query
Bug: 9294348
Change-Id: Ifedfe657f205adb1c8a12382b908f4b3b4346500
2013-06-06 10:08:22 -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
Andrew Sapperstein 6be411edd0 Refactoring to support eml viewer in UnifiedEmail.
Moved two files out of Email into UnifiedEmail and
removed their dependencies on EmailContent. As a result,
those classes now return the data directly via a data only
class.

Change-Id: Iaf0618dd6879c9dc2a41943d3d15428904b65768
2013-06-04 15:37:40 -07:00
Paul Westbrook 9d5ed9e7a8 Added logging, and switch to AsyncTask
Bug: 9111546

Change-Id: I287b07346bb1729c7a1afadbc0c94a0d37df92f8
2013-05-29 20:17:17 -07:00
Andrew Sapperstein bc7cd75e9a Prevent duplicate inboxes after upgrade.
Previously, we were not properly handling the
case-insensitive INBOX mailbox type. We are now
upgrading properly. Fixes b/8701883.

Change-Id: I61be5159e23dc3e9578e577e33bc00a63f56b525
2013-05-29 18:10:59 -07:00
Scott Kennedy ddca2a0dcb Show unread count when virtual folder is selected
We were not populating the unread count for virtual folders in one of
the two code paths, which resulted in the count disappearing from
the folder list whenever that folder was selected.

By moving the count code into getVirtualMailboxRow(), it will always
be called, so the count will always show up.

Change-Id: Ibb947ec6ed761babbcf162dbab38f44a6150d5e3
2013-05-28 14:59:22 -07:00
Yu Ping Hu fb6a74b5e0 Merge "Handle redirection during validation." into jb-ub-mail-ur10 2013-05-23 22:52:39 +00:00
Yu Ping Hu c28347552e Handle redirection during validation.
This allows the validator to tell the app that
it should use a different host.

Change-Id: Ie42c32aa7aea83e4d95d2b82b88225036b2407a9
2013-05-23 15:11:25 -07:00
Andrew Sapperstein e43224f7ae Merge "Return raw folder in respond()." into jb-ub-mail-ur10 2013-05-23 19:02:24 +00:00