Commit Graph

91 Commits

Author SHA1 Message Date
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
Jorge Ruesga e0a547bb66 email: fix eas autodiscover
Change-Id: Ifaf5f757f7f844e49f0ac635b477fcbef4926293
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
2015-10-18 14:03:24 -07:00
Jorge Ruesga 598a070c27 email: support for auto-sync multiple IMAP folders
This enables to auto-sync multiple IMAP folders, not only Inbox. Default to Inbox only.
This changes relays in the syncloopback attribute to configure the folders to add to
sync process.

Change-Id: I8973cfd6ddec33446256bc8b48418558e27596b5
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
2015-10-18 14:03:22 -07:00
Jorge Ruesga 8b1818d4a8 email: add an option for delete the account
Change-Id: I0f0f2b7ea950d5154f90cd60261c6918b7ad36b7
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
2015-10-18 14:03:22 -07:00
James Lemieux 40236a8931 Display sync errors using snackbar and not as a TL footer
b/16463253

The FAB compose button overlaps the action button found in the TL footer
when network errors occur during sync. To avoid this overlap, the snackbar
is used to display these errors and they no longer appear as a TL footer.

In order to signal the sync error to AAC for display in the snackbar, the
Folder.lastSyncResult needed to be encoded in the manner that AAC reads.
This was not happening for POP/IMAP/Exchange accounts, so a large portion
of this change is encoding that value properly every place it is written.

To ensure the value is read/written properly everywhere, common methods were
introduced in UIProvider that do this work. UIProviderTest was also added
to ensure the read/write methods agree with each other.

Finally, the display of the "Load More" TL footer was updated to match the
latest spec.

Change-Id: I9d3ae1157f288f05b0fed4d1385858f6c9ebfbf9
2014-09-29 17:51:27 -07:00
Martin Hibdon ce6916b32a Don't allow disabling of the camera with managed profiles
Change-Id: I2e6085084682b04ef7973bc433214b5b3ab2da79
2014-09-25 13:48:11 -07:00
Martin Hibdon 51c653646d Put debug screen back into settings
There is still work to be done here:
* The debug setting is not persisted in Exchange, so if
the exchange service is killed, when it restarts the logging
will not be active.
* Nothing in Exchange actually does any additional logging
if this logging is turned on.

Change-Id: Ic578e6956f70dd47fba9b2895385312f71c47abf
2014-08-28 11:53:51 -07:00
Anthony Lee 8c65e50bfe b/17135753. Make sure to free ServiceConnection.
The only way that the ServiceConnection was not being freed is if
there was an Exception (other than RemoteException) being thrown
out of mTask.run(). Now the call to unbindService() is called
in a finally() block surrounding that block of code.

Change-Id: I597412233381894be76d3c8bdf99fc7d96794dc2
2014-08-20 14:08:47 -07:00
Martin Hibdon 30a5e1d461 Add copyright notice
Change-Id: I80e074196ca8cb6962d400a756c510c8e3105899
2014-07-14 12:10:20 -07:00
Martin Hibdon bb391e8018 Merge "Update IEmailService" into ub-mail-master 2014-07-14 17:08:38 +00:00
Martin Hibdon 7afbeee47e Update IEmailService
Add version support
Change deleteAccountPIMData to deleteExternalAccountPIMData.
Data kept inside the EmailProvider can be deleted from within
the Email app. Only external data (e.g. contacts and calendar)
need to be deleted by the service which has protocol specific
knowlege.

Change-Id: I875d3051d0cfdbaf52775ec20eb114a345894a93
2014-07-11 15:49:45 -07:00
Tony Mantler 8c03e2af9f Remove direct entry points to AccountSettings
b/16240332

Change-Id: I9bc3f9a2e0b7faa4d8875a9ac7d6d585a65d9733
2014-07-11 21:34:55 +00:00
Martin Hibdon 1d8fd9c054 Add communication class for HostAuth
We want a separate class for communicating HostAuth objects
to and from IEmailService. The issue is that the HostAuth object
was being used for both to and from the database, and to and from
IEmailService. This is dangerous because The Email app may change
out of band with the Exchange app, and may need to change the
format of HostAuth. This bit us before when adding OAuth.
Now communication to IEmailService is done using HostAuthCompat.

Change-Id: I2fb8c2bd8158f58a7bb9bc3dc83a7936948c718c
2014-07-07 15:08:52 -07:00
Martin Hibdon fb2a3a2f77 Update IEmailService
This is not yet finalized, but it's needed to fix push syncs
on exchange.

