Commit Graph

18 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 59553089b9 Don't throw a NPE when operating on a destroyed list.
Change-Id: Ie4ca1fdd55031efa56448bf0237d0edab51ea349
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
Martin Hibdon f0bbcd85ea Add additional analytics regarding our SSLSockets
b/18104622
There were some suggestions for additional info to log.
Now we also log the protocol being used, along with the
cipher suite, and whether or not we are accepting all
certificates (i.e. whether or not we are verifying
hostnames.)

Change-Id: Iad1fa4d2867d4a27830d54cc7fafcd0d32e0b23b
2014-10-24 14:46:33 -07:00
Martin Hibdon 93a9662d8d Add analytics to track of what cipher suites are being used
b/18001842
I do this in MailTransport, which is only used by POP and IMAP.
I can't log Analytics in SSLSocketFactoryWrapper, because that
is in emailcommon and would cause a circular dependancy between
emailcomman and UnifiedEmail.
This will not yet work for Exchange, because it gets its socket
indirectly through EmailClientConnectionManager, using a
SchemeRegistry. Still, it will be helpful to get this info for POP
and IMAP.

Change-Id: Ibb9d22c83c49d0ba5090295b5321ca6afb09e65b
2014-10-24 11:46:48 -07:00
Tony Mantler a2f1da2bdc Fix handling AOL's login rejection
Found while investigating b/18031180

b/18049329

Change-Id: I2c86449008fb5e89c84db1a0753b8a61f42305b9
2014-10-20 17:20:59 +00:00
Martin Hibdon 79cb83cad1 Set mailbox uiSyncStatus when IMAP and POP folders are created
b/17443087
Now for certain folder types, when they are first created,
the uiSyncStatus is set to NEEDS_INITIAL_SYNC. This prevents
us from displaying the empty state until after the sync has
completed.

Change-Id: Ib04c915f6972ecb75092dd50e90dee8647ee2f64
2014-10-14 15:52:58 -07:00
Martin Hibdon 601700a61e Get SSLSocketFactory from GmsCore
b/15721931
This follows an example pattern from GoogleHttpClient.
It tries to get the SSLCertificateSocketFactory from
GmsCore using reflection. If that fails, (because GmsCore
is not installed on the device) then it will fall back
to the platform implementation.
MailApplication sets a static object in SSLUtils that
allows it to get an externally created SSLCertifcateSocketFactory.
If this method is set, then it will use it, otherwise it
will fall back to the platform factory. This way there
is no reference to GmsCore in the AOSP email.

Change-Id: I0890fe4c3d79283fb98a4dc5a62a32efd320e52a
2014-10-02 10:54:52 -07:00
Martin Hibdon 99f9ead3ef Fix subfolders of the inbox.
b/17327099

Change-Id: I82f82a9bf2ceda73606471dc669253d2ac4ec0c5
2014-09-17 11:00:07 -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