summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Hook up exchange logging to the debug screenMartin Hibdon2014-08-281-1/+3
| | | | Change-Id: Ia4d5a1f0112762444a57f3b4e47f5771331960ee
* Add uses-sdk to test apkTony Mantler2014-07-021-0/+1
| | | | | | b/15937269 Change-Id: Ib56ed6d177a98c6a327f4be04151076d90f36c83
* Delete obsolete codeMartin Hibdon2014-06-0412-1339/+2
| | | | | | | | | | ExchangeService was only being used for GalSearch. That code has been moved EasService. Other services, EasAccountService, EasOutboxService, and EasSyncService are no longer used and have been removed, along with a bunch of other unused helper classes. Change-Id: I25c7e53896125818cfd6d3e3bf630ff671f142d1
* Remove unused CalendarSyncEnabler and testsTony Mantler2014-05-211-296/+0
| | | | | | b/15133133 Change-Id: I2ee6524e2091e694124df63aba621bb18592eb16
* Fix handling of encoded intsJay Shrauner2014-05-164-52/+23
| | | | | | | | Fix encoding of ints to handle ints with high bit set. Modify Parser to detect when it is decoding a run-on badly encoded int (ie, >5 bytes). Bug:14817987 Change-Id: I4a21b126d03e2e244b0fd4c4fb4821d165897ad6
* Fix nextTag for end of documentJay Shrauner2014-05-141-1/+1
| | | | | | | | | Change Parser.pop() so doesn't reset end tag we're currently trying to match in nextTag. Change END_DOCUMENT enum so no longer same as END tag so callers can tell them apart. Bug: Change-Id: Ie5bd3e6703e75ce9d8bee888e6e3fb9a124434f3
* Fix Parser crashes on unknown tags/pagesJay Shrauner2014-05-104-3/+251
| | | | | | | | | | | | | | Fix Parser so doesn't crash when sees an unknown tag on a known code page. Check for unknown code page and throw parse exception. Remove unused code. Make class variables private where unused outside class. Change tag stack to ArrayDeque from fixed size static array. Check for unsupported WBXML features: string tables, unsupported global tokens, and attributes. Throw EasParserExceptions for all parse errors so Exchange can catch them and not crash. Add unit tests. Bug:14651154 Bug:14673019 Change-Id: If71be29391466985eccff90db8601bbdfde2658b
* Fix crash on unset recurrence typeJay Shrauner2014-05-021-0/+8
| | | | | | | | Recurring event rule parser uses -1 for an unset recurrence type. Check for invalid recurrence type to prevent crash. Bug:14490734 Change-Id: I68de74d16cd4489d4235a9a3aea9c8ed0c4429dc
* Date parser utility helpers throw parse exceptionsJay Shrauner2014-04-301-10/+28
| | | | | | | | | Update to reflect API change to parseDateTimeToMillis and parseEmailDateTimeToMillis, which now throw ParseExceptions on malformed date strings. Bug:14279251 Change-Id: I74e015b81079b127ddba15f34c8b7e555099bd1e
* Fix some missed class renamesTony Mantler2014-04-151-2/+2
| | | | Change-Id: I53e36adb49b7ca4084a8c805db3099e1a51372f0
* Cleanup in EmailContentTony Mantler2014-04-141-1/+1
| | | | Change-Id: Icb51cda53b2ad9b1aac15631cf86b5696f3b8e3c
* b/11435875. Add support for fileAs when uploading new contacts.Anthony Lee2014-04-071-0/+190
| | | | | | | | | | | | | | When a new contact is created on the device, we do not push a fileAs up to Exchange and that causes problems when you view the contact via OWA to check the results. The challenge is to not push a fileAs if one was already created (i.e. the contact was created on the server). We handle this by actually syncing the fileAs from the server and being smart enough not to overwrite if it exists on the upload. Generation of the fileAs string is done in 1 of 2 methods. The first is to use the alternative display name stored in the RawContacts information for this contact. The fallback method is to generate a fileAs string using a combination of structured name fields and available email addresses. Unit tests are included. Change-Id: I957071da758801d2e5c2799fc1f0b4fdbe0b4e4d
* Add EasService & PingSyncSynchronizer.Yu Ping Hu2014-03-191-0/+36
| | | | | | | | | | | This is the first step to decoupling actual sync execution from the mail sync adapter. This change does not yet move to using the new service, it only adds the code and necessary changes to existing operations to be compatible with it. This change should not affect existing functionality. Change-Id: I80663c2bc216fdee44756d83fd567bc2c447e993 (cherry picked from commit 6c715246946dc4a7b7ca535dd9ff7f3cfc227c6d)
* Fix handling of display namesJay Shrauner2014-03-191-9/+9
| | | | | | | | | | | | | - create display name from email or phone if otherwise lacking a name - filter out results entirely lacking a name - query for larger than asked for result set for phone filter queries so can return requested number of results even with client side filtering of contacts lacking phone numbers - for email filter queries, filter out results without an email address Bug:12893832 Change-Id: I6168fb5bf9300b2e279c45ac9c0552451fc89296 (cherry picked from commit 4511cd31dc6cb0a3ef97661d72b4f2196b5b8fdd)
* Do not send extraneous tags when confirming a remote wipe. b/12921830Anthony Lee2014-03-191-0/+161
| | | | | | | | | | | | | | This is an integration of an Exchange patch from Motorola. getRequestEntity() was modified to not add tags that were not part of the protocol spec for remote wipe ack. Another big change was to unwrap this function so it could be unit tested w/o the need for bigger, bulkier classes. This lead to the creation of populateRequestEntitySerializer() and changes to other functions to make then reentrant and potentially static if possible. Oh...fixed a typo too. Change-Id: I0c9167c9609b3d6a6f77f3f3118d9ae790077b2d (cherry picked from commit 60b69ecd47d872c845b6bca46e4937d505a78101)
* NPE fix in NameComparator when null strings are provided by theAnthony Lee2014-03-191-0/+106
| | | | | | | | | | | | caller. b/12894779 This is the integration of an Exchange fix from Motorola. As part of this fix, unit tests have been introduced to verify that we are experiencing the correct behavior. Writing these unit tests required some factoring/unwrapped to make the code easier to test. Change-Id: I3fe8278c56fb13e2e43f32c3eeba1cbe01ea3b8b (cherry picked from commit 6fd3b6c35d930ee045cb6cfe3d6770d450b7b523)
* Introduce the ability to dump the wbxml from EAS responses.Anthony Lee2014-03-191-0/+83
| | | | | | | | | | Similar to CurlLogger that dumps the base64 represention of the EAS request, WbxmlResponseLogger will dump the base64 representation of responses from the server so that we can easily view the XML payload. Unit tests included. Change-Id: I96e2c2d508ac27002125ee83d307ff7cd75400c7 (cherry picked from commit 17403f2cc87358e7b768cb982921d28694a7932d)
* Convert ExchangeTests to use android-support-testBrett Chabot2014-02-202-2/+4
| | | | Change-Id: Ie5ca6fa84c8a4617e63a438d995e5cbf9715e516
* Add test size annotation to test classes so they get run in continuousJerry Xie2014-02-193-0/+6
| | | | Change-Id: Ib988e0ea31b813c7fab329e529b1ef08afa4404f
* Eliminate redundant methods in Address classJames Lemieux2014-01-221-5/+5
| | | | | | | | | | | THIS DOES NOT CHANGE ANY EXISTING FUNCTIONALITY. Address.pack() has been removed and all calls replaced with its synonym Address.toHeader(). Address.unpack() has been renamed to Address.fromHeader() to follow the new naming convention. In days of yore, pack() and toHeader() used to do different things. Now they are identical and thus one is superfluous. We have standardized on toHeader() and fromHeader(). Change-Id: I233a139da7aa03602b76f931b03cdd0e8414d242
* Disable broken Exchange unitsJerry Xie2013-12-067-28/+29
| | | | Change-Id: Iecfd5e662f33a09ee5eb61d760446d5e6d093b91
* Fix Exchange unitsJerry Xie2013-11-191-3/+3
| | | Change-Id: I84da7fab150e938033335694abf854932e3f7a09
* Only iterate each parent onceTony Mantler2013-09-271-1/+0
| | | | | | | | Also tidy some warnings. b/10893667 Change-Id: I207cf2b4c26bd3b8c695971bcde6254236a54c57
* Move CalendarSyncParser into its own fileMartin Hibdon2013-09-044-526/+10
| | | | | | | | | Get rid of CalendarSyncAdapter, which isn't used anymore. Also, get the tests to compile. They don't neccessarily pass yet, but at least they compile. Change-Id: Icaff923a9b3d8c4c886da1e8c6410dbdf55ce395
* Rename SYNC_WINDOW_UNKNOWN to SYNC_WINDOW_ACCOUNT.Yu Ping Hu2013-07-241-12/+11
| | | | Change-Id: Ibf4f0116b0cec42e6c76aecb7b59861b01f3df47
* Unify LogTagScott Kennedy2013-06-062-5/+6
| | | | | | | | | | | | | | | | | | | | There is now only one LogTag class. The static initializer of GmailApplication (existing), EmailApplication (new), and Exchange (existing) 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, .Exchange) 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: Ib565414fae51d0c3367370db9717aece45f7eb36
* Try to use names from time zone strings if all else fails...Marc Blank2012-09-071-0/+10
| | | | Change-Id: Ie417a6b27c731f24f0d8ccf5275df9c2fad37efd
* Convert authorities, intents, and account manager typesMarc Blank2012-08-311-5/+3
| | | | | | | | * Tested OK on wiped Nexus * Tested OK on S3 * Upgrade tested on Nexus Change-Id: Icbb939bebbaed71b7662739678b8e59e9a9e1552
* When using smartSend, pass in list of attachments to sendMarc Blank2012-08-201-6/+2
| | | | | | | | * We exclude original attachments from this list * Also remove some unused code Bug: 7005505 Change-Id: I9296b25fb80722a2d5f39a1b4a4fa66405627a9b
* Fix Exchange tests buildMarc Blank2012-07-181-0/+1
| | | | Change-Id: Ic2fe257189c551b1d0beabed1bd0e2a2120dfb64
* Refactor code to match changes to emailcommonMarc Blank2012-07-181-1/+1
| | | | | | * No changes in functionality Change-Id: I744bc0a0ff0bddea2e91ee9f307c98960848eb68
* Improve initial folder list syncMarc Blank2012-07-161-65/+24
| | | | | | | | | | | | * The initial folder list sync has been worst-case O(n**2); with this change it is now O(n) * Also, we only save each Mailbox once, which saves a lot of extra disk thrashing * Assume generic user-created folders hold mail; this simplifies the code greatly and solves a number of user issues. In the case that we're wrong (I've never seen it), there's really no harm done Change-Id: I20321b2708ce3e8ebbe647116a787b26d115c3bf
* DO NOT MERGE: Move exchange2 files up a levelMarc Blank2012-06-279-296/+406
| | | | | | * Goodbye, exchange1 Change-Id: Id2fc093cd43a55815047ab091b6a49c3d1138888
* Build the right testsPaul Westbrook2012-06-271-1/+1
| | | | Change-Id: I8a8f77b13961a3495cf97280e46e4f0449389b12
* Allow the Exchange tests to buildPaul Westbrook2012-06-271-2/+4
| | | | | | This doesn't fix all build problems, but the compilation starts Change-Id: Ia11b46182aa87dcc2ce619614898f5dea8ddf2ee
* Create exchange2; restore ICS sources to exchangeMarc Blank2012-04-263-80/+43
| | | | Change-Id: I076ad6c1e24ed071fe2d2867ca0fe3fbaff5a95f
* resolved conflicts for merge of e71d73cb to masterMarc Blank2012-01-041-0/+211
|\ | | | | | | Change-Id: I38a87255467e30640081027f40663c6c835398c6
| * Fix folder sync parsing and parent initializationMarc Blank2012-01-011-0/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * This is a large CL, but almost all of it relates to more comprehensive tests for folder parsing * There are less than a dozen lines of production code changes: - Move creation of mailboxMap out of the validation loop in FolderSyncParser - Make sure we fix up the parent of new/changed folders in MailboxUtilities Bug: 5794371 Change-Id: I5fb32369a6fdbfb33919df495d40347b56013bbd
* | Correct new mailbox parent fixup codeMarc Blank2011-12-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | * Change poorly named cursor variable (the code is confusing as it was) * Fixup the parent of parentKey-less mailboxes so that all children are properly updated * Fix faulty unit test (that otherwise would have caught this issue!) Bug: 5794371 Change-Id: Ie249617775ba11d9f2e10528019893d4f9d9f81e
* | Handle binder transaction failures in CalendarSyncAdapterMarc Blank2011-11-201-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Created a facility for handling the newly implemented TransactionTooLargeException that the framework can throw if we send a too-large batch of data to a content provider. * For now, we're just using this with CalendarSyncAdapter, which is where we've seen problems in the past, and in the referenced bug. * The test account hits the exception, and then appars to successfully finish syncing the calendar Bug: 5516422 Change-Id: I3c7ce3ada940464d1ee1f69bd6192640ebbd8fa3
* | am 2c7d44b1: Attempt to better handle screwy MSFT time zone informationMarc Blank2011-11-171-0/+18
|\| | | | | | | | | * commit '2c7d44b182654120a98921cbc864be2d135c8fda': Attempt to better handle screwy MSFT time zone information
| * Attempt to better handle screwy MSFT time zone informationMarc Blank2011-11-171-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Exchange appears to send time zond data that doesn't really match any time zone in our database; in these cases, we have been returning a random one with the same bias (base offset w/o DST) * In this CL, we try to do better by giving the time zone information a bit more slack when the regular determination fails (we allow the hour of change to be up to 4 hours different from expected, rather than one minute). This is certainly better, though I do not have an explanation from MSFT about the reason for the erroneous data. * Updated unit tests to confirm that we don't break any existing code and do, in fact, handle the case reported below as a P1/S1 bug. Bug: 5605219 Change-Id: I8c17a687404204aff4feb1c3009adde279110cab
* | Split EasAccountService out of EasSyncServiceMarc Blank2011-11-032-42/+79
|/ | | | Change-Id: Id395e422e0363a5494501db9e9918393abcbe9aa
* Remove illegal characters from EAS 2.5 attachment file namesMarc Blank2011-09-211-0/+40
| | | | | | | | | | | | * For some reason, EAS 2.5 sends us partially encoded file names, which we use to specify attachments to be loaded. * It turns out that these file names aren't properly encoded for EAS's use in the GetAttachment command; some additional characters must be escaped using %nn. * We now check for EAS 2.5 and escape illegal characters Bug: 5341416 Change-Id: Ie112359e139581c8ae31e40869b2fa0e568d7f65
* Allow for sending empty subject and descriptionMarc Blank2011-09-151-4/+20
| | | | | | | * Add unit test for updated Serializer#writeStringValue Bug: 5321171 Change-Id: I4ae56c67ac8d69c64316a5dc2ae426f3e4be9ae3
* Send OPTIONS command with minimal headersMarc Blank2011-09-131-14/+14
| | | | | Bug: 5196927 Change-Id: I85ffdb9b0feaa978c6b4aebec4e264909adb19ae
* Revert "Don't send device info in OPTIONS command"Marc Blank2011-09-021-11/+11
| | | | This reverts commit e9353616056991511d4c3a707e97ca0468c0ef42.
* Don't send device info in OPTIONS commandMarc Blank2011-08-311-11/+11
| | | | | | Bug: <need to find> Change-Id: Ic7b8299fad70aeaff05485e675ac1882dcfbc9d1
* Fix longstanding problem with all-day events VCALENDAR attachmentMarc Blank2011-08-251-2/+5
| | | | | | | | * Another hard-to-find, but dumb, mistake * Fix unit test Bug: 3334965 Change-Id: I5b18add38780bb476e29d9ae2a28247feebe21e5
* Fix NPE in unit testMarc Blank2011-08-221-3/+2
| | | | | Bug: 5197548 Change-Id: Icda6d2f9c9effb97ee55ab60c60b7e6ff5dd7f36