Change-Id: Iaff20aa0bdea9685ef6603de1f861d58fbab6ff1
2014-06-18 14:19:34 -07:00
Martin Hibdon 163323294e Change IEmailService.sync to have two different forms
Change-Id: Id8e770154d6116b02746cbdfb8c7cdc9358398de
2014-05-30 14:49:47 -07:00
Martin Hibdon c5f5a14ae9 Revert "Get rid of deleteAccountPIMData from IEmailService"
This reverts commit cf2178c4fa.

Change-Id: I9b05dd7a29a2d2edf64529ca28e2305737a43115
2014-05-21 20:41:37 +00:00
Martin Hibdon cf2178c4fa Get rid of deleteAccountPIMData from IEmailService
This doesn't need to be part of the service because the
implementation doesn't need to be different between any
of the different protocols.

Change-Id: Ifddf16dd3ccaf397029f08f6d4283d9a5630f717
2014-05-21 12:18:29 -07:00
Anthony Lee bca4f9fcfb Service intent's package matches the content provider's.
b/14596165. When setting the package of the service intent,
query the app that implements the Email content authority since
that is the same app that should handle the intent.

Change-Id: I29a34a056516edda78acb83b9c89547ca0dc5ca1
2014-05-11 00:47:44 -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
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
Anthony Lee 6ef1621f44 In 4.4 unbindService can return other RuntimeExceptions outside of
IllegalArgumentException.  Make sure we catch it.

This fix comes from Motorola 0007-IKXREL1KK-3886 but part of that
patch was reverted because we already had found and fixed the
other problem.

Change-Id: I0b6aa1f91e7d2fa4dfc3af5ff590781c8812c14e
2014-02-12 14:08:40 -08: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 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 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
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 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
Martin Hibdon 24bb2dabd9 Kill the process when an account is deleted.
b/10653370
This prevents NPEs if a serviec happens to still be running
when an account is deleted.
This mirrors a similar pattern in the gmail app.

Change-Id: I6fd8ae5ffe41580df0a321ec22535403e3f32eee
2013-09-12 18:21:18 -07:00
Paul Westbrook e4ac06080b Don't use implicit events
Bug: 10189773
Change-Id: I4579f2e465bd23b8ab4cdf291bfbe80cf6518328
2013-08-28 14:31:09 -07:00
Yu Ping Hu eb190a8d9d Don't crash when the policy service is unavailable.
This isn't a great situation -- it suggests the PolicyService
is having some sort of RemoteException -- but when it happens
we should just treat it the same as if the policy is not
enforced.

Bug: 10315113
Change-Id: If2fbe1648a5c6f3df13cef02c8dc5bc6e858f2d9
2013-08-14 10:46:07 -07:00
Yu Ping Hu 2075c97f60 Delete most of IEmailServiceCallback.
The old callback mechanism is deprecated, in favor of making
calls on the ContentProvider.

Bug: 9842867

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

Bug: 9989995
Change-Id: I8d0b466fe3bc2e4c651c309d4815cea201058d22
2013-07-24 16:07:33 -07:00
Yu Ping Hu 9a1f00bee4 Change deleteAccountPIMData to take emailAddress, not id.
By the time the remote call actually runs, the account
may be deleted from the DB, so the account id is likely
useless.

Bug: 9021105
Change-Id: If28b4b8c4b5c52be35c6ff68b326c4ea28d7f7b4
2013-07-19 18:42:43 -07:00
Yu Ping Hu d5acf0bbc0 Explicitly pass a callback when loading attachments.
This is part of moving away from the explicit setCallback,
which either has race conditions or is very noisy, or both.
(Each IEmailService call that wants callbacks should just
pass the callback explicitly.)

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

Bug: 9735207
Bug: 9842867
Change-Id: If8cf69ffe82f3544ace9e58b1db5a183f38d038a
2013-07-15 21:54:02 +00:00
Scott Kennedy 1b8e0fa23f Clean up a bunch of warnings
Bug: 9565838
Change-Id: I5e95562bbf463f057cbcc4a9884427a774473b45
2013-06-25 15:34:32 -07:00
Yu Ping Hu 21b2522d7f Remove auto sync windows.
Also includes other DB upgrade code.

Bug: 8668336
Bug: 9226612

