Commit Graph

4787 Commits

Author SHA1 Message Date
Anthony Lee e453e7dd29 Merge "b/13734162. Make sure that SmartForward is enabled on EAS accounts." into ub-mail-algol 2014-04-02 22:08:04 +00:00
Anthony Lee 6f7c1c824d b/13734162. Make sure that SmartForward is enabled on EAS accounts.
This is an Algol only fix that needs to be reconsidered for L.
The fix comes in 2 parts. The first addresses existing accounts.
The second addresses new accounts. First we check that the protocol
is EAS and then we check the protocol version to be greater than
12.0 before setting the flags. In the future, the protocol specific
flags should be set in the protocol specific components.

Change-Id: I00a6fa3337d5230801f6de8876332c66deeae2c4
2014-04-02 14:07:41 -07:00
Tony Mantler 4c6338bf1a Make sure HostAuths are populated on manual setup
b/13751284

Change-Id: I61aa94e7ebedc5550854731caa068b9e577c2b3b
2014-04-02 13:30:51 -07:00
Tony Mantler 68da1ad73f Merge "Add missing call to super.onSaveInstanceState()" into ub-mail-algol 2014-04-01 23:00:43 +00:00
Tony Mantler 0976275d7a Merge "Change 'Manual setup' into clickable text instead of a checkbox" into ub-mail-algol 2014-04-01 22:56:52 +00:00
Tony Mantler 14178ca1e3 Add missing call to super.onSaveInstanceState()
b/13750715

Change-Id: I328e25f355b60217b2dbc874fff9bd3742e79f90
2014-04-01 15:55:51 -07:00
Tony Mantler 1a9c5fe7ad Fix automatic account creation
b/13695686

Change-Id: I108989e50337a839c42fdff1cc11697d8adee954
2014-04-01 15:10:18 -07:00
Tony Mantler 392c263c19 Change 'Manual setup' into clickable text instead of a checkbox
b/13733521

Change-Id: I7f338cbfb8357c5e1a27c6e886ea96e5c6924d22
2014-04-01 14:11:15 -07:00
Martin Hibdon 0db900d622 Merge "Allow setting of the sync window for IMAP accounts" into ub-mail-algol 2014-04-01 19:54:31 +00:00
Martin Hibdon c0d94a44ea Allow setting of the sync window for IMAP accounts
b/13362667
Really this is just for testing, the only window setting
that has any affect is SYNC_WINDOW_ALL. At some point we
should revisit the imap sync window strategy, right now
we will sync up to the oldest message currently on the
device, which is potentially a large amount of data.

Change-Id: I00dd59bd084e85bdf80f3991062b84fcd6a12362
2014-04-01 12:17:34 -07:00
Tony Mantler ecd23cf0f2 Check amProtocol for empty before assuming the user picked a different protocol
b/13734367

Change-Id: I36514cedc31f9a02c627e921b37fdb500d0ab74c
2014-03-31 16:43:14 -07:00
James Lemieux f456b4f9d4 Merge "Show "To:<Names>" in sent and outbox index views" into ub-mail-algol 2014-03-31 21:11:40 +00:00
James Lemieux 603d1bfa5e Merge "Fix an out-of-date comment." into ub-mail-algol 2014-03-31 21:11:19 +00:00
James Lemieux 974ccb1735 Fix an out-of-date comment.
The code related to the comment didn't ship as part of Kitkat MR2 and instead will go out with the platform L release.

Change-Id: Ib9ece3390005b5b0217e0c5540322802b1c096ad
2014-03-31 21:09:51 +00:00
Anthony Lee 8a5a5779a3 Merge "b/13659368. Ensure properly download status for attachments on failures." into ub-mail-algol 2014-03-31 20:47:27 +00:00
Anthony Lee b6125ae385 b/13659368. Ensure properly download status for attachments on failures.
The reason why the UI is wedged is becasue it doesn't
see a state transition in the status. So now we detect the situation
where the user is trying to download an ineligible file and force
the status to indicate that it was a failure to dismiss the UI and
to show the correct error message.

