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
* 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.
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)
* 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
* 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
* 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
* 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
* 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
* 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".
* 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
* 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).
* 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
* 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
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
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
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
Per code review suggestions, clean up exception handling, and add
commentary to make intended behavior more explicit.
Followup to: 0434fef1f6
Bug: 2413388
* 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
* 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
* 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
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.
* 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
* Added support for reminders and recurrences
* Note that Duration class is copied from CalendarProvider with only
formatting changes
Change-Id: Icf399df422f813ba8e7880646bfbc96a2156a204
* 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
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
- 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
Merge commit '08d92ebf4722e45216ee225775a3b86f9ceecc0d'
* commit '08d92ebf4722e45216ee225775a3b86f9ceecc0d':
Trim the mime type portion of Content-Type.
* 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
* 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
* 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
* 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
* 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
* 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
Merge commit '85d765f41c20e6efb3b120055eb4f1efae166e8b' into eclair-plus-aosp
* commit '85d765f41c20e6efb3b120055eb4f1efae166e8b':
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
* 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.)
* 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
* 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
* 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
Merge commit 'd1c56ea144fb3e91ad1fdf8bba4c57531ec9cc18' into eclair-plus-aosp
* commit 'd1c56ea144fb3e91ad1fdf8bba4c57531ec9cc18':
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
* 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
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.)
Merge commit '78f609db56500c01f75ea2d8742468907255f7ba'
* commit '78f609db56500c01f75ea2d8742468907255f7ba':
MessageView: upon delete move to older instead of newer.
Merge commit '9d024a5b4f42d9d7687d06e5f86f9c68f22fccf8'
* commit '9d024a5b4f42d9d7687d06e5f86f9c68f22fccf8':
MessageCompose: fix NPE cased by WebView set to null in onDestroy().
MessageListAdapter.doRequery() is supporsed to do the same thing as CursorAdapter.onContentChanged() does. So the entire method body can be replaced with super.onContentChanged().
Merge commit '27051e480f9cc5396aacc3cc5e520d5875390548' into eclair-plus-aosp
* commit '27051e480f9cc5396aacc3cc5e520d5875390548':
Use correct EAS version in Outbox (fixes#2319892) DO NOT MERGE
Merge commit 'bfc5de35fa08b6e747e5d5afe72bffafca08ce2a' into eclair-plus-aosp
* commit 'bfc5de35fa08b6e747e5d5afe72bffafca08ce2a':
Fix delay sending mail after tapping "Send outgoing mail" DO NOT MERGE
Merge commit 'c874824ca8b76f795575538ffa34138e2de47cad' into eclair-plus-aosp
* commit 'c874824ca8b76f795575538ffa34138e2de47cad':
Don't delete referenced messages from the Exchange server DO NOT MERGE
* 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
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.
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
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.
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* Fixes#2173664
* Make sure that not only is the OPTIONS command accepted, but that
the server reports EAS versions and commands
Change-Id: Ic29d3eacfdc54d107600afc443964a1e8b3d5e59
* 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
* 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
* 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
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
* 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
* 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
Merge commit 'dee4e25320c5154a5626446e1aa37f63ae97c48c' into eclair-mr2
* commit 'dee4e25320c5154a5626446e1aa37f63ae97c48c':
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
* 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