We're using the mock context to prevent modifying the real databases. However,
we need the real context to create intents. Use the real context in the few
places we must use it.
Change-Id: Icb8d289239218921c0b4b5c93ac7983830d90394
- Extracted the loader
- Extracted ViewType and introduced WidgetView.
WidgetView is ViewType + mutable fields, such as account id.
WidgetView now owns the method to switch views.
These two are basically in preparation to address the message count bug.
(we're showing total message count where it should be the unread count,
which is a bit tricky because it'll require two different queries.)
- Also simplified the threading model in EmailWidget to fix potential
theading issues. (now (almost) everything works on the UI thread)
Bug 3431240
Change-Id: I9f8a268210995f1135baabe88b49b274272708d4
The delete policy can only be set for POP3 accounts. However, the delete policy
is used for all legacy accounts (that includes IMAP). As such, we need to make
sure IMAP accounts also have their policy set; even though the setting is not
configurable by the user.
The delete policy does not mean anything for Exchange accounts, so, we do not
need to modify the account setup code for them.
bug 3074164
Change-Id: Iab10d2997404b3b0c10a60a64fb652540c0d2d1a
There were extra parens in the SELECT sql command. These have been
removed from production code, so, the test needs to be updated as
well.
bug 3456577
Change-Id: I7fcfd326c17fd732ecfd3cd77f6e583106afa287
* Make "Exchange" option in account setup depend upon availability of the
Exchange EmailService
* Make presence of Exchange logging depend upon availability of the
Exchange EmailService
* Make AttachmentDownloadService use service rather than ExchangeService
class
* Move SSLUtils to emailcommon/utility
* Move account manager type defs to emailcommon/AccountManagerTypes
* Update proguard.flags
* This is the penultimate CL for the Email package itself; the next CL
creates a clean, SDK-compatible Email application
Bug: 3442973
Change-Id: I9162cf5fa6b5a043ded0fdd1e25fd3ce5948ad8f
* There are three pieces to this CL (sorry):
1) Move and/or rename some constants into emailcommon
2) Move Utility to emailcommon, moving the few UI
related utilities back into Email (FolderProperties
and UiUtilities)
3) Remove all references to resources from emailcommon
* The three pieces relate in that, between them, they allow
the emailcommon static library to compile cleanly
Bug: 3442973
Change-Id: Ic5e3abaa2a1b36999e0b6653c6c2134ea1bd544f
We support two different ways for an IMAP prefix to be specified:
1. A text field on the IMAP configuration page. This is the most obvious to
the end user. It is also an explicit, manual configuration.
2. RFC2342 defines a NAMESPACE IMAP command to be able to query the prefix
from the IMAP server. This is an automatic configuration without any
user involvement (i.e. the UI will NOT change if a prefix is loaded in
this way)
If the user goes to the trouble of specifying a prefix, we will always honour
it instead of the namespace returned by the IMAP server -- even if the user's
configuration is wrong.
bug 1592696
Change-Id: I6b94c7aaac538f6cd9dc4694b0f1634e8c956bc1
* No code was harmed, er, changed in the making of this CL
* All that's happened is that code that is needed by both Email and
Exchange have been moved into emailcommon
* This required import changes to many files, which explains the
length of the CL
Change-Id: I4e12455ba057a4a8054fdbd0b578c73afa411c8a
* Create AccountService.aidl and AccountServiceProxy in emailcommon
* Implement AccountService in email
* Use AccountServiceProxy in Exchange for account reconciliation,
notifications, etc.
* Move sync window constants into emailcommon
* Split attachment provider utilities and constants into emailcommon
Bug: 3442973
Change-Id: I89dce28b799b193243c07774dab65d830ae62775
* Split PolicySet from SecurityPolicy and move to emailcommon
* Define PolicyService that sync adapter services can use to
interact with the Email DPM administrator
* Implement PolicyServiceProxy for exchange
* Implement PolicyService in email
* Modify imports, references, etc. as required
Bug: 3442973
Change-Id: I92015e21f780a68754b318da89fbb33570f334a2
- Moved to com.android.email.widget
- Extracted nested classes to top-level classes
- Some small clean-ups.
- WidgetProvider and WidgetProvider$WidgetService are left in the original
package to keep compatibility with honeycomb (3.0) release.
This CL is supposed to be pure-refactoring. There should be no
functionality changes.
Change-Id: I37acaa24b6b488724750c0f33374b31fcc433f11
Attachments with no extension and mime type of text/plain need to return the
mime type of "text/plain" instead of "application/octet-stream"
bug 3428076
Change-Id: I00452c908ac0672879d42f4ed9ee574e376eac9f
* the new mailbox queries will only catch message that are
"loaded"; by default, messages were created "unloaded", so,
the query was returning 0 results
* extra parens were removed from the query string; the text
needed to be updated to not check for the extra parens
bug 3428077
Change-Id: Iea5867e741b9673985ca020aa3a8425c061324bf
The new query will only select attachments if their associated message is in
the loaded state. The unit tests need to add the messages to the loaded state.
bug 3428076
Change-Id: Ib4ad8b2570a2cdc042b932b10dbaa3170ab825cd
* Remove LocalStore (pre-2.0 mail database) and its unit test
* Remove UpgradeAccounts (converted pre-2.0 accounts to Provider)
* Remove FolderMessageList (receiver for pre-1.6 desktop shortcuts)
* Remove "upgrading" paths through LegacyConversions
* Clip out dangling references to everything above
Bug: 3292310
Change-Id: I5654d55a0879b00b05b63055b94651855a8ee3ef
This makes it easier for cache experiments to swap out the
LinkedHashMap for another cache.
http://b/3184897
Change-Id: Iacdb266e41f5a98efd9bb30bc09ff8fff5a0a5a9
Only send IMAP ID to servers that include ID in the CAPABILITY response.
Always sending IMAP ID was found to cause problems with some servers.
Better compliance with RFC 2971.
Thanks to Samsung for debugging & reporting this.
Change-Id: I495f80949f9f811470853a1f2f8e506d8236d8cf
The problem was that CombinedMailboxesLoader used the cursor returned by
super.loadInBackground() (which contains accounts), to build a matrix
cursor (which contains special mailboxes and accounts and will be returned),
and *it closed the first cursor* after building the matrix cursor.
However, because this first cursor is the one that CursorLoader sets an
observer, it shouldn't be closed until the returned matix cursor closes.
In other words the two cursors should have the same lifecycle.
Fixed it by using ClosingMatrixCursor that used by AccountsLoader, which
is doing a similar thing, but properly.
Bug 3387730
Change-Id: I554ade001dc25afa869eefb4dcf9887495e6753e
If the server reports an attachment's mime type as either text/plain or
application/octet-stream, we will try to infer the real mime type using
the attachment's extension. If one cannot be found, we either synthesize
it (if original mime type is application-octet-stream), or, we use the
server specified mime type (if the original is text/plain).
bug 3379416
Change-Id: I331e767ed36e4e17756025cc816bdb7b5a8f0868
The various selection strings were missing a test to only show messages that
have been loaded. This is only important for POP3 accounts.
bug 3377041
Change-Id: I3efe366d09dd547878dc0bf57dff58f76de5cca9
While fixing bug 2981433 in Gingerbread, I discovered one additional
place where passwords were being trimmed. This brings the fix forward
into honeycomb, as well as a new unit test for the fix.
Bug: 2981433
Change-Id: I566f5c0c6693ca7c0069bca9e74f320fca48e600
When creating the list of attachments to be automatically downloaded in the
background, exclude any attachments that are not in an inbox. Also added unit
tests to ensure the query URIs behave as expected.
NOTE: This is a partial fix for general background attachment downloading issues
bug 3373982
Change-Id: I13ef56cd280c028fa966ab9e655acce28b0b9b91
* Use ConcurrentHashMap; check that this provides enough protection
for all uses
* This resolves known deadlock issues in ExchangeService
Bug: 3371039
Change-Id: Ie4ccbe7cdfe8c3d4ec7a0f789409126c8c09f8c4
Intent-filter's mime-type matching is case-sensitive. We should always use
lowercase letters.
Bug 3375709
Change-Id: Idd4abb41f94c816a5b9150aef5859dd75487a042
The "?limit=" param is only supported by EmailProvider, so don't add
it to other URIs.
Doing so causes a permission error when opening an EML attachment on gmail,
because we're granted the permission only to the passed URI, but not to
the URI with the "?limit=" param.
Bug 3371630
Change-Id: I88fff88a7e48e5bc958124eedec3e592978a40c7
Use a sub-selection to limit the messages from the inbox. Also add a unit
test to ensure the selections are working correctly.
bug 3368613
Change-Id: Ia24ef6028ded27c69f982ecbc6b67f35f84d1b6d
* This fixes the case of:
* a device that does *not* support device encryption
* connecting to an account that *does* require device encryption
* but also supports "non-provisioned devices" (making the encryption
requirement optional.)
* Added unit test
Bug: 3367191
Change-Id: I894e68c4119a102dad02d2e0815fccdae1e87189
instead of showing all messages (e.g. messages in drafts, etc...) the "combined
inbox" view now only messages in the inbox folder. This is now identical to
the "combined inbox" view available in the full email UI.
bug 3368613
Change-Id: I0080b56cd2718a3dce82b279277c63c4f43e86dc
The problem was that we tried to upgrade the db by re-creating a LocalStore,
without closing the existing connection. The db was still upgraded on the
filesystem, but the old connection kept looking at the old table definition
for whatever reason.
Also cleaned up checkAllTablesFound(). It now shows what columns are
missing when failed.
Bug 3349973
Change-Id: I80f4c67f1bd61cd5e1f12a632978b36a6e0a3b19
Also show the *total* starred message count (excluding trashed starred)
in the mailbox list, not *per-account* starred count.
Bug 3346872
Bug 2149412
Change-Id: I2274f215f994b62280ac6138982b927cec22c677
* Add encrypted-storage to uses-policies
* Add new field to PolicySet
* Add "false" to all constructor callers
* Add unit tests (including fixing some existing unit tests)
* Add new logic to AccountSecurity activity t0 dispatch both password
and encryption requests.
Bug: 3346641
Change-Id: I54f39bc9b6fbe21c033a05b36b83081e5c78a296
* Open up all types for view/save rules
* Add anti-malware block list (based on extensions)
* Clean up code that shows/hides view & save buttons
* Redo handling of load/cancel 1sec timer
* Unit test for new little utility
* Allow larger items when on wifi
Bug: 3338984
Bug: 3334950
Bug: 3338988
Bug: 3340835
Change-Id: I991135636d507f2660e2860720dbed21bd1a955b
Still waiting for a few missing assets, but it's done other than that.
The divider change is already merged; new layouts all use the framework style.
It's basically all layout changes, except for:
- Now the recepient address line has "Show details", which shows a dialog with
all to/cc/bcc addresses with the timestamp.
- Now invite response buttons are checkboxes.
(But the basic behavior doesn't change -- once you check a response,
the message will be gone, so you can't change the response later.)
Copied message_header_bg from gmail manuall. It'll look silly without it.
Bug 3138021
Bug 3307021
Change-Id: I6f7eb91d6104c3143a5c58b0c4c6c19929cea477
* Stop running syncs
* Delete all EmailProvider data except the account itself (with
cleared sync key) and the account mailbox (necessary for syncing
to sync after security hold is lifted
Bug: 3245779
Bug: 3253952
Change-Id: Idc208ef5ed85808b085ebab9c26a428fb0451e34
Use the new icons where appropriate. This is not a complete change as there are
still some icons missing.
Change-Id: I51d1458749343ddfc6456dc2a9853b8bc2540e26
* Add simple sanity checks to scanned accounts, skip over if bad
* Fix existing unit tests and add new unit test for this change
* Also fixed minor bug in EmailContent that was never triggered in
production code (only discovered it via a unit test).
* Also fixed minor bug in an existing unit test
Bug: 2937595
Change-Id: Id60bbb5d8bd923db043d46891c7f89d7debb0a11
* Update MockTransport to allow TLS connections
* Test TLS connection in ImapStore unit tests
* The bugfix: Re-query capabilities after closing/reopening parser for TLS
(Note: Actually, this is required by the IMAP RFC 3501, 6.2.1)
Bug: 3315939
Change-Id: I51f838043e87750b5712a1bd2e4f9c821b58c808
* In query of an otherwise valid URI with -1 as an id, simply return
an empty cursor
* Add unit test to verify proper handling of invalid uri's
Bug: 3183245
Bug: 3292080
Change-Id: Ia0c35cbd0f5dd0dc4a8fc794226399644cf1fe13
* Create sync & async versions
* Rename all callsites so sync is very apparent
* Fix callsites appropriately
* Clean up interaction between reconciler and setServicesEnabled
Bug: 3133770
Bug: 3134677
Change-Id: Iefbc7814d9aa390baea6345e450e2a4768bf0a9a
* Move each worker into async (combining common code)
* Update unit tests to match
* Make the message->account->controller lookups more efficient
Bug: 3134653
Change-Id: Icc82998a5d8eb07c7ebc7edbd28cd9308378d866
* Make most calls to AccountBackupRestore return immediately w/o DB access
* Move most workers in MailService into async runnables
* Remove account restore / null check from ACTION_SEND_PENDING_EMAIL
* Strengthened unit test on Mailbox.findMailboxOfType() because after
removing the account check (above), sendPendingMessages depends on
findMailboxOfType() returning -1 on a missing account.
* Clean up a bunch of warnings (no longer use deprecated Config.LOGD)
Bug: 3133763 (and probably others)
Change-Id: Id39707bca7a8ebf5000f84d542013411ff0f422e
* Check content-disposition and restrict to these two types
* Add unit test
* Reformatting collectParts (code style cleanup)
Bug: 3242502
Change-Id: I5dcbdda5d4788502113771f4fd1b5fff834a402d
- Now ProviderContextSetupHelper.getProviderContext() invalidates DB cache
* MailboxAccountLoaderTestCase
- Save hostauth properly
- (ProviderContextSetupHelper invalidates cache before each test)
Bug 3280911
* SmtpSenderUnitTests
- Use ProviderContextSetupHelper to create isolated context,
which now also invalidates DB cache
Bug 3280913
* MailboxFinderTest
- When kicking Controller.Result methods directly from tests,
call the raw callback, rather than the one wrapped with
ControllerResultUiThreadWrapper, to make it synchronous.
Bug 3280898
* MessageViewTest
- Disable testOpenMessage()
This test doesn't work because it sets up test data in an isolated
context but the activity/fragment don't see them because they
use the real context.
I have no idea why it worked before... Maybe because there were
accounts/mailbox/message with the same ID in the DB by chance.
Bug 3280905
Change-Id: I6beb08c58fff102e90bebd2c35f70820268b9e62
* Load attachments in the background for IMAP/EAS messages
* Download an attachment from account X if:
1) 25% of total storage free
2) Attachments for X use < 1/N of 25% of total storage, where N is
the number of AccountManager accounts
* Add accountKey to Attachment table for performance
Change-Id: I913aa710f34f48fcc4210ddf77393ab38323fe59
- Added accountId to loadAttachmentCallback/loadMessageForViewCallback
- Cleaned up LegacyListener/MessagingListener.
Removed the constructors which take messageId and attachmentId, which
are used to bridge loadAttachmentProgress, which the callsite doesn't know
these IDs. The inconsistency (only loadAttachmentProgress() uses the member
messageId) doesn't look too good, so extracted this into a separate class,
MessageRetrievalListenerBridge.
Change-Id: I46303e50df2b0e1fe8616e7c9cef632ac14f23aa
A recent change was short-circuiting the logic that loads
the UI from the account. This fix simply resets the flag
so the test can reload the UI multiple times as it tests things.
Change-Id: I7cc53e2766b78172e5a7b05088e94fdec99ae0d6
* Makes things simpler for UI state on a wiped account
* Also wipe sync keys from remaining account & inbox
* Unit tests
Bug: 3245274
Bug: 3245779
Change-Id: I74cc6d7859dad54961426b70ffe0541ce49e3b91
* Set aggregated expiration values with DPM
* Fix min/max logic when aggregating, and fix unit test
* Add expiration tests when checking if policies are active
* Add expire-password to uses-policies set
* Handle password refresh (clear notifications and sec. holds)
* Handle password expiration (warning and/or wipe synced data)
* Unit tests for provider-level methods
* Refactor common security notification logic
* Placeholder notification strings (need final)
Bug: 3197935
Change-Id: Idf1975edd81dd7f55729156dc6b1002b7d09841f
- Set "Viewing FILENAME" as title.
- Home icon now has "back" arrow. Closes the activity when clicked.
Bug 3221312
Change-Id: I689499e10704d3c5d206df4aa12e21db9687c4c5