Change-Id: I9264966830a317724bf2fe469ae570860ba7c2a9
2014-03-31 13:21:28 -07:00
James Lemieux 469c426376 Show "To:<Names>" in sent and outbox index views
b/13304929

The solution being delivered introduces a new folder capability:
UIProvider.FolderCapabilities.SHOW_RECIPIENTS which indicates a folder
should display "To: " in front of its participants list because it
is a folder containing outgoing mail or sent mail (thus viewing
recipients is more useful than senders). This capability is returned
for Drafts, Sent, and Outbox.

Note that extra work was required to make this function properly in
the widget we export to the launcher. See BaseWidgetProvider and
friends for details.

Change-Id: Ie7b077b8dd8934182de5e94a90fa163e8105faac
2014-03-31 12:35:15 -07:00
Tony Mantler 296cde5603 Add disambiguation screen when user protocol choice differs from providers.xml
b/13640868

Change-Id: I75116f30e9c12d2e8b6757bf208e1519e438aed9
2014-03-28 17:08:04 -07:00
Tony Mantler ca7df3f234 Begone, foul keyboard!
Hide keyboard when advancing setup screens

b/13640446

Change-Id: I913a6afe9bcd4864bf218cab59a3d9e84b23f7d9
2014-03-28 11:20:23 -07:00
James Lemieux 5057d6dffb Replying to a Message with an encoded email address shows the encoded address in the to field.
b/11658428

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

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

Change-Id: Ie2e3264646e25c08c4ba74f60b3e1090c052e6c6
2014-03-27 23:25:53 +00:00
Martin Hibdon c7031638bd Minor formatting change
b/13642247

Change-Id: I02e495142d8043c8749ab0bce21f4c7c1cea7a5f
(cherry picked from commit 64b4f7dcff)
2014-03-27 21:30:37 +00:00
Martin Hibdon 23ff99df9d Merge "Fix IMAP message upsync to include attachments." into ub-mail-algol 2014-03-27 21:30:08 +00:00
Tony Mantler 38f9991634 Fix IMAP message upsync to include attachments.
b/13138456

Change-Id: If16b619a650c640a37cb4563750a6327a5e601e6
(cherry picked from commit 0c8696c2eb)
2014-03-27 21:23:32 +00:00
Martin Hibdon e5d754e16c Fix a NPE trying to download an attachment
b/13642247

Change-Id: I4cfb7e4a3be12fdc8b8c345c1aeabd85a729d16a
(cherry picked from commit adabb4285b)
2014-03-27 21:22:28 +00:00
Anthony Lee 30dc25c390 am 41e3f37b: Merge "b/13659097. Disable EAS Policy max attachment size from EmailProvider." into ub-mail-algol
* commit '41e3f37b501ea787c6569f4ac22a11d269dd6557':
  b/13659097. Disable EAS Policy max attachment size from EmailProvider.
2014-03-27 18:46:13 +00:00
Anthony Lee a68ab80305 b/13659097. Disable EAS Policy max attachment size from EmailProvider.
Disable the code that translates the max attachment size column of
our db to the EmailProvider max attachment size column. They mean
different things as our max attachment size column refers to the max
size of any file that we can download where the EmailProvider's version
represents the max attachment size of a file that we can upload.

Change-Id: I93202766d7b1782c902f17ce20b2823aaf647ec4
2014-03-27 11:37:41 -07:00
Tony Mantler 2be297f1ba Merge "Fix IMAP message upsync to include attachments." into ub-mail-master 2014-03-26 19:53:57 +00:00
Tony Mantler 0c8696c2eb Fix IMAP message upsync to include attachments.
b/13138456

Change-Id: If16b619a650c640a37cb4563750a6327a5e601e6
2014-03-26 11:49:38 -07:00
Martin Hibdon 77ba9a751f Merge "Minor formatting change" into ub-mail-master 2014-03-26 18:03:09 +00:00
Martin Hibdon 64b4f7dcff Minor formatting change
b/13642247

