Commit Graph

58 Commits

Author SHA1 Message Date
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
Marc Blank 6e5bccf2c9 Use correct attachment provider authority
* Make sure new code works with old Attachment rows

Bug: 7130972
Change-Id: Ia5d258930f39266517eead535a92bb4380fdb594
2012-09-09 09:32:14 -07:00
Marc Blank f419287f22 DO NOT MERGE: Move emailcommon2 sources to emailcommon
Change-Id: I06df7e467cd2e0117df8b8db3ddc6ff9da13f1c7
2012-06-28 11:15:06 -07:00
Marc Blank 03cd72805d Revert to old Email app
* These are the last sources in the ICS-MR1 tree

Change-Id: Ida4651bddd92a06a518d00f3e1f275ab3a80c8ae
2012-04-25 13:58:23 -07:00
Marc Blank 3408ad1113 Use proper column in loadAttachmentCallback
Bug: 6138389

Change-Id: Icd9b3454670d29e1fbd1dfc309700eb1643cc9ee
2012-03-08 21:18:04 -08:00
Marc Blank 97e4651c45 Repair brain damage
Change-Id: I1f2367476f78c5cd78d8a59e099debabceb95e3a
2012-03-08 19:48:11 -08:00
Marc Blank 420e97f0f8 Support attachment commands from UIProvider
Change-Id: Ib457808bdb424275c0abe6e1d86e3b9d33406780
2012-03-07 14:57:19 -08:00
Marc Blank 4f813fb129 Convert POP3 to service
* Remove MessagingController and (almost all of) MailService

Change-Id: I8953b58b237de6a71fda770f1727bd94081fec55
2012-02-16 10:27:00 -08:00
Marc Blank c84467afe1 Start of IMAP conversion to Service architecture
* Handle startSync and loadMore
* Use SyncManager rather than MailService for periodic sync
  and upload sync
* First of many CL's to disentangle sync from UI
* Note that the large majority of this CL is a refactoring
  of IMAP specific code out of MessagingController and into
  ImapService; MessagingController will eventually be
  removed entirely from the app, as will much of Controller

Change-Id: I13546d0694479b33cf93c25920dedc1d38227f6c
2012-02-13 11:04:56 -08:00
Marc Blank ecaa977413 If we're stopped, make sure watchdog alarm is also stopped
Bug: 5647625
Change-Id: I33e94107f2d6e4a38a5a221df72ed83596ca7c54
2012-01-25 14:59:54 -08:00
Marc Blank faf9ecc992 Enforce "auto-sync app data" setting for POP3/IMAP
* We were using the deprecated ConnectivityManager for this; we should now be
  using the setting in ContentResolver
* Also, remove broadcast receiver code that is no longer relevant

Bug: 5405352
Change-Id: I985a95071aea92d235a2708925f775b817ba2328
2011-10-03 13:05:24 -07:00
Ben Komalo 32bed4bb8e Fix unit tests.
- make attachment download service injectable
- fix assertions for account manager account checks
- update message compose ID's so they're consistent on tablet/phone

Bug: 5198343
Change-Id: I9976f5b9e5590dd61fb0a62937d3f9203fefe236
2011-08-24 10:24:42 -07:00
Marc Blank a9f1631fb8 Remove STOPSHIPs in Email/Emailcommon
Bug: 5142183
Change-Id: I1f6e31bfd2e7c32bdd7886e54b02fd4640a96e6f
2011-08-10 16:43:20 -07:00
Marc Blank 433b0ed9fe More whack-a-mole in AttachmentDownloadService
Bug: 5115008
Change-Id: I6e5236e08331cfd6a9a11868d97bf5caaf68f6fe
2011-08-03 13:28:01 -07:00
Marc Blank 41c63a05eb Catch NPE in AttachmentDownloadService
%$!@#*&%

