Merge commit '3ee0cad5f5e21a24dbe43d21afaac1dd76a2059b' into kraken
* commit '3ee0cad5f5e21a24dbe43d21afaac1dd76a2059b':
DO NOT MERGE Workaround for KeyguardLock problem
- Controller.Result is now a class rather than an interface,
so subclasses don't have to implement empty methods.
- Replaced Threads with AsyncTasks, which is more light weighted
because it uses pooled threads.
- Removed the Result argument from Controller's methods.
These argumetns weren't used, except in serviceCheckMail.
Regarding serviceCheckMail, the new code behave differenly from the old code.
If there's already listeners registered when it's colled, they wouldn't get
called in the old code, but they will in the new code.
But I think this difference is okay because that's how it works for
POP/IMAP accounts.
Change-Id: I37a857ce7c089c1a411cb7f1fcfcb72c9f5fd2a6
This fixes the following exception.
java.lang.UnsupportedOperationException
at android.test.mock.MockContext.getApplicationContext(MockContext.java:82)
Bug 2725552
Change-Id: Iaca177defe5f5e836211c58270379da056fa64e0
* Moves all list-related implementation to new MailboxListFragment
* One item that remains to be done is to remove the dependency on the
activity for handling context menu (longpress) in the list.
Change-Id: I7b5769d9d81fb685cf480de3d3e18b4e1c078f2d
* The device policies that enforce the use of a device PIN or password
can be sidestepped by apps that implement KeyguardManager.KeyguardLock
* This renders the policies unuseable
* To prevent this, the email app now scans for any packages holding the
DISABLE_KEYGUARD permission. The existence of any non-system app
with this permission will put all security-enabled EAS accounts into
a security hold, and post a dialog describing the problem.
* The user must uninstall any such app(s) in order to sync their EAS data.
Bug: 2737842
Change-Id: I4c96d76b12d9242b5c755dd60d7578a825fae597
- Removed Handler.
- Refactored FindMailboxTask so it only does DB access on a worker thread.
(Moved the actual task out of doInBackground)
- Removed unused imports, which I forgot when I extracted the adapter.
Change-Id: Ib76ce2ab7901dd39d2ed51d8a61d7be9df55b337
AccountFolderList, MessageCompose and MailboxList.
Also,
- ControllerResultUiThreadWrapper now takes a Handler instead of an Activity.
So that it can be used from a Service as well.
- ControllerResultUiThreadWrapper.getWrappee() to get the wrapped object.
We'll eventually need this.
- I'll work on MessageList too, but the might be relatively
large, so I'll do that in a separate CL
Change-Id: I281d88d5af1834248ec3f7463f0df3f5635149be
- This is to make sure we're not touching any ImapResponse that's
already been destroyed.
- I didn't add "is it already destroyed?" check to them
(except for ImapTempFileLiteral), because it can be costly.
Just let NPE be thrown.
Change-Id: Idc7b88c4844727922841cbad8a106bf781181d45
Unfortunately it's hard to write tests for this change, but at least
all tests pass with Idc7b88c4.
Change-Id: If0335a848dfcc23aecea22c21b2cce73dac7ff6f
- Replace string literals in ImapStore with constants.
- Simplifies ImapStore.en/decodeFolderName
- Mix cases in the test data to test for case-insensitivity
Change-Id: I88424357227bcf78528df5e6a1c4ba45d54cc65b
- Merged all three BroadcastReceivers into one.
(Changed class name because old ones may have been disabled.)
- Use IntentService to perform the tasks in a worker thread.
Note the new receiver will never be disabled. We always need to start
exchange.SyncManager.
Bug 2722155
Bug 2416929
Change-Id: I8241880fc1ee38d85dcdca7e1d46fc2f6b2d375b
Part 1: MessageView
- It's an attempt to get rid of Handlers from Activities, and
reduce the amount of code that runs run a BG thread in them.
- Introduced ResultUiThreadWrapper, which wraps another Controller.Result
and make callbacks get called on the UI thread.
- It'll make the logic in ControllerResults cleaner and more straightforward.
- ResultUiThreadWrapper isn't too memory efficient because it allocates a
Runnable even if the wrappee's target method is empty.
However these callbacks don't get called often, and optimizing it would
make code more complicated, so I don't think it's worth optimizing.
- Now we can assume all the methods in activities except
AsyncTask.doInBackground runs on the UI thread, with some special exceptions
like MediaScannerNotifier.
In my previous abandoned change, I named methods that can run on BG threads
'*OnUiThread', but now there's no need to do that.
This also means we can minimize the use of synchronizations.
Change-Id: Ia6d9d2a266ebf5a4b23d712e9eaea3272adbd2a6
- Almost completely re-wrote ImapResponseParser layer
- We no longer use simple ArrayList and String to represent
imap response. We have classes for that. (Type safe!)
These classes are also NPE-free.
(which isn't necessarily a good thing, though)
- A lot of clean-ups and fixes in ImapStore.
- More tests for ImapStore.
Now ImapResponseParser moved to com.android.email.mail.store.imap.parser,
but inside, it's 99% new code.
This CL introduces many new classes, but most of them are small classes
to represent the IMAP response.
Problems that this CL fixes includes:
- Special characters in OK response
- Handling BYE response
- Case sensitivity
- ClassCast/ArrayIndexOutOfBound/NumberFormatException
- Handling NIL/literals at any position
Bug 2480227
Bug 2244049
Bug 2138981
Bug 1351896
Bug 2591435
Bug 2173061
Bug 2370627
Bug 2524881
Bug 2525902
Bug 2538076
Change-Id: I7116f57fba079b8a5ef8d5439a9b3d9a9af8e6ed
* Extract AccountAdapter from AccountFolderList
* Use callback instead of hardcoded launch of MailboxList
* Unit tests
Change-Id: Icafce1ef73a99fb61985c649620440656f9b51a3
* To avoid having to use a mock deviceId with FolderSync in validation, we now
simply use the real deviceId with the correct SyncKey ("0" for a new account,
or the actual sync key if the account already exists)
* Rework utility code that finds existing accounts
* Write unit test for findExistingAccount
Bug: 2589243
Change-Id: Ia532b2e209aec3aa01ca06617b4da78c3d986b32
* Three format strings had multiple replacement tokens, but the ordering
information was missing.
* In five languages, the translations reverse the order, and the formatter
crashes (because of types mismatching).
* This patch adds in the ordering information where needed
Bug: 2719864
Change-Id: I084e9c9ddab54901a5142710e8ef986223902c17
* Support required protocol changes
* Handle new security policies based on current device capabilities
Change-Id: Id1d629d41d957911344e6c503d28418f5e7e1386
Merge commit '77e2161559467ac94ffdbaa2d51716354741ae17' into kraken
* commit '77e2161559467ac94ffdbaa2d51716354741ae17':
Handle case of null organizerEmail in changed event
Merge commit '8c742a4c65e1ff2618e1005803edb65a42994fb6' into froyo-plus-aosp
* commit '8c742a4c65e1ff2618e1005803edb65a42994fb6':
Handle case of null organizerEmail in changed event
* A recent change assumed that organizerEmail couldn't be null while
an event was being added. However, there is an unusual case in
which it CAN be null, and this CL handles that case
* Regression caused by: SHA 7f448dcd47
Bug: 2719254
Change-Id: Idb8fc79c898bcd2e53fcc8b3e42d0ba67ba762fa
Merge commit '17c8b3388c1aceb5a4886f7d783e1db1913d9d05' into kraken
* commit '17c8b3388c1aceb5a4886f7d783e1db1913d9d05':
Remember to store modified organizerEmail
Merge commit 'b6a08f68d7c49835fffed0719e99c13b50fa525c' into froyo-plus-aosp
* commit 'b6a08f68d7c49835fffed0719e99c13b50fa525c':
Remember to store modified organizerEmail
Merge commit 'd3951041f613008dcbd3cd4b3ddebdad5ccab806' into kraken
* commit 'd3951041f613008dcbd3cd4b3ddebdad5ccab806':
Limit the number of attendees in a synced event
Merge commit '7f448dcd470ac509a85368a84f5a55c346ae7e70' into froyo-plus-aosp
* commit '7f448dcd470ac509a85368a84f5a55c346ae7e70':
Limit the number of attendees in a synced event
* If there are over 50 attendees in an event, we only store the
organizer as an attendee (the rest are redacted) and we set
the hasAttendeeData flag to 0
* If the user is the organizer, we reset the owner of the event
to a bogus address, which causes the UI to prevent edits to
the event (we can't upload without losing all of the attendee
information on the server). We also prevent the event from ever
being uploaded (belt & suspenders)
* If the user is an attendee, we allow changes to be uploaded
(this would be attendee status and free/busy), but the list of
attendees on the server is removed.
* We also mark events with redacted attendees, even though we don't
use that information currently. In a future version, however,
we could use this to indicate the redacted state to the user.
Bug: 2709816
Change-Id: I2b44af59c598cedf906af12bf9b4eaf7484b9d20