Commit Graph

1062 Commits

Author SHA1 Message Date
Doug Zongker
0f42334af2 Merge "replace Email's private base64 class with one from android-common" 2010-02-08 20:28:20 -08:00
Doug Zongker
f44a40cda1 replace Email's private base64 class with one from android-common
Convert all usages of com.android.email.codec.binary.Base64 to use
com.android.common.Base64 instead, except for Base64OutputStream
(which doesn't exist in android-common yet).

Change-Id: I339a1f451245138187080c7444fcabef8d13f8aa
2010-02-08 20:26:02 -08:00
Andrew Stadler
189c22a045 resolved conflicts for merge of 5f0f1879 to master
Conflicts:
	src/com/android/exchange/SyncManager.java
2010-02-08 17:57:54 -08:00
Andrew Stadler
2a5eeea921 Adding security hold flag to accounts
* Add hold flag to Account flags
* Add code to set it (when EAS reports policy failure)
* Add code to clear it when we see changes from the device admin side
* unit tests

This should be sufficient to restart sync of an account which is on hold
due to security policy requirements.  Note, this is considered a "retry",
and if the account still does not meet requirements for some reason, it
is expected that EAS sync will call policiesRequired() again.
2010-02-08 17:42:42 -08:00
Andrew Stadler
5f0f18790f am 26c95dda: Update accounts backup when externally deleted
Merge commit '26c95ddace076ead10d5c42986bcc70b465e9791' into eclair-plus-aosp

* commit '26c95ddace076ead10d5c42986bcc70b465e9791':
  Update accounts backup when externally deleted
2010-02-08 17:21:00 -08:00
Andrew Stadler
26c95ddace Update accounts backup when externally deleted
Fix the case in which an Email account is deleted in the Account Manager
UI, and we delete the provider account, but we did not also update the
backups.  In some cases, the deleted account would be accidentally
restored from the backups.

Bug: 2414469 (internal)
Bug: 2427663 (external)
2010-02-08 16:27:05 -08:00
Marc Blank
f3332ddac8 Merge "Additional work on EAS security" 2010-02-08 12:37:34 -08:00
Marc Blank
d4ff80d404 Merge "Fix bug w/ all day events (hr, min, sec need to be zero in DTSTART)" 2010-02-08 09:29:22 -08:00
Marc Blank
37658316f9 Use a single account color resource table; add convenience methods
* The color chip resource table was duplicated in three files
* Move these into a common location in Email.java and add
  convenience method for retrieving color chip resource id based
  on accountId
* Simplifies future changes to account color selection
* Add RGB color information on these resources (provided by
  rfulcher) and add a convenience method for retrieving these

Change-Id: If1c2d22fba91cfce46a2618cd2b73cf7a534ce51
2010-02-08 09:21:54 -08:00
Marc Blank
e81b2bfe5e Fix bug w/ all day events (hr, min, sec need to be zero in DTSTART)
* For some reason, the recurrence expansion system requires hr, min, and sec
  to be zero for DTSTART when allDay=1
* Force hr, min, and sec to zero for all day events

Bug: 2427658
Change-Id: Ief6b5b571fa6bc6947bcbc9cda02ab2c04f27549
2010-02-08 09:17:03 -08:00
Marc Blank
09b45fdcff Additional work on EAS security
* Add more final plumbing for exchange security
* If policies are supported, we now check to see if they are active;
  if so, we acknowledge this to the server, after which we are given a
  final policy key which can be used for syncing

Change-Id: I5992c790294e35b5ec5343c7665e2e7fd31a75ca
2010-02-07 13:28:18 -08:00
Marc Blank
518a562de3 Merge "Initial implementation of EAS security" 2010-02-05 13:44:38 -08:00
Marc Blank
a1c708670b Merge "Fix #2422815 (Exception in EAS calendar upsync)" 2010-02-05 12:34:25 -08:00
Marc Blank
72a5e7d7c1 Initial implementation of EAS security
* This first implementation integrates with early CLs for
  Email app integration with device security
* Check for policies added to validation process
* If the server has no policy requirements, there is no change
  to the existing process
* We automatically declare a set of policies to be unsupported
  if any are known to the sync adapter to be unsupported
  (e.g. no attachments or password history)
* We call isSupported (PolicySet) to determine whether other
  policies use values that the OS can support (e.g. password length,
  inactivity time, etc.)
* Depending on whether the server's policies are unsupported or
  supported, we throw the proper exception back to the caller

Change-Id: I704cb2151dd87f54c83c2aa23976a8ac8e2c501a
2010-02-05 12:33:07 -08:00
Marc Blank
204b7a3bf4 Fix #2422815 (Exception in EAS calendar upsync)
* Exception is due to the presence of values in ContentValues that
  are null (would normally expect those fields to be absent)
* Fix all relevant cases that might produce an NPE in this case

Bug: 2422815
Change-Id: I637a21307c2d518912edce093de90a06d94614e5
2010-02-05 11:59:22 -08:00
Andrew Stadler
3d2b3b3b35 Logic to move phone into security-admin mode
* Create notification to display when syncs fail due to security
* Create psuedo-activity (no UI) to manage device admin state transitions
* Clean up and flesh out SecurityPolicy APIs'
* Add placeholders in EasSyncService showing how to react when policies
    are not met and sync cannot continue.

Note:  There are some STOPSHIP todo's at the top of SecurityPolicy.java.
These should explain any code that you might think is "missing".
2010-02-05 11:10:39 -08:00
Marc Blank
4d2a701844 Merge "Fix #2420732 (crash in Google Services Framework)" 2010-02-04 17:31:14 -08:00
Marc Blank
0bbe34bce5 Fix #2420732 (crash in Google Services Framework)
* Exchange calendar sync created Event records for exceptions
  that didn't have a _sync_id
* This caused google calendar sync to try to upload these
  Events as new, which caused an Exception to be thrown
* Fixed EAS calendar sync adapter to generate a _sync_id for
  exceptions in the form <parentId>_<exception start time>

Bug: 2420732
Change-Id: I46769175ca89ffa4cec4fe8b0c35ef2242536185
2010-02-04 15:23:09 -08:00
Andrew Stadler
a1550678af Integrate policies into account setup process
* Rename SECURITY_POLICIES_REQUIRED to SECURITY_POLICIES_UNSUPPORTED
* Create new pathway for SECURITY_POLICIES_REQUIRED, making it advisory
* Cleaned up strings for account setup error dialogs
* Refactored AccountSetupExchange.onActivityResult() to split up the
  three primary use cases, making them more readable.
* Always finish() in AcccountSetupAccountScreen, because it's usually
  cleaner to return to the previous screen (enter username & password).
2010-02-04 15:04:48 -08:00
Marc Blank
48e20b81e6 Fix #2415185 (Email disappears after a while)
* Exchange account validation tests security policies by sending a
  FolderSync command and determining whether this generates an
  error
* Unfortunately, we use the real deviceId when sending the command
  and this causes the next real sync to fail such that all data is
  wiped and reloaded (the bug)
* The fix is to use a false device id while doing validation

Bug: 2415185
Change-Id: Ibe577e36f770d737ba5952b347aa0d73bda3568a
2010-02-04 12:39:07 -08:00
Marc Blank
8f8179f07e Merge "Add calendar sync checkbox to account settings screen" 2010-02-04 12:24:52 -08:00
Marc Blank
0692ec4836 Fix #2414056 (NPE after delete account)
* Add check for deleted mailbox

Bug: 2414056
Change-Id: I20aea69b0ad2c2ad2eacb76febcafb881f9eecc3
2010-02-04 10:38:18 -08:00
Marc Blank
a1c997a2b6 Add calendar sync checkbox to account settings screen
Bug: 2414157
Change-Id: I60ead139552f3e7c86b113f8b8b10ef3cf57abbf
2010-02-04 10:28:37 -08:00
satok
d9080ed32e Add UI for Signature in Email Application
Bug: 1323618

- changed summary of signature to show hint if signature is not set
2010-02-04 10:28:55 +09:00
Marc Blank
7c6c1fd519 Merge "Build proper TimeZoneInformation strings for upsync; fix bugs" 2010-02-03 14:42:23 -08:00
Marc Blank
6f3013b787 Build proper TimeZoneInformation strings for upsync; fix bugs
* Create full TZI strings for upload of events (previously, we
  omitted DST information)
* Add documentation to some unit tests
* Put in correct logic for determining if upload needed
* Fix problem w/ parsing empty tags

Change-Id: I268ce8a2db30b3cfdf0e44f6a78befd6bd933243
2010-02-03 14:41:45 -08:00
Makoto Onuki
91237e9dcb Adding script for building Email app without exchange.
remove-exchange-support.sh makes it possible to build the email app without
exchange support.

This script:
- removes all packages under com.android.exchange.
- removes all lines surrounded by EXCHANGE-REMOVE-SECTION-START and
  EXCHANGE-REMOVE-SECTION-END

And the resulting source should still build and run fine.

Bug: 2369784
2010-02-03 11:39:46 -08:00
Andrew Stadler
8bb0ee3b92 Fix auto-discover / account verification logic
New behavior:
 * There are two primary paths through this activity:
 *   Edit existing:
 *     Load existing values from account into fields
 *     When user clicks 'next':
 *       Confirm not a duplicate account
 *       Try new values (check settings)
 *       If new values are OK:
 *         Write new values (save to provider)
 *         finish() (pop to previous)
 *
 *   Creating New:
 *     Try Auto-discover to get details from server
 *     If Auto-discover reports an authentication failure:
 *       finish() (pop to previous, to re-enter username & password)
 *     If Auto-discover succeeds:
 *       write server's account details into account
 *     Load values from account into fields
 *     Confirm not a duplicate account
 *     Try new values (check settings)
 *     If new values are OK:
 *       Write new values (save to provider)
 *       Proceed to options screen
 *       finish() (removes self from back stack)
* Added unit test for new loadFields method

Bug: 2412300
2010-02-03 10:38:27 -08:00
Makoto Onuki
b854d05a89 Change EAS authenticator's label according to the vendor policy.
Our original plan was to disable both authenticators by default, and enable
one of then on boot.  However, it turned out existing exchange accounts will
be removed if there's no enabled authenticators for the account type.
So, instead, in this patch we initially enable only the default one, and switch
to the other one on boot if the vendor policy indicates so.

(If a device has a vendor policy apk, it should also have the email app
preloaded, so changing the label at boot time isn't too late.)

Bug: 2382710
2010-02-02 16:25:29 -08:00
Makoto Onuki
130988e49d Merge "Gather common exchange related methods into one place" 2010-02-02 13:48:04 -08:00
Andy Stadler
561e10d4c0 Merge "Clean up exception handling in VendorPolicyLoader" 2010-02-02 13:39:30 -08:00
Makoto Onuki
9fe51f6329 Gather common exchange related methods into one place
So that it'll be easier to remove exchange dependency.
2010-02-02 13:36:45 -08:00
Makoto Onuki
049509d10e Merge "Move Eas.ACCOUNT_MANAGER_TYPE out of the package." 2010-02-02 13:34:04 -08:00
Andrew Stadler
a6e6dd096c Clean up exception handling in VendorPolicyLoader
Per code review suggestions, clean up exception handling, and add
commentary to make intended behavior more explicit.

Followup to: 0434fef1f6
Bug: 2413388
2010-02-02 12:19:49 -08:00
Andrew Stadler
0434fef1f6 Fix crash in VendorPolicyLoader
* Create unit test to reproduce crash
* Fix handling of empty bundle (the default return value)
* Clean up some exception handling in the policy module loader, which
  reduces some unneeded logging.

Bug: 2413388
2010-02-02 10:41:56 -08:00
Marc Blank
cfbbb99c67 Merge "Handle upsync of multiple BYDAY values; add some unit tests" 2010-02-01 17:00:35 -08:00
Andrew Stadler
d62860821c Additional SecurityPolicy functionality
* Begin wiring into system DevicePolicyManager requirements
* Semi-real implementations of isSupported() & isActive()
* Added new API (placeholder) updatePolicies()
* Updated existing unit tests as needed

Bug: 2387961
2010-02-01 16:48:16 -08:00
Marc Blank
a825939459 Handle upsync of multiple BYDAY values; add some unit tests
Change-Id: If3be28df41ed88cb83edca2f6ea6ca1f734f506f
2010-02-01 16:44:16 -08:00
Andrew Stadler
ecb1af8041 Finish up IMAP ID implementation
* scrub all external strings to keep them compliant for IMAP protocol
* move Build.MODEL to x-android-device-model
* send x-android-mobile-net-operator
* send AGUID
* unit tests for above
* retrieve providers from VendorPolicyLoader

Bug: 2332183
2010-02-01 15:53:46 -08:00
Makoto Onuki
faed6178b1 Move Eas.ACCOUNT_MANAGER_TYPE out of the package.
Moved Eas.ACCOUNT_MANAGER_TYPE to Email.EXCHANGE_ACCOUNT_MANAGER_TYPE.

This constant is not related to the exchange protocol, and referred in
a lot of different places.  Moving it out of the package will make it a lot
simpler when removing exchange dependency.
2010-02-01 15:38:15 -08:00
Makoto Onuki
b89bc81f54 Merge "Fix confusing setup screen title." 2010-02-01 14:25:54 -08:00
Makoto Onuki
e5c3c98e9a Fix confusing setup screen title.
Change the title of the screen for adding an exchange account from "Set up email" to "Add an Exchange account".

Bug: 2159019
2010-02-01 14:24:38 -08:00
Marc Blank
31ac14aa51 Remove default EAS Calendar parser logging
Change-Id: Id05d9721b1f40242cb9f77ae21575bfef2d1b671
2010-02-01 14:12:59 -08:00
Marc Blank
7a2776a5b4 Further work on Exchange calendar sync; exception upsync
* Add code to upsync exceptions; debug same
* Use AccountManager to handle sync keys (as w/ Contacts)
* Add unit tests in next CL

Change-Id: Ib8526d70de33ed7e551b9713a3bbf1ad80612948
2010-02-01 13:10:41 -08:00
Marc Blank
0088918e4e Merge "Additional work on new Event upload to EAS server" 2010-01-31 09:18:27 -08:00
Marc Blank
dc6930c0b3 Additional work on new Event upload to EAS server
* Added support for reminders and recurrences
* Note that Duration class is copied from CalendarProvider with only
  formatting changes

Change-Id: Icf399df422f813ba8e7880646bfbc96a2156a204
2010-01-31 09:17:50 -08:00
Makoto Onuki
e853286713 Merge "Move non-exchange specific classes to com.android.email.service." 2010-01-29 16:22:23 -08:00
Makoto Onuki
8ee17c7012 Unifying dupe code in Debug.java and Email.java. 2010-01-29 15:44:56 -08:00
Makoto Onuki
bb9b5163c1 Move non-exchange specific classes to com.android.email.service. 2010-01-29 10:37:39 -08:00
Marc Blank
d99dbf01fb Fix problem with Event creation by EAS calendar sync
* Turns out that DURATION is required by CalendarProvider, and
  DTEND has a different meaning than it does to EAS
* Fix downsync to create proper recurring events

Change-Id: Ibf85422de73579a93de89b2c27c13f96994bedc8
2010-01-28 12:31:36 -08:00
Marc Blank
f3fcb8929e Implement Exchange calendar sync support
What should be working:
* Events sync down from server and appear in calendar
* Recurrences and exceptions appear in calendar
* Changed events on server should be reflected in calendar
* Deletions on server should be reflected in calendar
* Push of new/changed/deleted events should work
* Changes on device are NOT synced back to server
* New, single events on device are synced back to server
  (no time zone, attendee, or recurrence support)
* Checkbox for syncing calendar added to setup flow
* System sync glue in manifest, etc.
* Bugs are to be expected
* A few unit tests; needs more

Change-Id: I7ca262eaba562ccb9d1af5b0cd948c6bac30e5dd
2010-01-28 09:18:48 -08:00
Mihai Preda
b4e7a85eaa Merge "MessageCompose: properly remove quoted text from saved draft." 2010-01-28 03:48:20 -08:00
Makoto Onuki
f98ffb6f44 Merge "Add "vendor policy" loader, and alternate exchange descriptive text." 2010-01-27 18:09:05 -08:00
Makoto Onuki
f613489663 Add "vendor policy" loader, and alternate exchange descriptive text.
- Dynamically switch to the alternate exchange strings to substitute overlays.
- Added the mechanism to load the "vendor policy", which tells you when the
  alternate strings should be used.

Bug: 2382710
2010-01-27 17:40:56 -08:00
The Android Open Source Project
d423fb996f am 08d92ebf: merge from open-source master
Merge commit '08d92ebf4722e45216ee225775a3b86f9ceecc0d'

* commit '08d92ebf4722e45216ee225775a3b86f9ceecc0d':
  Trim the mime type portion of Content-Type.
2010-01-27 16:29:17 -08:00
Marc Blank
46199c65a3 Fix #2382368 (NPE in AccountSetupExchangeTests)
* AccountSetupExchange defaultly tries using EAS AutoDiscover, which isn't
  appropriate in the unit test setting
* Add an Intent extra to disable AutoDiscover and use it in unit tests

Bug: 2382368
Change-Id: I3d4e8d7194b02da44ad583da0cf2fe60ffb19311
2010-01-27 13:57:20 -08:00
Andrew Stadler
345fb8b737 Add utilities for processing account security policies
* Add security sync key & signature columns
* Add utilities for easy read/write of security columns
* Write aggregator for multiple accounts
* Simple API's for exchange security (very preliminary)
* Unit tests of above

Bug: 2387961
2010-01-26 17:24:15 -08:00
Marc Blank
3ef6b0493e Merge "Handle Exchange meeting invitation responses" 2010-01-26 09:29:05 -08:00
Marc Blank
5de54008e5 Handle Exchange meeting invitation responses
* Includes some refactoring of internal "request" code in SyncManager
* Adds Message flags to tag meeting invites and cancellations
* Adds meetingResponse method in EmailService
* Hooks into Controller and MessageView UI included

Change-Id: I4c5e10bccc4b41956b94d9dfa55925e5af030939
2010-01-26 09:08:52 -08:00
Mihai Preda
e3e65ed919 MessageCompose: properly remove quoted text from saved draft.
Bug 2363249.
2010-01-26 17:19:49 +01:00
Andrew Stadler
468371917e IMAP ID
* Add IMAP ID command to all login sequences
* Send generic information for now
* Explicitly catch & discard parsing errors, since we really don't
  care if the command succeeds or not.
* Unit tests

Bug: 2332183
2010-01-25 18:40:45 -08:00
Mihai Preda
def85b1ce4 Merge "MessageCompose: show account name in title." 2010-01-22 03:45:01 -08:00
The Android Open Source Project
08d92ebf47 merge from open-source master 2010-01-21 13:19:17 -08:00
Andrew Stadler
fc8d943a82 Add security column to Account
* Upgrade accounts table to add security column
* Read/Write new column
* Backup/Restore new column
* Unit tests for all of the above
* First cut at defining bitfields (non-binding, just putting down ideas)

Bug: 2387961
2010-01-21 11:48:02 -08:00
Patrick Horn
2517a3dfd1 Trim the mime type portion of Content-Type.
Fixes parsing of Content-Type headers like "text/plain ; charset=iso-8859-1"
Added unit tests for whitespace and the charset parameter
2010-01-21 11:46:20 -08:00
Mike Lockwood
87a520d7b9 Use default values rather than hard coding green for LED notification color.
Change-Id: Id192ea4d34725abf9ce892bc24e5c8562215f3e3
BUG: 2329568

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-01-21 11:20:23 -05:00
Mihai Preda
f9623b9e78 MessageCompose: show account name in title.
Bug 2338152.
2010-01-21 14:47:18 +01:00
Andrew Stadler
6605152908 am 346a0cc1: Backup/Restore accounts - bugfix - DO NOT MERGE
Merge commit '346a0cc1e00fcfde05df66eb37433172c96b1c36' into eclair-plus-aosp

* commit '346a0cc1e00fcfde05df66eb37433172c96b1c36':
  Backup/Restore accounts - bugfix - DO NOT MERGE
2010-01-20 18:29:43 -08:00
Andrew Stadler
346a0cc1e0 Backup/Restore accounts - bugfix - DO NOT MERGE
* Followup to 85d765f4
* Workaround for (HTC bug: 2275383) & (Moto bug: 2226582)
* Restores mSyncKey as null instead of empty string, which is how
  a new account is initialized.  Bug: 2385980
* Cleanup synchronized logic in backup & restore
* Minor cleanups & improved comments

Cherry-picked from master d612717340
2010-01-20 17:24:33 -08:00
Andrew Stadler
d612717340 Backup/Restore accounts - bugfix
* Followup to 5e91cccd
* Workaround for (HTC bug: 2275383) & (Moto bug: 2226582)
* Restores mSyncKey as null instead of empty string, which is how
  a new account is initialized.  Bug: 2385980
* Cleanup synchronized logic in backup & restore
* Minor cleanups & improved comments
2010-01-20 16:52:12 -08:00
Andrew Stadler
d3998ebe4e am 85d765f4: Quick backup/restore of accounts DO NOT MERGE
Merge commit '85d765f41c20e6efb3b120055eb4f1efae166e8b' into eclair-plus-aosp

* commit '85d765f41c20e6efb3b120055eb4f1efae166e8b':
  Quick backup/restore of accounts DO NOT MERGE
2010-01-20 11:25:28 -08:00
Andrew Stadler
85d765f41c Quick backup/restore of accounts DO NOT MERGE
* Workaround for (HTC bug 2275383) & (Moto bug 2226582)
* Adds checkpoints for backing up and restoring accounts
* Uses legacy Account / prefs to back up accounts - this is because
  some of this code will be reused for legacy account migration
* Unit tests of Account & LegacyConversions
* Unit tests of backup & restore
* Not done:  testing of EAS/Account Manager interface (this will require
  deeper dependency injection, to avoid the embedded calls to the Account
  Manager and other system services.)

Cherry-picked from master 5e91cccd4b
2010-01-20 11:05:02 -08:00
Andrew Stadler
5e91cccd4b Quick backup/restore of accounts
* Workaround for (HTC bug 2275383) & (Moto bug 2226582)
* Adds checkpoints for backing up and restoring accounts
* Uses legacy Account / prefs to back up accounts - this is because
  some of this code will be reused for legacy account migration
* Unit tests of Account & LegacyConversions
* Unit tests of backup & restore
* Not done:  testing of EAS/Account Manager interface (this will require
  deeper dependency injection, to avoid the embedded calls to the Account
  Manager and other system services.)
2010-01-20 01:36:01 -08:00
Satoshi Kataoka
950f6c65dd Merge "Fix bugs rerated to updateMailboxRefreshTime" 2010-01-19 14:42:26 -08:00
Marc Blank
0b8b68cbeb Fix account creation race condition
* Due to the order in which account creation occurs in the Provider
  and in AccountManager, and the fact that there are data observers
  on each that initiate account reconciliation, a race condition exists
  that can cause either of these accounts to appear to be orphaned,
  and thereby get deleted
* We add an "incomplete" flag to the Account in EmailProvider and
  set/clear it during account creation.  The various reconciliation
  methods will ignore accounts marked as incomplete.

Bug: 2353755
Change-Id: I13fb144dd857f839eb3471b01f271f3a0d4d8159
2010-01-19 13:07:49 -08:00
Marc Blank
74724af62c Fix autodiscover when attempted with Exchange 2003 server
* Make sure 403 error in autodiscover isn't treated as an auth error
  (401 is used for that)
* Make non-auth errors in autodiscover fail silently (and move user
  to manual setup)

Bug: 2374302
Change-Id: I4699bff70cf5ec4a513e6443e4817543c2ab2cef
2010-01-15 15:36:34 -08:00
satok
0f4efcd483 Fix bugs rerated to updateMailboxRefreshTime
BUG: 2131243

- change the parameter updateMailboxRefreshTime in MailboxList
- add updateMailboxRefreshTime to MailboxList
2010-01-16 04:36:11 +09:00
Marc Blank
9d82553b34 Merge "Implement Autodiscover for Exchange servers" 2010-01-13 17:12:26 -08:00
Marc Blank
17da1767e3 Implement Autodiscover for Exchange servers
* Autodiscover allows complete configuration using only email address
  and password
* Code handles the two standard autodiscover addresses and redirect
* Autodiscover process starts when the user chooses "Exchange" as the
  account type.  If the account is created via the AccountManager,
  autodiscover begins upon tapping "Next" for the first time
* If autodiscover fails due to anything other than auth failure for
  autodiscover-capable servers, the user is placed into the standard manual
  configuration screen

Bug: 2366019
Change-Id: I936712b924833d9a133e8da04e11c3ba45d92f92
2010-01-13 17:11:49 -08:00
Makoto Onuki
08f9bfe831 unbundle: Moving DomainNameChecker to android common. 2010-01-11 14:56:54 -08:00
Marc Blank
80eb4fd0fe am d1c56ea1: Ensure protocol version always set in sync services DO NOT MERGE
Merge commit 'd1c56ea144fb3e91ad1fdf8bba4c57531ec9cc18' into eclair-plus-aosp

* commit 'd1c56ea144fb3e91ad1fdf8bba4c57531ec9cc18':
  Ensure protocol version always set in sync services DO NOT MERGE
2010-01-10 19:34:21 -08:00
Marc Blank
d1c56ea144 Ensure protocol version always set in sync services DO NOT MERGE
* A recent change caused an issue in which protocolVersion could
  be null, resulting in an NPE
* Ensure that protocolVersion is always set to a valid version,
  defaulting to 2.5

Change-Id: Ifba6c8089fdbd93dffe38ab9895cfd3e994e29d0
Bug: 2353859
2010-01-08 14:34:21 -08:00
Makoto Onuki
63ba69d5d0 Merge "Move stub logging classes to org.apache.james.mime4j" 2010-01-08 10:32:50 -08:00
Marc Blank
0f2e1a8009 Merge "Make sure protocol version is always set in sync services" 2010-01-08 09:20:59 -08:00
Marc Blank
2cb9c55f3b Add new tests for Email sync parsing
Change-Id: Ib3be60b5f439f79f62f62eff607673e34c75506d
2010-01-07 20:27:39 -08:00
Makoto Onuki
a31cb777eb Move stub logging classes to org.apache.james.mime4j 2010-01-07 16:56:43 -08:00
Marc Blank
89ab89dd83 Make sure protocol version is always set in sync services
* A recent change caused an issue in which protocolVersion could
  be null, resulting in an NPE
* Ensure that protocolVersion is always set to a valid version,
  defaulting to 2.5

Bug: 2353859
Change-Id: I6e07ba3df5362c988658e401bebc1776a6780876
2010-01-07 11:59:57 -08:00
Makoto Onuki
fc59359db5 Unbundle: Remove the use of internal SSL APIs.
1. Replaced SSLContextImpl with SSLContext with TLS.  (They're the same, according to crazybob)
2. Copied SSLSocketFactory from org.apache.http.conn.ssl, so that we can use the hidden costructor.  (Which wasn't in the original code -- it was added by the android team, which is why it's hidden.)
2010-01-05 16:57:17 -08:00
Makoto Onuki
f39e5f38eb Unbundling: Get rid of the reference to the hidden field.
Remove the reference to CursorAdapter.mDataValid.
2010-01-04 17:13:09 -08:00
Marc Blank
86919853f7 am e83d0d64: am bb12286f: Merge change Ie25ac73d into eclair-mr2
Merge commit 'e83d0d640e9964500097571d9dea4993e5609123'

* commit 'e83d0d640e9964500097571d9dea4993e5609123':
  Fix "back key" flow for Email account setup
2009-12-22 11:25:58 -08:00
Android (Google) Code Review
bb12286f28 Merge change Ie25ac73d into eclair-mr2
* changes:
  Fix "back key" flow for Email account setup
2009-12-22 11:21:15 -08:00
Mihai Preda
0de7377985 am 78f609db: am af1bf487: MessageView: upon delete move to older instead of newer.
Merge commit '78f609db56500c01f75ea2d8742468907255f7ba'

* commit '78f609db56500c01f75ea2d8742468907255f7ba':
  MessageView: upon delete move to older instead of newer.
2009-12-22 10:15:58 -08:00
Mihai Preda
1e1bb40062 am 9d024a5b: am 2b6dfc97: Merge change I55f52567 into eclair-mr2
Merge commit '9d024a5b4f42d9d7687d06e5f86f9c68f22fccf8'

* commit '9d024a5b4f42d9d7687d06e5f86f9c68f22fccf8':
  MessageCompose: fix NPE cased by WebView set to null in onDestroy().
2009-12-22 10:15:53 -08:00
Mihai Preda
af1bf48773 MessageView: upon delete move to older instead of newer.
Bug 2233586
2009-12-22 15:16:14 +01:00
Android (Google) Code Review
2b6dfc9796 Merge change I55f52567 into eclair-mr2
* changes:
  MessageCompose: fix NPE cased by WebView set to null in onDestroy().
2009-12-22 05:19:44 -08:00
Makoto Onuki
ec82f9d7c0 email unbundling: get rid of the write access to the CursorAdapter.mDataValid.
MessageListAdapter.doRequery() is supporsed to do the same thing as CursorAdapter.onContentChanged() does.  So the entire method body can be replaced with super.onContentChanged().
2009-12-21 15:30:42 -08:00
Marc Blank
4b31f3c7a6 am 27051e48: Merge change Ife6689fa into eclair
Merge commit '27051e480f9cc5396aacc3cc5e520d5875390548' into eclair-plus-aosp

* commit '27051e480f9cc5396aacc3cc5e520d5875390548':
  Use correct EAS version in Outbox (fixes #2319892) DO NOT MERGE
2009-12-21 11:48:22 -08:00
Marc Blank
420f664891 am bfc5de35: Merge change I06d98e54 into eclair
Merge commit 'bfc5de35fa08b6e747e5d5afe72bffafca08ce2a' into eclair-plus-aosp

* commit 'bfc5de35fa08b6e747e5d5afe72bffafca08ce2a':
  Fix delay sending mail after tapping "Send outgoing mail" DO NOT MERGE
2009-12-21 11:48:18 -08:00
Marc Blank
c76a22b01a am c874824c: Merge change Iad377728 into eclair
Merge commit 'c874824ca8b76f795575538ffa34138e2de47cad' into eclair-plus-aosp

* commit 'c874824ca8b76f795575538ffa34138e2de47cad':
  Don't delete referenced messages from the Exchange server DO NOT MERGE
2009-12-21 11:48:14 -08:00
Android (Google) Code Review
27051e480f Merge change Ife6689fa into eclair
* changes:
  Use correct EAS version in Outbox (fixes #2319892) DO NOT MERGE
2009-12-21 11:42:09 -08:00
Android (Google) Code Review
bfc5de35fa Merge change I06d98e54 into eclair
* changes:
  Fix delay sending mail after tapping "Send outgoing mail" DO NOT MERGE
2009-12-21 11:41:24 -08:00
Marc Blank
f1efd65a5e Fix "back key" flow for Email account setup
* The existing flow is badly broken; every "back" causes the user
  to leave the setup flow and therefore have to start from scratch.
  This is a very bad user experience, as previously entered data is
  lost and must be re-entered.
* The fix corrects these problems, allowing the user to back up
  through screens UNTIL the account is successfully created.
* After account creation, the user is returned to the proper screen,
  depending on whether we're in "eas flow mode" or not

Bug: 2337511
Change-Id: Ie25ac73dfcd8a1dca36e1b31c75ffb22359840d1
2009-12-21 11:28:53 -08:00
Marc Blank
320a065b6b am 719610ab: am 42e5dca4: Add sanity checks in SyncManager and EasSyncService
Merge commit '719610ab8faee6a0c0ed4ff748cd1eeec3459fa6'

* commit '719610ab8faee6a0c0ed4ff748cd1eeec3459fa6':
  Add sanity checks in SyncManager and EasSyncService
2009-12-18 16:50:58 -08:00
Makoto Onuki
03e9e2d886 Fix typo 2009-12-18 16:36:44 -08:00
Marc Blank
42e5dca4ef Add sanity checks in SyncManager and EasSyncService
* Prevent possible NPE's

Change-Id: I2b3c747609c6a87ec6060fd59006f2912dfcc591
2009-12-18 13:54:53 -08:00
Makoto Onuki
425fd30a9c Email unbundling: Use accessor for CursorAdapter.mCursor and ListActivity.getListView().
Also added a todo for ContentResolver.SYNC_OBSERVER_TYPE_SETTINGS.
2009-12-18 13:26:04 -08:00
Android (Google) Code Review
99bfd7e9b7 Merge change Ibf071fa6
* changes:
  Unbundling email: Make Base64 hidden API free.
2009-12-17 10:25:05 -08:00
Makoto Onuki
bf071fa625 Unbundling email: Make Base64 hidden API free.
Seems like it's the simplest way to make it.
- Base64 no longer implements BinaryEncoder/Decoder.  Email app doesn't use them.
- Copied Decoder/EncoderException.  Email app doesn't catch them either.
2009-12-16 16:59:00 -08:00
Makoto Onuki
22a4e0ddbf Unbundling email: Stub out apache logging. (See b/2226160)
Let me know if you don't like the package name.
2009-12-16 16:44:10 -08:00
Marc Blank
608ca667b2 Don't delete referenced messages from the Exchange server DO NOT MERGE
* Addresses #2287439 incompletely
* The most likely reason for a reply/forward to get stuck in the Outbox
  is that the referenced message has been deleted from the client, with
  the deletion occuring BEFORE the message gets sent (currently, the two
  are completely independent)
* This change causes deletes NOT to be sent to the server if the message
  to be deleted is referenced by an outgoing message

Change-Id: Iad3777282385bea82276f363d6f95ba8b07cc01c
2009-12-16 12:01:08 -08:00
Marc Blank
23a1cfc8a8 Fix delay sending mail after tapping "Send outgoing mail" DO NOT MERGE
* Fixes #2317429
* When "Send outgoing messages" is tapped in Outbox MessageList view,
  we clear the error state for all "stuck" messages
* We didn't, however, clear the error state of the Mailbox, which doesn't
  clear itself until the end of a pingLoop, which can be up to 30 minutes
* The fix is in two parts:
  * We clear the error state of the Outbox when a sync is requested by
    the UI
  * We don't set the error state of the mailbox for non-auth errors when
    sending, because we don't want to block OTHER messages from getting sent.

Change-Id: I06d98e54049b01c2156b1bc3ebbccf043e7b93f5
2009-12-16 11:57:58 -08:00
Marc Blank
21d077e60b Use correct EAS version in Outbox (fixes #2319892) DO NOT MERGE
* We inadvertently failed to set the EAS version in EasOutboxService,
  so the default of 2.5 is used
* This works, but SmartReply/SmartForward were enhanced in 12.0 and we
  aren't taking advantage of those changes
* The fix is to set the version using common code

Change-Id: Ife6689fa9934da42d98a48df74fca90ba6d1718c
2009-12-16 11:54:46 -08:00
Mihai Preda
55f5256761 MessageCompose: fix NPE cased by WebView set to null in onDestroy().
Bug 2329276.
2009-12-16 18:12:34 +01:00
Android (Google) Code Review
ec3daeedb3 Merge change I783790b6 into eclair-mr2
* changes:
  Check null pointer in MessageList
2009-12-16 00:03:03 -08:00
satok
9151d86e68 Check null pointer in MessageList
BUG: 2299971
2009-12-16 16:26:20 +09:00
Marc Blank
4a7a50f6a6 Fix potential NPE in earlier CL
* Noted this problem in reviewing a newer CL
* Fix is to add a check in setupService

Change-Id: Ia4d71365f8036aac8bf531b835b184dabfbc06fa
2009-12-14 17:17:30 -08:00
Android (Google) Code Review
d2481f95f2 Merge change I768138b6 into eclair-mr2
* changes:
  Fix delay sending stuck mail after tapping "Send outgoing mail"
2009-12-11 15:49:28 -08:00
Android (Google) Code Review
4848aa2a1f Merge change I9a3d501a into eclair-mr2
* changes:
  Run MailboxAlarmReceiver's code in a background thread
2009-12-11 13:06:44 -08:00
Marc Blank
079589641a Run MailboxAlarmReceiver's code in a background thread
* Fixes 2313077
* Broadcast receivers are run in the UI thread, so we must ensure that
  any long-running code is executed in a background thread

Change-Id: I9a3d501a308445a84a1baa99fc6abb9feb56ff2d
2009-12-11 13:05:48 -08:00
Marc Blank
caf5644360 Fix delay sending stuck mail after tapping "Send outgoing mail"
* Fixes #2317429
* When "Send outgoing messages" is tapped in Outbox MessageList view,
  we clear the error state for all "stuck" messages
* We didn't, however, clear the error state of the Mailbox, which doesn't
  clear itself until the end of a pingLoop, which can be up to 30 minutes
* The fix is in two parts:
  * We clear the error state of the Outbox when a sync is requested by
    the UI
  * We don't set the error state of the mailbox for non-auth errors when
    sending, because we don't want to block OTHER messages from getting sent.

Change-Id: I768138b6f31eb696811aa94f621b6fa758ec1a5e
2009-12-11 10:07:17 -08:00
Android (Google) Code Review
9b83870a09 Merge change I3b505448 into eclair-mr2
* changes:
  Use correct EAS protocol version in Outbox (fixes #2319892)
2009-12-11 09:28:36 -08:00
Android (Google) Code Review
e312c12b74 Merge change I356b8bfa into eclair-mr2
* changes:
  Deal with mismatch between our accounts and AccountManager accounts
2009-12-11 09:05:16 -08:00
Marc Blank
423680653a Deal with mismatch between our accounts and AccountManager accounts
* Addresses #2226426
* Recognize the case in which there is no EmailProvider Account corresponding
  to an AccountManager account (the case being addressed is that of the
  EmailProvider database being deleted due to corruption
* In this case, delete the AccountManager account so that the two are in
  sync
* Refactor and add unit test for account reconciliation

Change-Id: I356b8bfaa0846f85223cc15994b750df207a63ea
2009-12-11 09:04:26 -08:00
Marc Blank
ec2d0e41b7 Use correct EAS protocol version in Outbox (fixes #2319892)
* We inadvertently failed to set the EAS version in EasOutboxService,
  so the default of 2.5 is used
* This works, but SmartReply/SmartForward were enhanced in 12.0 and we
  aren't taking advantage of those changes
* The fix is to set the version using common code

Change-Id: I3b505448003f340681deeb8fb22e61e9dd8d10a0
2009-12-10 14:11:23 -08:00
Android (Google) Code Review
3c1334ae1f Merge change I915b13a6 into eclair-mr2
* changes:
  Fix MessageListUnitTests
2009-12-09 17:44:48 -08:00
Fred Quintana
052eefe406 changed to use the new EntityIterator interface 2009-12-09 10:30:58 -08:00
Android (Google) Code Review
7a4b1c72f6 Merge change I146f63ab into eclair-mr2
* changes:
  Don't delete referenced messages from the Exchange server
2009-12-07 21:31:42 -08:00
Marc Blank
c29e435eb3 Don't delete referenced messages from the Exchange server
* Addresses #2287439 incompletely
* The most likely reason for a reply/forward to get stuck in the Outbox
  is that the referenced message has been deleted from the client, with
  the deletion occuring BEFORE the message gets sent (currently, the two
  are completely independent)
* This change causes deletes NOT to be sent to the server if the message
  to be deleted is referenced by an outgoing message

Change-Id: I146f63ab345c07e684790e1d7d1fc08870468bbf
2009-12-07 21:30:59 -08:00
Marc Blank
0e1595c177 Handle unexpected deletion of EmailProvider database
* Addresses #2226426
* If the user deletes Email data, or if data corruption causes
  EmailProvider.db to be deleted, we will be in an inconsistent
  state with any existing Exchange accounts, since the AccountManager
  will still know about them, contacts (and eventually calendar) items will
  continue to exist, etc.
* Run an integrity check when the provider is created, deleting any
  orphaned EmailProvider.db or EmailProviderBody.db
* Catch SQLiteException's in the Provider and do an integrity check
  if any is caught

Change-Id: I47d523b90a6b8f71ba8e13fba4b04846b3da1b1d
2009-12-07 21:12:57 -08:00
satok
3d00377b35 Fix MessageListUnitTests
This is supperement of change,33265

* Move custom cursor to inner static class
* Change public to /* package */
* Move PROJECTION to a package
2009-12-08 13:36:32 +09:00
Android (Google) Code Review
ecfc9e92e5 Merge change Icba56688 into eclair-mr2
* changes:
  Ensure that service calls run outside the UI thread (#2235734)
2009-12-07 19:00:02 -08:00
Android (Google) Code Review
3af9f4cbf3 Merge change I9bec1244 into eclair-mr2
* changes:
  Fix #2300147 (mistakenly reporting connection error)
2009-12-07 10:19:23 -08:00
Vasu Nori
b720ed3183 revert previously submitted CL 34143.
turns out the change I submitted before is not required at all. I mistakenly
assumed sqlite wouldn't be able to handle it. but tested it with the latest
version of sqlite 3.6.20. the old style triggers work fine.
2009-12-03 18:32:58 -08:00
Marc Blank
d3da948c31 Fix #2300147 (mistakenly reporting connection error)
* When a mailbox sync is stopped intentionally (for example, if account
  settings change), we report a connection error by mistake
* Handle this case properly, reporting "success" (i.e. no error state)
* Remove obsolete comment

Change-Id: I9bec1244267cd2240c369b9b7f905948381a0f91
2009-12-03 09:58:56 -08:00
Marc Blank
3379c51569 Ensure that service calls run outside the UI thread (#2235734)
Change-Id: Icba566884f3b994c8a4ccc4b8658c40b133a3509
2009-12-02 15:01:06 -08:00
Android (Google) Code Review
98796942ea Merge change I8e09bde5 into eclair-mr2
* changes:
  change BEFORE triggers to AFTER triggers - to make them work with sqlite 3.6.20 and beyond
2009-12-02 14:42:46 -08:00
satok
4cb25d93a2 Save the state of checkboxes when orientation is changed
BUG: 2239516

* Add tests for save/restore Instance State
2009-12-01 15:41:10 +09:00
Vasu Nori
8e09bde568 change BEFORE triggers to AFTER triggers - to make them work with sqlite 3.6.20 and beyond 2009-11-25 15:38:42 -08:00
Jean-Baptiste Queru
ee0c01548e merge from open-source master 2009-11-24 09:12:36 -08:00
Android (Google) Code Review
d457c744cd Merge change Ic1a2e5b9 into eclair
* changes:
  Fix improper constant to allow retry for sending Exchange mail
2009-11-20 13:32:59 -08:00
Marc Blank
eec04663fe Fix improper constant to allow retry for sending Exchange mail
* Related to MR1 triaged bug 2274389 in which mail was stuck in the
  Outbox and wouldn't send
* It turns out an improper constant was being used in the SQL code
  for turning off the "error" state flag

Change-Id: Ic1a2e5b9dd34ec3f9d7da0b3d2cd63d77bb7681e
2009-11-20 12:10:23 -08:00
Marc Blank
6ba40085d7 am 863e6c40: Handle "send outgoing messages" properly for combined Outbox
Merge commit '863e6c40202fe804d92a263809da74ec1e904e66' into eclair-mr2

* commit '863e6c40202fe804d92a263809da74ec1e904e66':
  Handle "send outgoing messages" properly for combined Outbox
2009-11-20 09:56:03 -08:00
Marc Blank
863e6c4020 Handle "send outgoing messages" properly for combined Outbox
* The "send outgoing messages" button doesn't work in the combined
  inbox (the case wasn't handled)
* Add code to loop through accounts, calling the Controller for each
  in this case
* Fixes (partially or completely) #2274389

Change-Id: I94e984247d43f93a4d6546b8c10f6ce149b091be
2009-11-20 09:46:35 -08:00
Marc Blank
bdb28c1644 Fix #2267475 (NPE when changing incoming settings for EAS)
* When settings are changed, we loop through the sync error map,
  clearing mailboxes in the changed account that are in an error
  state.
* It's possible that there are mailboxes referenced in the map that
  no longer exist.  When trying to retrieve them from the provider,
  null is returned, but we're not checking for this case, and an
  NPE results.
* The fix is simply to check for null, and clear the error map for
  the mailboxId that references a deleted mailbox

Change-Id: I8c1c847090026fa1c53b09bbe6b12d864bce4df1
2009-11-19 09:01:06 -08:00
Android (Google) Code Review
6b93f61eea Merge change Ib35bb866 into eclair-mr2
* changes:
  Don't allow "trash" to be synced (Fixes #2116463)
2009-11-19 08:57:39 -08:00
Marc Blank
6daaf76459 Don't allow "trash" to be synced (Fixes #2116463)
Change-Id: Ib35bb86641b473194fea32b55db328a44de1c67b
2009-11-18 17:20:44 -08:00
Dan Egnor
2da2e4632d Change android.text.util.Regex to com.android.common.Patterns 2009-11-18 12:11:55 -08:00
Elliott Hughes
5e062514bf Move the org.kxml2.wap.Wbxml class into the EAS code, the only user.
(I notice that you already have, for example, an END constant, but with
a different value. Bug?)

Bug: 2249953
2009-11-17 15:10:40 -08:00
Elliott Hughes
b1487a2030 DO NOT MERGE: Back-port 2249953 fix (for email unbundling).
Original check-in comment:
Move the org.kxml2.wap.Wbxml class into the EAS code, the only user.

Dr No approval: danfuzz
2009-11-16 13:26:18 -08:00
Jean-Baptiste Queru
56e48981f0 eclair snapshot 2009-11-12 18:46:09 -08:00
Marc Blank
83b67e6198 Fix #2251837; better response w/ security req'd. DO NOT MERGE
* Currently, we validate EAS accounts using a command that will
  succeed even if we do not support required security policies.
* This causes a confusing "invalid username or password" error
  when trying to sync with a validated account in the case that
  there are, in fact, required policies
* The fix is to send a sync command after validating the user name
  and password; a 403 error indicates the requirement for
  security policies.
* When we see the 403 error, we put up a message that is appropriate
  to the situation.

Change-Id: I74e132cb81f021cbb697cc9ee146405bf3ebc0ba
2009-11-11 14:40:35 -08:00
Marc Blank
29935abb1c Fix #2251837; better response when provisioning is required.
* Currently, we validate EAS accounts using a command that will
  succeed even if we do not support required security policies.
* This causes a confusing "invalid username or password" error
  when trying to sync with a validated account in the case that
  there are, in fact, required policies
* The fix is to send a sync command after validating the user name
  and password; a 403 error indicates the requirement for
  security policies.
* When we see the 403 error, we put up a message that is appropriate
  to the situation.

Change-Id: Ic40820253dca1f357297b2355ad987bc39d0775f
2009-11-10 16:29:10 -08:00
Marc Blank
151ebde5d1 Allow sync data via the chunked transfer encoding DO NOT MERGE
* Fixes #2216885
* The bug is that the sync adapters weren't set up to handle chunked
  encoding, primarily because 1) I hadn't seen any servers use it, and
  2) when we changed from HttpUrlConnection to HttpClient, support for
  chunked wasn't added (HttpUrlConnection didn't support it)
* The fix for xml data is trivial, since the Content-Length returned in
  the chunked case (-1) was being disallowed, but works perfectly well
  with HttpClient.
* The fix for attachments is less trivial, but still straightforward.
* With this change, we are no longer dependent on receiving content-length,
  which is highly desirable

Change-Id: I8d46790e41eaeee2887c8a207006c5d6786498ed
2009-11-04 18:11:24 -08:00
Marc Blank
038be0fc4d am c5ec3d0b: Merge change I2eee4ddc into eclair
Merge commit 'c5ec3d0bce03de10c4bb1bc5cf013494c6d62947' into eclair-mr2

* commit 'c5ec3d0bce03de10c4bb1bc5cf013494c6d62947':
  Improved fix for #2189704 (sync loss)
2009-11-04 14:53:35 -08:00
Android (Google) Code Review
c5ec3d0bce Merge change I2eee4ddc into eclair
* changes:
  Improved fix for #2189704 (sync loss)
2009-11-04 17:45:11 -05:00
Marc Blank
d676ab6a98 Improved fix for #2189704 (sync loss)
* The prior fix prevented looping in the case that a new sync key wasn't
  received.
* Unfortunately, the prior fix tested for the looping condition (moreAvailable)
  before it would have been set.
* The correct fix is to detect the looping condition after both the sync key
  and the moreAvailable flag are guaranteed to have been set

Change-Id: I2eee4ddc123fb2a5ce4ef3bd4e7d0614fcfbdf36
2009-11-03 18:11:02 -08:00
Marc Blank
ccd29c33ed Allow sync data to arrive via the chunked transfer encoding.
* Fixes #2216885
* The bug is that the sync adapters weren't set up to handle chunked
  encoding, primarily because 1) I hadn't seen any servers use it, and
  2) when we changed from HttpUrlConnection to HttpClient, support for
  chunked wasn't added (HttpUrlConnection didn't support it)
* The fix for xml data is trivial, since the Content-Length returned in
  the chunked case (-1) was being disallowed, but works perfectly well
  with HttpClient.
* The fix for attachments is less trivial, but still straightforward.
* With this change, we are no longer dependent on receiving content-length,
  which is highly desirable

Change-Id: Ie3bd6af0cf68f3afa190711d96b1dbd2e6341f79
2009-11-01 13:48:31 -08:00
Marc Blank
e7965e975f am 1e1d7cb1: Merge change Ie2804ddc into eclair
Merge commit '1e1d7cb189e7ea7164d1335539d68d3d3ca8c0e5' into eclair-mr2

* commit '1e1d7cb189e7ea7164d1335539d68d3d3ca8c0e5':
  Fix #2225869 (Regression in attachment loading / Exchange 2003)
2009-10-30 14:33:58 -07:00
Android (Google) Code Review
1e1d7cb189 Merge change Ie2804ddc into eclair
* changes:
  Fix #2225869 (Regression in attachment loading / Exchange 2003)
2009-10-30 17:26:46 -04:00
Android (Google) Code Review
68942b93a4 Merge change I9733dc5d into eclair
* changes:
  Fix folder deletion; support folder rename (#2118439) DO NOT MERGE
2009-10-30 13:54:55 -04:00
Marc Blank
05dfc20853 Fix #2225869 (Regression in attachment loading / Exchange 2003)
* The fix to bug #2191778 inadvertently broke attachment loading for
  Exchange 2003 servers; the server responds with a 403 error (indicating
  an authentication issue)
* All other communications with the server work properly
* We use a slightly different set of calls in the case of attachments (we
  wanted to change as little as possible in the fix to #2191778) than we
  do in the other cases
* The fix here is to use the same calling sequence for attachments that we
  use elsewhere
* This fix has been observed to work on multiple servers, and in various
  SSL scenarios (on/off, trusted/untrusted)

Change-Id: Ie2804ddcbfa2b10edff42f7a3811734c325e933d
2009-10-29 20:10:46 -07:00
Marc Blank
94d2e99581 Fix folder deletion; support folder rename (#2118439) DO NOT MERGE
* Folder delete had a subtle error that could cause subsequent folder
  changes in the same sync to fail (using wrong end tag)
* Folder change (rename, move) wasn't implemented; this was added and
  tested.  The change is very straightforward and low risk.

Change-Id: I9733dc5da1a535c388e2feb299a641642ba531c2
2009-10-29 12:19:57 -07:00
Android (Google) Code Review
0911d6290f Merge change Id69cee9b into eclair-mr2
* changes:
  Fix folder deletion; add support for folder rename (#2118439)
2009-10-29 15:06:56 -04:00
Marc Blank
d2cc832782 Fix folder deletion; add support for folder rename (#2118439)
* Folder delete had a subtle error that could cause subsequent folder
  changes in the same sync to fail (using wrong end tag)
* Folder change (rename, move) wasn't implemented; this was added and
  tested.  The change is very straightforward and low risk.

Change-Id: Id69cee9b99e9a988a176a6525ba9a1615b741c44
2009-10-29 12:03:39 -07:00
Android (Google) Code Review
9abd1bf9da Merge change I21052e28 into eclair-mr2
* changes:
  Controller: modify the test for "attachment already loaded".
2009-10-29 09:34:43 -04:00
Mihai Preda
6bb7c7248a MessageView: disable reply&forward for Trash messages.
Bug 2170118
2009-10-29 14:11:10 +01:00
Android (Google) Code Review
0054c1a9e6 Merge change If12d0e7c into eclair
* changes:
  Go to combined inbox on notify for 2+ accounts (#2147265) DO NOT MERGE
2009-10-28 13:56:10 -04:00
Android (Google) Code Review
2533132c84 Merge change Ic29d3eac into eclair
* changes:
  Server validates even though server address is wrong DO NOT MERGE
2009-10-28 13:55:43 -04:00
Marc Blank
5d4bb79044 Go to combined inbox on notify for 2+ accounts (#2147265) DO NOT MERGE
* The problem is that PendingIntents aren't updated when a notification
  is updated, so the changed extras when a 2nd account gets a new message
  aren't seen by MessageList when it's started up upon tapping the
  notification (it uses the extras from the 1st account to get a new
  message)
* The fix is to use the newish (cupcake) flag in the PendingIntent that
  causes the extras in the PendingIntent to be updated

Change-Id: If12d0e7c6d3f256befeca98b560443395820737f
2009-10-28 08:57:45 -07:00
Marc Blank
e53de6985a Server validates even though server address is wrong DO NOT MERGE
* Fixes #2173664
* Make sure that not only is the OPTIONS command accepted, but that
  the server reports EAS versions and commands

Change-Id: Ic29d3eacfdc54d107600afc443964a1e8b3d5e59
2009-10-28 08:53:57 -07:00
Marc Blank
ea5b93d9b8 Handle moreAvailable true w/o changes (#2189704) DO NOT MERGE
* An Exchange log from Moto has shown sync behavior in which moreAvailable
  is set to true even though there are no changes in the sync response
  (i.e. the SyncKey is unchanged)
* This leads to long-lived looping which impacts battery life
* The fix is to recognize the behavior and prevent looping by
  setting moreAvailable = false

Change-Id: Icf45efbc24331c874c820b7b177e39b16df445d8
2009-10-22 14:49:26 -07:00
Mihai Preda
9ef6f645f5 Controller: modify the test for "attachment already loaded".
Bug 2192510.

update unit test.
2009-10-22 19:27:59 +02:00
Android (Google) Code Review
da08e3bcb6 Merge change I218079f2 into eclair-mr2
* changes:
  Fix timing-dependent crash in Medium tests (#2202726)
2009-10-21 18:44:47 -04:00
Marc Blank
d16b4b921f Go to combined inbox from notification for 2+ accounts (#2147265)
* The problem is that PendingIntents aren't updated when a notification
  is updated, so the changed extras when a 2nd account gets a new message
  aren't seen by MessageList when it's started up upon tapping the
  notification (it uses the extras from the 1st account to get a new
  message)
* The fix is to use the newish (cupcake) flag in the PendingIntent that
  causes the extras in the PendingIntent to be updated

Change-Id: Ia4ab14954b2c1413526016975216b2516372f2aa
2009-10-21 13:51:16 -07:00
Marc Blank
38203a3fde Fix timing-dependent crash in Medium tests (#2202726)
Change-Id: I218079f24f1ce08d770624d1272e1d9a46c1be26
2009-10-21 12:41:57 -07:00
satok
3045bb967f Add view of all counts in AccountFolderList
BUG: 2201097
2009-10-21 07:19:10 +09:00
Android (Google) Code Review
528fa1bbca Merge change Icabbe5fe into eclair-mr2
* changes:
  Fix #2159410 (side-effect of unexpected account deletion)
2009-10-20 15:01:54 -04:00
Marc Blank
c1b8efad50 Fix #2159410 (side-effect of unexpected account deletion)
Change-Id: Icabbe5fe5c417ff72b542eff7a54c658814d482b
2009-10-20 10:51:08 -07:00
Marc Blank
367963639d Fix SQL for upgrade from ver 6 to ver 7 of Email database
Fixes #2196917

Change-Id: Ia403e50e9ec4ea553d38ded656bba769a4a4dd18
2009-10-20 10:11:26 -07:00
satok
4bc81bb286 Fix build breakage 2009-10-20 04:19:21 +09:00
Android (Google) Code Review
ba78d18f59 Merge change I23b7f225 into eclair-mr2
* changes:
  Clean up appearance of unread counters
2009-10-19 14:20:01 -04:00
satok
fa368b50d6 Clean up appearance of unread counters
BUG: 2161746
2009-10-20 03:18:27 +09:00
Marc Blank
3a88e2c35c am 55a97fc3: Fix attachment loading with "accept certificates" checked
Merge commit '55a97fc360ac549631af3aa3aad9833812674562' into eclair-mr2

* commit '55a97fc360ac549631af3aa3aad9833812674562':
  Fix attachment loading with "accept certificates" checked
2009-10-19 10:40:15 -07:00
Marc Blank
55a97fc360 Fix attachment loading with "accept certificates" checked
* Fixes #2191778 (P1/S1)
* Attachment retrieval wasn't using newer code to create its
  HttpClient.
* Fix is simple, extremely safe

Change-Id: I65be27decae8719bbad8ac7dce1c1164de4371a5
2009-10-19 10:34:10 -07:00
Android (Google) Code Review
dc9bc35bb1 Merge change Idef455f3 into eclair-mr2
* changes:
  Handle case of moreAvailable true with no changes (#2189704)
2009-10-15 16:28:19 -04:00
Marc Blank
288bb26ab8 Handle case of moreAvailable true with no changes (#2189704)
* An Exchange log from Moto has shown sync behavior in which moreAvailable
  is set to true even though there are no changes in the sync response
  (i.e. the SyncKey is unchanged)
* This leads to long-lived looping which impacts battery life
* The fix is to recognize the behavior and prevent looping by
  setting moreAvailable = false

Change-Id: Idef455f3e1170caf4002542ca432d128b3a19e56
2009-10-15 12:11:39 -07:00
Android (Google) Code Review
f095e9df5a Merge change Ib53e4411 into eclair-mr2
* changes:
  Clear out orphaned messages in updates/deletes tables
2009-10-15 15:03:41 -04:00
Marc Blank
ef83299b99 Clear out orphaned messages in updates/deletes tables
Case #1:
* Fixes #2184702
* Messages can be in the base Messages table, but also in
  Message_Deletes and Message_Updates; the latter two were not
  being purged of deleted messages.
* This CL deletes from all three tables when a Mailbox is deleted
* Also run a check for orphaned deletes/updates when the email
  provider's db is first opened
* Unit test updated to check for proper deletion
* Unit test for the provider check for orphans

Case #2:
* Fixes #2184708
* Messages in Outbox/Drafts can get modified or deleted, but the
  rows added to the updates/delete tables never get removed because
  the boxes don't sync
* Added code to SyncManager.ping (which gets notifications of these
  changes) to delete these rows

Change-Id: Ib53e441136b0da1e88bc220150d631999058a8f0
2009-10-15 10:58:00 -07:00
Mihai Preda
3afd66cda8 MessageCompose: disable "save as draft" button logic.
Bug 2184404
Disable "save as draft" button when there are no changes to be saved.
2009-10-15 12:09:38 +02:00
satok
347a44af56 Fix the bug that the count of draft and trash icons are wrong.
BUG: 2159565

* Currently only the number of unread messages is shown.
* Fixed to show the number of all messages
2009-10-15 10:01:13 +09:00
Andrew Stadler
53123c2f91 DO NOT MERGE. Prevent duplication of POP3 attachments
* For each attachment we add, check the DB for an existing attachment
  with similar metadata (name, mime type, content id, etc.)
* Skip adding them if already held
* Unit tests

Originally fixed in 5b0a12c199 / CL I036f39c6

Fixes bug http://b/2084704
2009-10-14 12:41:05 -07:00
Android (Google) Code Review
196f6187bb Merge change I036f39c6 into eclair-mr2
* changes:
  Prevent duplication of POP3 attachments
2009-10-14 13:21:26 -04:00
Andrew Stadler
5b0a12c199 Prevent duplication of POP3 attachments
* For each attachment we add, check the DB for an existing attachment
  with similar metadata (name, mime type, content id, etc.)
* Skip adding them if already held
* Unit tests

Fixes bug http://b/2084704
2009-10-14 08:20:59 -07:00
Andrew Stadler
e3e02adac6 am dee4e253: Do not trust server-provided content type for attachments
Merge commit 'dee4e25320c5154a5626446e1aa37f63ae97c48c' into eclair-mr2

* commit 'dee4e25320c5154a5626446e1aa37f63ae97c48c':
  Do not trust server-provided content type for attachments
2009-10-14 07:37:12 -07:00
Andrew Stadler
dee4e25320 Do not trust server-provided content type for attachments
* Fixes a bug that caused some attachments to be labeled with the
  wrong content type and thus unable to be opened by local apps.
* When the attachment code was written, MimeTypeMap had very few
  entries, so we tried to get the mime type of Exchange attachments
  from the stream when the file was read off the server.  It turns
  out that the server's idea of mime type is unpredictable
* In the meantime, MimeTypeMap has been fleshed out, so we really
  do know the type in the vast majority of cases (and including all
  common document types)
* The fix is to remove the lines related to reading the mime
  type from the attachment stream
* Content type is set (properly) when attachment record is created.  See
  EasEmailSyncParser.getMimeTypeFromFileName() for details.

Fixes bug http://b/2182955

Change-Id: Iebb3de529df4548327d7112e1dedb3bd448462a4
2009-10-13 21:09:40 -07:00
Marc Blank
7cfda60b2b am 4e424a33: Merge change Ie093215f into eclair
Merge commit '4e424a33c29446d750790e360e43fb7c83ec0c6f' into eclair-mr2

* commit '4e424a33c29446d750790e360e43fb7c83ec0c6f':
  Add truncation at 100k (EAS 2.5) and 200k (EAS 12) (#2184807)
2009-10-13 14:46:04 -07:00
Android (Google) Code Review
4e424a33c2 Merge change Ie093215f into eclair
* changes:
  Add truncation at 100k (EAS 2.5) and 200k (EAS 12) (#2184807)
2009-10-13 17:39:59 -04:00
Andrew Stadler
b7c67a0124 am 754240bc: Fix race condition in testMultiple()
Merge commit '754240bcf3ccc8492a50ba9ee8056b34f6e4e8d0' into eclair-mr2

* commit '754240bcf3ccc8492a50ba9ee8056b34f6e4e8d0':
  Fix race condition in testMultiple()
2009-10-13 12:43:20 -07:00
Marc Blank
5fd81cad4c Add truncation at 100k (EAS 2.5) and 200k (EAS 12) (#2184807)
* Prevents OOM errors with huge message bodies

Change-Id: Ie093215f96a514b3a1bcd31aa1f5957d1ada7719
2009-10-13 12:06:47 -07:00
Andrew Stadler
754240bcf3 Fix race condition in testMultiple()
* If we close the activity while a requeryList() is pending in the
  handler queue, we'll eventually try to operate on a closed cursor
  when we get to testMultiple().
* The fix: Return immediately if the cursor is not available.

Fixes bug http://b/2180416
Followup for bug http://b/2149083
2009-10-13 12:02:46 -07:00