Bug: 5055519
Change-Id: Ie155c8d0f9931b51613f7d77e4545531bc148964
2011-07-27 15:53:51 -07:00
Marc Blank cb2f0a8bb9 Ignore watchdog alarms for stopped service
Bug: 5055519
Change-Id: I35352364f3f2842932ad40e47d70646bb6d42349
2011-07-26 09:59:10 -07:00
Marc Blank 90a4811551 Fix NPE in onStartCommand
Bug: 5041436
Change-Id: Ib7462e5c8cb040b7526d9a655c5ab3f41cd159b8
2011-07-18 09:49:52 -07:00
Marc Blank b2a8c2ce4c Start/stop AttachmentDownloadService as needed
Bug: 5033646
Change-Id: Ic0e75b28d0d8d5665c3f3ca864a9532fee05df8c
2011-07-17 18:06:20 -07:00
Marc Blank f5418f1f93 Move Account into its own top-level class
Change-Id: Ide7c991b7d4d418dbe17164421425bf898ba64ee
2011-06-13 15:37:22 -07:00
Marc Blank 2f6cbb021c Fix a race condition in which an Attachment might be wrongly deleted
* This is a serious bug dating back to the first Honeycomb release
* It was possible that a newly created Message could not yet be
  committed to the database when the AttachmentDownloadService
  tries to download one of that message's attachments.
* ADS, when it sees that the message (apparently) doesn't
  exist, deletes the Attachment (it appears to be orphaned)
* The effect is that the user never sees one of the attachments
  in a message.
* This bug has been reported externally
* The fix is simply to check for the message's existence before
  deciding to delete it (this check will always work properly)

Bug: 4409692

Change-Id: I106ed2fe88d2435ad7a462fced5cb307c2559fd6
2011-05-11 17:27:37 -07:00
Marc Blank 973702b30e Only allow prefetch when on a WiFi network
Bug: 3515125

Change-Id: I0814ea20b1fc73807667e7f9531c1ea065bfa803
2011-03-07 22:01:34 -08:00
Marc Blank 81273dfcee Fix deadlock issue in AttachmentDownloadService
* When a connectivity wait was added to processQueue, I neglected
  to consider that a lock was held during this time
* The fix is to move the check for connectivity out of processQueue

Bug: 3500702

Change-Id: I646cf899ff895d9838612e89b15b66f1084840b1
2011-03-01 13:43:44 -08:00
Marc Blank dc78a769fc Email split, part dix
* The coup de grĂ¢ce for Exchange in Email
* Remove Exchange bits from AndroidManifest
* Update Android.mk to create static jar for emailcommon
* Delete all com.android.exchange files
* Delete all exchange-only strings
* Change loadAttachment service method to take only attachment id and
  background flag
* Add code to AttachmentProvider.openFile() that opens an output file
  for attachment writes
* Make sure deviceId is determined in Email app (not Exchange)

Bug: 3442973
Change-Id: I775600252fd121f474d51cb26fefbfcc50e387af
2011-02-25 10:46:16 -08:00
Todd Kennedy ffe6ef342a fix UnsupportedOperationException in tests
We're using the mock context to prevent modifying the real databases. However,
we need the real context to create intents. Use the real context in the few
places we must use it.

Change-Id: Icb8d289239218921c0b4b5c93ac7983830d90394
2011-02-23 14:51:45 -08:00
Marc Blank 3a5c1fb274 Email split, part neuf: Setup, logging, attachment glue
* Make "Exchange" option in account setup depend upon availability of the
  Exchange EmailService
* Make presence of Exchange logging depend upon availability of the
  Exchange EmailService
* Make AttachmentDownloadService use service rather than ExchangeService
  class
* Move SSLUtils to emailcommon/utility
* Move account manager type defs to emailcommon/AccountManagerTypes
* Update proguard.flags
* This is the penultimate CL for the Email package itself; the next CL
  creates a clean, SDK-compatible Email application