Change-Id: Id9664fd8cda466ec34862a793e41cbcce78efb4c
2013-06-14 18:26:42 -07:00
Scott Kennedy 560bfadc31 Unify LogTag
There is now only one LogTag class. The static initializer of
GmailApplication (existing) and EmailApplication (new) will now set
the log tag to "Gmail" and "Email", respectively. Up until that code
is run, it will be "UnifiedEmail".

"setprop log.tag.Gmail VERBOSE" (or .Email) will trigger all logs to
be printed as long as they go through LogUtils, regardless of what tag
is used by that individual log. This lets us still turn on logging
everywhere in one command, but also lets us use more descriptive tags
(like the class name).

And since we no longer have three com.android.mail.utils.LogTag
classes, builds will be much easier.

Also, we now use LogUtils everywhere.

Change-Id: I55f1c7a66ce50ead54877a13e40256422a56dc39
2013-06-05 20:06:15 -07:00
Andrew Sapperstein 91973256c2 Moved code out of emailcommon to UnifedEmail.
This CL is mostly just deletion since the new code
is in a new project.

Change-Id: I4aee519187a6ed7514c97d2a7a85ed29ea29d25f
2013-05-31 16:28:51 -07:00
Yu Ping Hu c28347552e Handle redirection during validation.
This allows the validator to tell the app that
it should use a different host.

Change-Id: Ie42c32aa7aea83e4d95d2b82b88225036b2407a9
2013-05-23 15:11:25 -07:00
Yu Ping Hu 0d5e21d0fc Read protocol version from validation bundle.
Exchange used to just re-check version on first sync.
Version is known during validation so might as well use it.

Change-Id: I004fe671a1ad30a7cfe0a0659b74b20ee2136771
2013-05-17 17:30:43 -07:00
Yu Ping Hu f55972ecd8 Add more sync status callbacks.
Change-Id: I77e8b122474d5240ad5aaed7556471263a05e6de
2013-05-08 10:42:31 -07:00
Yu Ping Hu 71737836e6 Add call for sync status updates to UI.
Change-Id: Ib91284b423cf88e8feac3b40d13627d26ccc7de7
2013-05-02 18:53:17 -07:00
Yu Ping Hu 9e7f5a2a33 Use system SyncManager for Exchange.
Change-Id: I77e4e75c94c532d22a28cf97e6f55f1259b8bdde
2013-04-25 14:03:00 -07:00
Yu Ping Hu 7dd26feaea Merge "Improve mailbox sync and load more." into jb-ub-mail-ur9 2013-04-11 21:18:47 +00:00
Yu Ping Hu 17d5bbf768 Improve mailbox sync and load more.
- Update syncTime for IMAP and POP whenever we sync.
- Change load more to simply include the delta in the RPC
  rather than using the visibleLimit column.
- Add a query to get the message count for a Mailbox.
- Refactor code for updating totalCount and determining
  the new message count when syncing.
- Remove dead code from Mailbox.
- Remove uses of visibleLimit from code.

Note that visibleLimit and messageCount in Mailbox table are
no longer useful and will be removed in a later change.

Bug: 8579767
Bug: 8523146
Change-Id: Ieb67e3b6f1c82c3b21b972c5a1e557cd75dc21db
2013-04-11 21:06:08 +00:00
Paul Westbrook 69ef2b22ff Fix TempDirectory initialization
The proxy for local services were not intializing the TempDirectory.

Also, move the TempDirectory initialization out of the try/catch block.
Otherwise if Device.getDeviceId threw an exception, the temp directory
wouldn't be initialized

Bug: 8531456
Change-Id: Iea34e0b03203d6c6fe6e5d1ae9902d081bd90c27
2013-04-11 00:39:56 -07:00
Yu Ping Hu 4da3641292 Clean up ServiceProxy.
ServiceProxy had more layers of threads than needed,
and also had out of date comments.

Change-Id: I0b9de4eeb9ba4b84b8e058279adff5172941a8d0
2013-02-28 14:33:09 -08:00
Scott Kennedy b34608228f Move notifications to UnifiedEmail
This involves redoing the persistence model, to split general,
account, and folder settings into separate SharedPreference stores.

It also requires some preferences to be moved into UnifiedEmail.

Depends on Ibe2e3f93ec164370535ffc5f5b2409544cc8d36d (UnifiedEmail)

Change-Id: Ie6ec389b5b5d2e7ab1b299d0877811ae716526e2
2013-02-08 09:48:22 -08:00
Marc Blank 74c79a5043 Modify intent names
Change-Id: Iad8b4842056a7f553363f9af47e65665c2b26a5d
2012-09-10 17:18:32 -07:00