One thing that bothers me regarding the new ImapStore is that there is no
tests to verify if the way how getImapId() uses a vendor policy hasn't changed.
This part is hard to test with a real vendor policy, and it can easily be
overlooked even if it's broken.
This CL offers ImapStoreUnitTests a way to test the interaction between
getImapId() and a vendor policy.
Also fixed a bug in VendorPolicyLoaderTest where it assumed the test apk
package name is "com.android.email.tests", but it may actually be
"com.google.android.email.tests" now. (Broken since the test makefile
used inherit-package.)
Change-Id: I8feb616ea28cb5cae5b4fba57e363771014ac599
Merge commit '1e7009c89e7e9aa7b2434ea4dac9a998c03ac373'
* commit '1e7009c89e7e9aa7b2434ea4dac9a998c03ac373':
Work around problem w/ large CalendarProvider2 transactions
Merge commit 'b2422f28d0897f9795e698c2aaba68156e794cbd' into gingerbread-plus-aosp
* commit 'b2422f28d0897f9795e698c2aaba68156e794cbd':
Work around problem w/ large CalendarProvider2 transactions
Merge commit '7a358316ae1c52fadf7ce8470fc5d257d1a71eaa' into gingerbread
* commit '7a358316ae1c52fadf7ce8470fc5d257d1a71eaa':
Work around problem w/ large CalendarProvider2 transactions
Merge commit '7a358316ae1c52fadf7ce8470fc5d257d1a71eaa' into froyo-plus-aosp
* commit '7a358316ae1c52fadf7ce8470fc5d257d1a71eaa':
Work around problem w/ large CalendarProvider2 transactions
Merge commit 'a3b1814284a059f7728410eddb84986022d34685'
* commit 'a3b1814284a059f7728410eddb84986022d34685':
DO NOT MERGE - Revert workaround for KeyguardLock problem
Merge commit 'a3962dc7cf7df3ed7f135bdd4f6b934f75b51ee4' into gingerbread-plus-aosp
* commit 'a3962dc7cf7df3ed7f135bdd4f6b934f75b51ee4':
DO NOT MERGE - Revert workaround for KeyguardLock problem
Merge commit '572c06f91be8c809b8978d985259564f88c6f212' into froyo-plus-aosp
* commit '572c06f91be8c809b8978d985259564f88c6f212':
DO NOT MERGE - Revert workaround for KeyguardLock problem
Merge commit '572c06f91be8c809b8978d985259564f88c6f212' into gingerbread
* commit '572c06f91be8c809b8978d985259564f88c6f212':
DO NOT MERGE - Revert workaround for KeyguardLock problem
This reverts commit 3ee0cad5f5.
Because commit 284b62e1b8c3419bfd02c6fea5ba0a68146c06f8 fixes the underlying
conflict between DeviceAdmin policies and apps attempting to disable the
Keyguard Lock, this patch is no longer required.
Accounts with a server policy requiring a device PIN or Password will
now work properly.
Bug: 2737842
Change-Id: I533c27a01a8a331dc11a0cb84bcc78f48edf621c
* We're seeing binder transaction failures when we try to send more than around
1500 CPO's to CalendarProvider2 in a batch (the limit is related to memory
usage in binder transactions)
* When an event has A attendees and E exceptions in an event, we currently must
create A*E CPO's; this number can become very large and cause a binder failure
* The result of a failure is looping behavior, resulting in failed sync and very
much reduced battery life
* The workaround here is to redact all non-organizer and non-user attendees from
exceptions once we reach half of the maximum number of CPO's. This has been
determined empirically and is set to 500 CPO's in this CL
* We also reduce our sync "window" to 4 calendar/contact items per sync command
to help limit the potential size of our batch
* For later releases, we should reconsider this and see if something that is more
of a "fix", rather than a workaround, can be implemented
Bug: 2760514
Change-Id: I06ca1a1ae88c772342a9e46b5997c41678e95144
* We're seeing binder transaction failures when we try to send more than around
1500 CPO's to CalendarProvider2 in a batch (the limit is related to memory
usage in binder transactions)
* When an event has A attendees and E exceptions in an event, we currently must
create A*E CPO's; this number can become very large and cause a binder failure
* The result of a failure is looping behavior, resulting in failed sync and very
much reduced battery life
* The workaround here is to redact all non-organizer and non-user attendees from
exceptions once we reach half of the maximum number of CPO's. This has been
determined empirically and is set to 500 CPO's in this CL
* We also reduce our sync "window" to 4 calendar/contact items per sync command
to help limit the potential size of our batch
* For later releases, we should reconsider this and see if something that is more
of a "fix", rather than a workaround, can be implemented
Bug: 2760514
Change-Id: I2941b392ae1058a9ead8a79f0ac73f4eb345917d
Merge commit '3ee0cad5f5e21a24dbe43d21afaac1dd76a2059b' into froyo-plus-aosp
* commit '3ee0cad5f5e21a24dbe43d21afaac1dd76a2059b':
DO NOT MERGE Workaround for KeyguardLock problem
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