Commit Graph

11 Commits

Author SHA1 Message Date
Danny Baumann c96099279b Properly unregister alarm manager callbacks.
Change-Id: I2d474bc1cee168a5b76b8710b382498cd6c2fd59
2015-10-18 14:06:01 -07:00
Danny Baumann cb4fda8286 Do less work on IDLE refresh.
Don't do a full reconnection, but just a stopIdling/startIdling pair. In
order to be able to do that, make sure the IDLE connection is fully shut
down when stopIdling() returns, for which some refactoring was needed to
avoid a deadlock on mIdledFolders: the ImapIdleListener callbacks
acquire this lock, so stopIdling() now MUST NOT be called with
mIdledFolders lock held.

Change-Id: Ifa1677d7845722ccee2b1b9380c7b7e4014bcd97
2015-10-18 14:05:32 -07:00
Danny Baumann 006ea81b71 Don't solely rely on the presence of RECENT for checking for new mail.
It may happen (depending on server and/or timing) that only an EXISTS
response is sent to the IDLE connection when new mail arrives. Don't
discard that response, but evaluate it to determine whether there's new
mail by checking whether the message count increased.

Change-Id: Ia49714e6cd42dd71dfda8b7bbdf1fd622972edda
2015-10-18 14:05:32 -07:00
Danny Baumann fd42df6fc0 Reset idling flag when cancelling early due to being cancelled.
Change-Id: Idde5f3a3fa04a1aa80ef4cdb9e3ba1ab01d3fcb5
2015-10-18 14:05:32 -07:00
Danny Baumann cd69d44da0 Add some debug statements.
Change-Id: I9295bedb5b7908c8ee873285c255816373d2c602
2015-10-18 14:05:32 -07:00
Danny Baumann 36f18be31c Assign debug tags to IMAP communication output.
Allows better tracking of the output if multiple connections are active.

Change-Id: I900c9f9ecda06d3191c4cf82af7e774ae70b7dac
2015-10-18 14:05:32 -07:00
Danny Baumann e680bf0ddc Fix argument order.
Change-Id: I087937c1323cfa1fd3d5400ef0a69d7476e36d20
2015-10-18 14:05:32 -07:00
Danny Baumann 0672de3149 Fix ArrayIndexOutOfBoundsException.
This crash happens when the server isn't able to resolve the MSN:

FATAL EXCEPTION: IdleReader 3:Inbox
Process: com.android.email, PID: 3200
java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
      at com.android.email.mail.store.ImapFolder.extractImapChanges(ImapFolder.java:1641)
      at com.android.email.mail.store.ImapFolder.access$700(ImapFolder.java:77)
      at com.android.email.mail.store.ImapFolder$1.run(ImapFolder.java:294)

Change-Id: I8a8c7cf3f2949630ee9db3646e5832246d69132d
2015-10-18 14:05:32 -07:00
Jorge Ruesga 08ace26ed6 email: imap push
Change-Id: I8a184a5644e4322ee65d969e14cd47fe119f5df2
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
2015-10-18 14:05:32 -07:00
Daniel Volk c2c258f261 Don't fetch deleted messages from IMAP folder
Fetching messages from an IMAP folder within a specific date range returns
messages marked as deleted, also. Unlike every other getMessages() method,
which filter out deleted messages.
This leaves server deleted messages untouched in the mail conversation
view, even when the folder is synced manually.

This patch adds "NOT DELETED" to the IMAP search command, when searching
for mails in a given date range.

Change-Id: I49e4adfcab9a1de1d1baa4700462a82df651f3cb
2015-10-18 14:02:23 -07:00
Paul Westbrook bb68c13afa Changes to support smaller email tombstone apk size
This reduces the tombstone down by 100K

A follow-on cl will remove the unused resources from the tombstone build

Bug: 17414014
Change-Id: I5d38811b17a5273ec726e750ab123e10e36cee04
2014-09-16 13:59:07 -07:00