Bug: 3442973
Change-Id: I9162cf5fa6b5a043ded0fdd1e25fd3ce5948ad8f
2011-02-14 16:08:55 -08:00
Marc Blank 31d9acbf06 Email split, part huit: Refactor constants, clean emailcommon
* There are three pieces to this CL (sorry):
  1) Move and/or rename some constants into emailcommon
  2) Move Utility to emailcommon, moving the few UI
     related utilities back into Email (FolderProperties
     and UiUtilities)
  3) Remove all references to resources from emailcommon
* The three pieces relate in that, between them, they allow
  the emailcommon static library to compile cleanly

Bug: 3442973

Change-Id: Ic5e3abaa2a1b36999e0b6653c6c2134ea1bd544f
2011-02-14 12:18:10 -08:00
Marc Blank a7bc0319a7 Email split, part six: EmailContent
* Moved EmailContent to emailcommon

Change-Id: Ib3db1bfcfe74554c0e5afd3cfce6d72f26e9aeb9
2011-02-10 19:44:29 -08:00
Marc Blank 8a57469460 Email split, part trois: AccountService
* Create AccountService.aidl and AccountServiceProxy in emailcommon
* Implement AccountService in email
* Use AccountServiceProxy in Exchange for account reconciliation,
  notifications, etc.
* Move sync window constants into emailcommon
* Split attachment provider utilities and constants into emailcommon

Bug: 3442973
Change-Id: I89dce28b799b193243c07774dab65d830ae62775
2011-02-10 14:32:01 -08:00
Marc Blank 0d4fc55861 Email split, part one: EmailService
* Create emailcommon package
* Move EmailService classes to emailcommon package
* Change references to aidl's to emailcommon package
* Add getApiLevel() command to EmailService

Bug: 3442973

Change-Id: Ic7d2115363cdff6ebb86c46650b0a5b2109b1c72
2011-02-10 13:10:38 -08:00
Makoto Onuki 9c44430690 Fix AttachmentDownloadService for remove-exchange script
Now the source at least compiles fine.

Change-Id: I329ad08f81fd6ab23f28dd30023fe3e781ccc4fc
2011-01-28 11:22:51 -08:00
Marc Blank ed9938cd9c Protect against threading issues in AttachmentDownloadService
Bug: 3391148
Change-Id: I513b5678815db262ea5660661336432f1e203c9e
2011-01-26 16:04:28 -08:00
Makoto Onuki 2d0e44f201 Fix NPE in AttachmentDownloadService
Initialize mConnectivityManager before starting the thread.

Bug 3389701

Change-Id: If616721ad3b3bec81c5d6920f4a5d91b06f937fb
2011-01-25 15:30:15 -08:00
Marc Blank 3ef8f54bae Prefetch respects "background data" setting and waits for connectivity
Bug: 3384997
Bug: 3384994
Change-Id: Id8338650b69666f2996837324e27c2e98c9261fe
2011-01-24 18:39:50 -08:00
Todd Kennedy 751e4b2d95 Prevent auto-download of attachments not in an inbox
When creating the list of attachments to be automatically downloaded in the
background, exclude any attachments that are not in an inbox. Also added unit
tests to ensure the query URIs behave as expected.

NOTE: This is a partial fix for general background attachment downloading issues

bug 3373982

Change-Id: I13ef56cd280c028fa966ab9e655acce28b0b9b91
2011-01-24 13:43:14 -08:00
Todd Kennedy 819db01ead Limit attachment background download attempts
Do not retry downloading attachments infinitely. After some number of failures,
black list the attachment and move on. The black list is not persisted, so,
restarting the app will again try to fetch the attachments. In this way, any
transient network failures will not permanently affect the ability to download
attachments in the background

NOTE: This is a partial fix for general background attachment downloading issues

bug 3373982

Change-Id: I7f3ad9667ebebb95fbba95278b62bf40c5fce67c
2011-01-24 10:19:46 -08:00
Todd Kennedy f92dd2bf3e Don't display toast for background download failures
When downloading attachments in the background, do not display any errors
on the display.