Change-Id: I02e495142d8043c8749ab0bce21f4c7c1cea7a5f
2014-03-26 10:47:54 -07:00
Martin Hibdon a44a63e273 Merge "Fix a NPE trying to download an attachment" into ub-mail-master 2014-03-26 17:46:58 +00:00
Martin Hibdon adabb4285b Fix a NPE trying to download an attachment
b/13642247

Change-Id: I4cfb7e4a3be12fdc8b8c345c1aeabd85a729d16a
2014-03-26 10:38:51 -07:00
Andy Huang 5687c6dade tighten inline attachment view intent builder
Bug: 7659807
Change-Id: I845199fd6848cb5c0a7ebfd2f63f8c3045fffa36
2014-03-25 13:30:16 -07:00
Martin Hibdon 3f4a556d54 Fix Calendar and Contacts syncing for POP and IMAP accounts
b/11818312

Change-Id: I34b82040991506bf9099cc0df237454a8f97c764
2014-03-24 17:17:05 -07:00
Martin Hibdon 3021a60bc7 Merge "Only make Calendar and Contacts syncable on Exchange" into ub-mail-master 2014-03-20 19:57:05 +00:00
Martin Hibdon 6a51abdf6e Only make Calendar and Contacts syncable on Exchange
b/11818312
We were using the existance of OPTIONS_CALENDAR_SYNC in the
bundle to indicate that syncing was possible, and it's value
to indicate whether automatic syncing should be enabled.
This is misleading.
Now, we check the serviceInfo for the account type to figure
out if sync calendar and contacts is possible, and use the
options passed in to indicate whether or not it should be
automatic.

Change-Id: I776519668c6630dc71153fb008218a7ca6357c74
2014-03-20 12:47:36 -07:00
Anthony Lee eba80c114e b/9564335. Add support for a maxAttachmentSize column in the Account
table and connect the data to the Settings object in the existing
location (SettingsColumns.MAX_ATTACHMENT_SIZE).

Change-Id: Iaf48995757511e1dfb65aa35ff6d81bbc47187bd

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

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

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

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

Change-Id: I7ed41853df6af6762c80283a2a3510ce41551657
(cherry picked from commit 446136a2278652c627068ecddff534de1ad431ab)
2014-03-19 23:51:14 +00:00
Tony Mantler c90680915d Merge "Fix setup flow dialog dismissal" into ub-mail-master 2014-03-19 23:35:36 +00:00
Yu Ping Hu f679cd08d1 Delete unused functions from IEmailService.aidl.
Change-Id: I131d2d3436a50c94d664fc57c6514481d9afbc97
(cherry picked from commit 8ff6c107867bc2044ba50cad010dbf4a2e93436e)
2014-03-19 22:35:47 +00:00
Tony Mantler 254dde761f Fix setup flow dialog dismissal
Also remove redundant ok/cancel strings

b/13512724

Change-Id: Idfc7745fbf6a08f09051eb4a6154fc446b43eb67
2014-03-19 15:23:56 -07:00
Tony Mantler cc82c7bae2 Fix IME "Next" button handling in credentials screen
b/13544867

Change-Id: I63ba680a5551dd4bd860026b9110b20a2ae080b6
2014-03-19 11:13:04 -07:00
Tony Mantler e93b81a51a Merge "Fix back button handling on protocol choice screen" into ub-mail-master 2014-03-19 17:25:47 +00:00
Tony Mantler b5a4433798 Fix back button handling on protocol choice screen
b/13543514

Change-Id: I27078220aca60ac5137fc69e34e52937313602c9
2014-03-19 10:09:24 -07:00
Tony Mantler d90643c732 Move credential population to after we collect credentials
b/13512724

Change-Id: I2df8064fc392a928d77291aa41630e4715bedc39
2014-03-18 16:46:33 -07:00
Tony Mantler 452744474a Fix broken tests and remove dead code
Change-Id: I3ae31c604c86641622f997915dc7d86bf2c662a2
2014-03-18 13:57:11 -07:00
Tony Mantler ae980cd685 Account setup flow: Move button and headline handling into fragments
b/13508015

Change-Id: I9f7a09467fbee5a57985f36eaa47c2cc7b9d4086
2014-03-17 16:45:47 -07:00
Tony Mantler 7fbf3ac6d1 Merge "Skip protocol choice if user entered from system account manager" into ub-mail-master 2014-03-14 23:11:37 +00:00
Tony Mantler 53b64eee54 Skip protocol choice if user entered from system account manager
b/13475223

Change-Id: Id1ec6259e2b3880f9ce83ffe7795c40aa069466e
2014-03-14 15:48:10 -07:00
Andrew Sapperstein 98ade11ad6 Merge "Send empty data for permalink/clipped fields." into ub-mail-master 2014-03-14 22:16:38 +00:00
Tony Mantler 282edb95a3 Add an alternate force-create account path
Allows auto-filling account details using providers.xml

b/13456413

Change-Id: I1d7f6346e2f1d1cc339610be68ff7194210bc75c
2014-03-13 16:21:06 -07:00
Tony Mantler 250d2f9fb8 Merge "Move protocol selection before credential collection" into ub-mail-master 2014-03-13 22:00:25 +00:00
James Lemieux 2c74c0efae Merge "Move Help & feedback to Nav drawer." into ub-mail-master 2014-03-13 21:45:54 +00:00
Tony Mantler d2ffe23fca Move protocol selection before credential collection
b/13454985

Change-Id: Iabaf74e3212bb2e3b02e55ec947f0e9a32b597e5
2014-03-13 14:11:06 -07:00
Tony Mantler f6a945a6cf Clean up cert handling in AccountSetupCredentialsFragment
b/13453003

Change-Id: I87567c7e5cb39c7366c8ed346b0e300c3fc6da16
2014-03-13 11:30:25 -07:00
Tony Mantler e31979ae2e Tweak conditions for diverting back to the password screen
b/13451098

Change-Id: Id0422342aeac3647324afd8e41f6611069a27aad
2014-03-13 10:56:24 -07:00
James Lemieux 31ce5555b8 Move Help & feedback to Nav drawer.
b/11061485

HELP and SEND FEEDBACK are now the two bottom-most drawer
items in the Navigation drawer when it is present or in
the overflow menu when it is not present.

SEND FEEDBACK still behaves as always.

HELP has been redesigned so that it displays the help
content in a local webview rather than using an external
browser.

Change-Id: I01003f3cd6f8dedbcfb95ae87872968dfc6be48b
2014-03-12 16:56:56 -07:00
Martin Hibdon 351aa25ccb Merge "Add the password failed warning text" into ub-mail-master 2014-03-12 22:21:26 +00:00
Martin Hibdon 40baa96c3f Add the password failed warning text
Now, if you fail to authenticate on the credentials fragment,
instead of taking you to the full accountSetupIncoming,
it just takes you back to the credentials fragment with
a warning that your password is wrong.
Also, make it so that pressing "next" on the password IME behaves
the same as pressing the Next button.

Change-Id: Ice91c842659c33ba6f8ac876356a79265c703e2e
2014-03-12 15:19:11 -07:00
Tony Mantler cac33a2e91 Allow entry into account settings when inbox is null
b/13436061

Change-Id: I544aa55000a91fe121de9bc7963eb89115d4758d
2014-03-12 15:05:50 -07:00
Tony Mantler ee9cdebcb2 Merge "When opening account settings, divert to AccountSecurity if needed" into ub-mail-master 2014-03-12 20:53:05 +00:00
Tony Mantler 5ca9d39008 Merge "Centralize EmailServiceInfo retreival and pre-fill data for autodiscover" into ub-mail-master 2014-03-12 20:24:39 +00:00
Tony Mantler 85d2451148 When opening account settings, divert to AccountSecurity if needed
b/12843721

Change-Id: Ic7ae99a8f3ddba33d224387921a90624c37bc8b5
2014-03-11 15:09:37 -07:00
Andrew Sapperstein 07d674f9fe Send empty data for permalink/clipped fields.
b/2887917