NOTE: This is a partial fix for general background attachment downloading issues

bug 3373982

Change-Id: I874ed902bde293303e10308f38b992b2bb15b6aa
2011-01-21 15:17:29 -08:00
Marc Blank 2ac1833943 Delete attachment if there's no corresponding message
Bug: 3372440
Change-Id: I5c3653c5f27e0aa7bab52ca0d979e14bb6bafc34
2011-01-20 20:32:56 -08:00
Marc Blank 475c20d3a8 Implement checks before performing background attachment download
Bug: 3339007
Change-Id: I36a8359f3478c37b2ccd6a0cf0381569c592061a
2011-01-19 19:20:38 -08:00
Makoto Onuki 36cc9c18ed Fix NPE in AttachmentDownloadServiceTests.testDownloadSet
Bug 3353834

Change-Id: I5cf475ff174bffce80a435c80b1fd85c0be146e9
2011-01-14 11:47:26 -08:00
Marc Blank f6fe21b483 Merge "Check download request before trying to remove it from the queue" into honeycomb 2011-01-11 13:22:39 -08:00
Marc Blank 782c21e953 Check download request before trying to remove it from the queue
Bug: 3312633
Change-Id: I443d9a8f786f93c7cd72b6b96ea838bf0d05f4d4
2011-01-11 11:45:36 -08:00
Marc Blank 33799ad2d0 Remove STOPSHIP from AttachmentDownloadService
Bug: 3335071
Change-Id: Ia6a8e2e7378510db234c4ec5164cb5ef39c529d7
2011-01-09 18:30:24 -08:00
Marc Blank 7fbcefff7d Respect user's background download preference
Bug: 3312462
Change-Id: Ibd77b8de8782c4681ed122ac2f30374ca695e0ef
2010-12-30 00:05:15 -08:00
Marc Blank edb05ca5ee Harden AttachmentDownloadService; fix storage calculation
Bug: 3292720
Bug: 3286634

Change-Id: I378aac369ee8317c0c41b1f021a3731b81bcb380
2010-12-17 11:28:18 -08:00
Marc Blank 75a873be84 Implement prefetch of IMAP/EAS attachments
* Load attachments in the background for IMAP/EAS messages
* Download an attachment from account X if:
  1) 25% of total storage free
  2) Attachments for X use < 1/N of 25% of total storage, where N is
     the number of AccountManager accounts
* Add accountKey to Attachment table for performance

Change-Id: I913aa710f34f48fcc4210ddf77393ab38323fe59
2010-12-13 15:32:57 -08:00
Marc Blank 69fc25244b Move download cancel logic into helper
Bug: 3255707
Change-Id: I7f92bd1bb90a4430426123551075746ba9d4af85
2010-12-08 16:57:59 -08:00
Marc Blank 3bbc690600 Add watchdog to AttachmentDownloadService
* Detect attachment downloads that have stalled and restart them
* Catch a couple of cases in which we weren't sending callbacks

Bug: 3122242

Change-Id: Id2bfd3b26182004b301cf8665f4feb6e62b98b73
2010-11-30 10:16:05 -08:00
Marc Blank fdc41d4ffc Delay appearance of "stop" button when loading attachments
Bug: 3082804
Change-Id: Ib8b0fcec36a7303b2094bd0e49645d11aa2ff2db
2010-11-01 13:48:53 -07:00
Marc Blank b961c78ff4 Harden AttachmentDownloadService
* It's possible that endDownload will be called for a request
  that has been dequeued.
* Harden endDownload against this eventuality, so that we clean
  up properly without throwing exceptions

Bug: 3142618
Change-Id: If61136ed1ea972248fc5f9388beaaf84754f9931
2010-10-28 17:21:28 -07:00
Marc Blank eed42e83ab Cleanup for dump() in AttachmentDownloadService
Change-Id: Id875d3278953ecb3a98ab8b1d290f3883e974c4f
2010-10-27 08:59:13 -07:00