Change-Id: I08e0317d3350732c6de9569d67d9a39b1a9ebf2e
2014-03-11 14:30:14 -07:00
Martin Hibdon 658231e207 Add certificate selector to credentials fragment
This doesn't work yet because the account type selection
screen doesn't not currently come up after the initial
setup screen. Also, right now we will always display the
cert selector, regardless of security type, because at
this point in the flow we haven't asked the user for that.

Change-Id: I8b4a13030cd6a4a8b243d7208d8df9798fd24bea
2014-03-11 12:56:51 -07:00
Tony Mantler dfce22eeb1 Merge "Disambiguate providers between AOSP and EmailGoogle" into ub-mail-master 2014-03-10 22:04:32 +00:00
Tony Mantler 04731178b2 Merge "Populate certificate picker when a cert is present" into ub-mail-master 2014-03-10 21:58:12 +00:00
Tony Mantler 6ecdc18457 Populate certificate picker when a cert is present
Motorola: IKXREL1KK-816
b/13398087

Change-Id: I3b69c780a491808afa0cb3717020f42b41c1c0d7
2014-03-10 14:48:34 -07:00
Tony Mantler 9ef3c8b3f8 Disambiguate providers between AOSP and EmailGoogle
b/13323222

Change-Id: I7d10182973b57e4c2c306739a15237952a7e6c95
2014-03-10 13:01:23 -07:00
James Lemieux 0dffe3afd7 Keep on getting a couldn't sign-in notification
b/11551107

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

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

Change-Id: I2c772ecab18f3e57059eceeae01de08f1fdab4c2
2014-03-07 16:38:47 -08:00
Tony Mantler 064726d9f9 Centralize EmailServiceInfo retreival and pre-fill data for autodiscover
b/13341957
b/13356801

Change-Id: I9ed399bd6a695e14cf8019d3f62c7e5753e1f4d8
2014-03-07 14:28:35 -08:00
Tony Mantler 094656be6e Merge "Fix some save/restore state bugs in setup flow" into ub-mail-master 2014-03-07 18:52:24 +00:00
Andrew Sapperstein b9e4521634 Merge "Support display of chevrons in Email. b/7961430." into ub-mail-master 2014-03-07 18:24:02 +00:00
Andrew Sapperstein 803631497c Support display of chevrons in Email. b/7961430.
Change-Id: I6e19d4a942539f63b9503e1036761758715d3558
2014-03-06 21:46:24 -08:00
Tony Mantler 44020f5e40 Merge "Convert manual setup to a checkbox" into ub-mail-master 2014-03-06 19:25:06 +00:00
Tony Mantler e8fe78062d Fix some save/restore state bugs in setup flow
b/13335176

Change-Id: Ib7b794149de849112317f9b956e82889ecadf6d0
2014-03-06 10:29:22 -08:00
Tony Mantler 1b6292e2ab Convert manual setup to a checkbox
b/13312261

Change-Id: Ie71666e29f506bc4ca87aad62364592d9aa63c19
2014-03-05 14:10:44 -08:00
Andrew Sapperstein 19b7e95d64 Use BroadcastReceiver to listen for LOCALE_CHANGED
Previously, we used the service to listen to Intent.ACTION_LOCALE_CHANGED.
This never worked because that intent is broadcasted by the system
and so Services will never receive them. Just use the existing forwarding
infrastructure to send the broadcast to the service.

Change-Id: I50ef625804e76e2348d3fe14686778d54463b78d
2014-03-04 15:55:52 -08:00
Tony Mantler 001e4ea42c Fix automatic account creation
b/13105763

Change-Id: Ia3525dfe194ef6ed1528329cf77d64214c81d8cf
2014-03-04 09:54:56 -08:00
Tony Mantler 05f946e6cf Merge "Reset state when we error out of certain actions" into ub-mail-master 2014-03-04 17:31:52 +00:00
Tony Mantler 4b73ce73bf Merge "Get rid of Account#name" into ub-mail-master 2014-03-03 21:08:31 +00:00
Tony Mantler e6b1575a45 Use email address instead of trying to reconstruct it
b/13280168

Change-Id: I0391dd8c169aa0185c7ff9f79970bcb5595fe84f
2014-03-03 10:52:56 -08:00
Tony Mantler 531b363059 Get rid of Account#name
b/13249115

Change-Id: I810237961f429e1f082925c0c6423ca808d4c8f0
2014-03-03 10:04:26 -08:00
Tony Mantler 34eac10a11 Reset state when we error out of certain actions
b/13249204

Change-Id: I8312d913d5a14bfd7e02f35393cc071ba66225d1
2014-02-28 15:56:55 -08:00
Tony Mantler 5bd639edc5 Set activity result when account is created
So we don't drop out of the app after initial account creation

b/10666403

Change-Id: Ibd9b2c1ac6ee950e6d80f1724f5c7fd989f718b6
2014-02-28 11:33:43 -08:00
Tony Mantler 9e7b850595 Merge "Merge setup fragments under a single activity" into ub-mail-master 2014-02-28 17:11:38 +00:00
Tony Mantler 39d63b746c Merge "Fix sync window preference being added multiple times" into ub-mail-master 2014-02-27 17:25:44 +00:00
Tony Mantler 9ef2c5f2cf Fix sync window preference being added multiple times
Also clean up potential NPE

b/13109860

Change-Id: I46bebd6af6329679af28b6b997cd33fca97376dd
2014-02-26 16:02:12 -08:00
Tony Mantler 76472ae40c Merge setup fragments under a single activity
Change-Id: I10cf8bb9f6bc1a26ea97ae664f0196ae9e9493b5
2014-02-26 13:47:41 -08:00
Tony Mantler 220dc1bf57 Fix IMAP delete handling
When a message is flagged as deleted on the server, but is not yet purged,
we'll see it syncing down with a deleted flag. This change treats that
condition as if the message has been fully deleted.

Also fix a copy/paste error for cleaning up the message modification tables.

b/12367845
b/13137235

Change-Id: Ic741dedc10251775a7afdce171d59efbd2cf1a5f
2014-02-24 10:19:05 -08:00
Tony Mantler da2582c9f4 Merge "Quit dropping inline attachments on the floor" into ub-mail-master 2014-02-21 20:59:12 +00:00
Tony Mantler c5685ba600 Fix tests
Change-Id: I89370919dd5a8a129ea946f2d3429f0d4a056eb6
2014-02-21 11:43:19 -08:00
Tony Mantler 16fea4dfc0 Quit dropping inline attachments on the floor
If we have image/* attachments with "Content-Disposition: inline" we would
fetch the images immediately, then drop them on the floor instead of saving
them to the DB.

Add code to catch these attachments and save them.

b/13132802

Change-Id: I5203bb1aa518aa46cdb3a38ead6f79af63b521ac
2014-02-21 11:16:29 -08:00
Martin Hibdon aab398522a Merge "Fix some broken tests" into ub-mail-master 2014-02-20 00:27:42 +00:00
Martin Hibdon 10c7412555 Fix some broken tests
b/13085182
You can't look up emailServiceInfo for smtp, we don't store that
in services.xml. The thing is, if we're using outgoing settings,
we're always using smtp, which allows oauth.

Change-Id: I5c6032e8d5020ba83fa1c803666b83f134f87f75
2014-02-19 16:17:43 -08:00
Tony Mantler 6c241b9738 Merge "Fix unbounded async task creation in ADS" into ub-mail-master 2014-02-19 19:35:01 +00:00
Tony Mantler 426de73380 Fix unbounded async task creation in ADS
Queue operations through a single ConcurrentLinkedQueue and
service the updates on a single async task to avoid spamming the
async thread task queue.

b/11336926

Change-Id: I8e5c526d61f70fbad0ccef80afd08fc26bb5acf0
2014-02-19 09:48:58 -08:00
Martin Hibdon 7190973877 Fix authentication view
Unfortunately, there are problems with making a single
view handle all kinds of authentication and certificate
selection. The layouts for the account settings screen
on phones versus tablets are just too different. So
now the certificate selection code has moved back to the
fragments themselves, and the authenticationView only
handles passwords and oauth.

Change-Id: I1ef0c69687a00029717b836458c85c1b0667ff95
2014-02-18 14:40:36 -08:00
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