for the selected message.
This also fixes wired background flicker when you long-press.
(Apparently you can't share StateListDrawable among multiple items...)
Change-Id: I922f50a5b2a33731919e26a55bd3537d55057af5
Now it should be close enough...
Also fixed the "selected mailbox won't get hilighted" issue.
Bug 3137965
Change-Id: Ifba83783121e62363fac6428534394d2e0a4bee9
* Sending too many mailboxes to EmailProvider in a single batch can
lead to a binder exception, so we limit them
* Move all provider updates into the commit() method
Bug: 3325331
Bug: 3314442
Change-Id: I1bd8d19a96f642b6e49e2f47a5ddcebaa55c0ec0
* 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
I'm not yet 100% sure what's going on, but the old code, not stopping
the scheduled forceLoad() in onReset() is apparently wrong.
onReset() is a new callback introduced in the recent loader change, so
this can explain why it started after the change.
Also, call super.onContentChanged() instead of directly calling forceLoad(),
as Loader.onContentChanged() now does more than just calling forceLoad.
Bug 3308465
Change-Id: Ica46bf994b571a26dd532734307a5c7ec6df0268
* 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
* DeviceAdminReceiver is actually a BroadcastReceiver, must follow
guidelines to prevent ANR or early process kill.
* Remove all uses of AsyncTask from DeviceAdminReceiver
* Pass all calls through EmailBroadcastProcessorService
* Minor restructuring of EmailBroadcastProcessorService to support
this use.
Change-Id: Ic6257ea5eff1bd466a736e0f93cb89b1cf8aa73e
* Remove unneeded DB read in onCreate (add runtime checks for problems)
* Move more exit/commit work to existing AsyncTask
* Add lockout of next & back keys while processing
Bug: 2792509 (probably others)
Change-Id: I0db030a1f1df94ba721510b5112519f260f5c0f9
* Move all db ops off UI thread
* Reorder methods in typical progression (they were random)
Bug: 3134660
Bug: 3134677
Change-Id: Idd4f411e937336bbd09bcc03d9ad036d22dc5e19
* 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
* Create shared async worker to check for duplicate accounts
* Use it in AccountSetupIncomingFragment
* Use it in AccountSetupExchangeFragment
* Debounce proceed/next button because work is now async
* Also, upgrade leftover old-style code in AccountSetupOutgoingFragment
Bug: 3134666
Change-Id: I5c24a6546d1ab66aedc5c4ac826ddf4f1ff53446
The later closes the old cursor while the former doesn't.
LoaderManager takes care of closing cursors, so no need to close
cursors by ourselves.
Change-Id: Ib652e6877dcfc1fea51ffc862254eaeed451cdfa
* 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
This change is in top-level settings for a given account:
* Call saveSettings async on UI changes, instead of synch at onDestroy()
* In loadSettings, get default account id async
Also sprinkled in some TODOs for future whack-a-mole fixes.
Bug: 3133639
Change-Id: I5216c78d28b35fe47e43b48ad0db3a3e57b25004
- Don't show the progress icon unless loading from network
- Don't show the content until LoadAttachmentsTask finishes
- Disable the fade-in animation. It causes some weird positioning issue
with the GL accelerated webview.
- Use WebView.clearView() to clear its content.
- Use the "normal" layout mode, otherwise WebView won't use its entire
width
- Don't hide the vertical scrollbar
Bug 3287729
Bug 3225068
Bug 3295761
Bug 3304396
Change-Id: Ic4b8baac99b71dc0da58021849ff7c1dbd6dbe55
* Functionally correct and pixel perfect
* All current assets in place
Bug: 3292507
Bug: 3284201
Bug: 3135118
Bug: 3255036
Bug: 3252913
Change-Id: I8fa6752748c74b3a9789a3675da12f6c0c11975f
This should fix the "attempt to re-open an already-closed object" exception
from SQLite.
(destroy()s don't have @Override becuase the base method is now depricated
and will be removed someday.)
Bug 3288666
Change-Id: I4780f6c8d89c7204b266608462c0833ad5af4e5f
Sorry it is a bit ugly, it is to allow this change to be
checked in prior to the first stage of the framework change
without breaking the build.
Change-Id: I1828579019ac0325d19c070a4c62cd79549e7d51
* Copies the icon from contacts
* Used whenever the sender doesn't have a local photo
* Used in notifications and in messageview
Bug: 3282187 (notification)
Bug: 3285156 (memory leak from the placeholder graphic)
Change-Id: I528cae20355aa8cce7be37b26f32aa90e092708b
* Check content-disposition and restrict to these two types
* Add unit test
* Reformatting collectParts (code style cleanup)
Bug: 3242502
Change-Id: I5dcbdda5d4788502113771f4fd1b5fff834a402d
* onAttach is called fairly early when rotating, so it needs to do
very little.
* or in this case, defer some work until onResume
Bug: 3170922
Change-Id: Ie760125c5f32b293f8ba1753f2993de0d7439b56
- 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
* Add the checker fragment (instead of replacing)
* Don't refresh progress/error dialogs until onResume (a bit later)
* Don't recreate terminal error dialogs that were automatically
regenerated by the fragment manager.
Bug: 3020074
Change-Id: Ia2947965b758f6846c62ac394ce51da2432523ee
- 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
* This was an early attempt at fragmentation
* But it turned out that no fragment was needed here - it is
not shared or reused in any way.
* Precursor to doing final layouts for the activity.
* Tested working:
Automatic provider lookup
Manual
POP/IMAP and EAS flow modes (from accounts & sync)
Force account creation intent
Provider note
Duplicate account detection
Change-Id: I434edd4b152391d36e70440873932db3ec1a1c99
* All active admin checks now go through common method
* Common code check both isAdminActive and the new (upgrade) policies
Bug: 3253179
Change-Id: Ie81f35906c164051f38c1f1f637d0c04b37eef16
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
1. Error banner now pushes down the entire screen, rather than covers it.
2. Switch to the new ObjectAnimator for the animation to achieve #1.
(Traditional Animation doesn't do this)
3. Dismiss the banner when getting any callback with MessagingException == null
and progress > 0, only when the account is the one that caused the last error.
4. MessageListXL now registers its own ControllerResult to detect
connection errors, and more importantly, when they're cleared.
Bug 3240874
Bug 3240406
Change-Id: I07f8e2f589bb1d312859824f9ec398879003ba16
* Add entry point via com.android.email.CREATE_ACCOUNT
* Enable when in monkey mode only
* Walks through setup screens as if auto-populated and as if
connection checking always succeeds.
* Refactored some common code in AccountSetupBasicsFragment
* Removed obsolete commentary about auto-population of EAS accts
* Also fix minor typo in FLOW_MODE_ACCOUNT_MANAGER_POP_IMAP
Bug: 2735784
Change-Id: Ie7363836cd267673e963e60ae8bc32cab422576e
* This is the fix to bug 3008626 that was created in Gingerbread
and backported to Froyo for an MR release
* The bug prevented validation of EAS w/ Exchange Server 2010 SP1
* For some reason, this fix did not get merged forward into master
resulting in the bug referenced below
Bug: 3254512
Change-Id: I4e48a8f95b31048f09a036cc16db867da4116f04
* The underlying bug was fixed by bdc in I080147b017b961502b3ba98d40841fea679491eb
This reverts commit 9166aa46da.
Change-Id: I51e7e585e7b1624cc2b08ea81baba6f2602a76cf
* For each of incoming, outgoing, exchange fragment, create a "settings
mode" which slightly alters the layout for use in AccountSettingsXL.
* Build a settings mode wrapper layout around the basic fragment
* Add new constructor to set "settings mode" and select layout
* Add wiring for cancel/next buttons in the fragment
* AccountSettingsXL configures each fragment in its settings mode
* Remove old actionbar "Next" options (no longer needed)
TODO: Pixel perfect adjustments, colors, fonts, etc.
Bug: 3188951
Change-Id: Iba26281b214333db301dd40d6c016b6c5a932c2d
This prevented EAS accounts from showing the new message notification,
because Account.newMessageCount in the cache didn't get updated
properly.
Bug 3249319
Change-Id: Id18fb94083e2f441c293414f790a26f82869e3da
* We're seeing our ping timeouts complete after 30 seconds (although
set to 5-17 minutes), due to the fact that our reused sockets are
not having their timeouts reset (i.e. they use the original value
of 30 seconds from when the socket was first created)
* Until the underlying issue is resolved, we'll avoid reusing
sockets for Ping commands
Bug: 3241899
Change-Id: I90b53c0d28b866a91507efafacbb3c4c0df2324c
* 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
The problem was that setIncludeQuotedText() always set mDraftNeedsSaving,
but it shouldn't be done when loading content.
(Do it only when it's toggled by the user.)
Bug 3162882
Change-Id: I6308376020f5be6d1a15b7865f8c7e02cf875eb9
* 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
* New method in AttachmentProvider to delete all attachments for an
account, and unit test it.
* New method in Controller to delete all synced data for an account,
and unit test it.
* Fixed existing problem with Controller unit tests (needed cache clear)
* Fixed existing problems in Controller (mContext vs. mProviderContext)
Bug: 3197935
Change-Id: I79c6a03c21f18d37eeb8158cd1c2af0e0a6e9d2e
* Detect attachment downloads that have stalled and restart them
* Catch a couple of cases in which we weren't sending callbacks
Bug: 3122242
Change-Id: Id2bfd3b26182004b301cf8665f4feb6e62b98b73
- XLFragmentManager.selectMailbox() used to hide the message view
when it's visible, but not anymore. Made goBackToMailbox() itself
hide it instead.
- Also made onMarkAsUnread() not call the unread callback, which was
already done in onMarkMessageAsRead().
Bug 3214538
Change-Id: I52fb8bb745cdaa517624a9aeec074122f10aac4a
* In the case in which a sync was requested during an already-running
sync, we weren't passing the request information into the service
Bug: 3143544
Change-Id: I098161830844f604e4aa5b9c067491d2777d78c3
The home icon on action bar and the system back key work slightly differently
on portrait.
home: full-screen message view -> mailbox list + message list
back: full-screen message view -> expanded message list
-> mailbox list + message list
Bug 3228524
Change-Id: I9bb598315ee829c6a8300a35d194a29c7a26291f
* Use dialog when in XL screen size
* Show different strings in launcher and in dialog/activity title
* Add cancel button to picker
* Move accounts query to AsyncTask
* Remove obsolete AccountsAdapter
Bug: 3093928
Change-Id: Ief771482c6db684c434c21cf92844c37a927d34a
Show color chips for account rows and message items on the combined view.
Moved hard-coded color values to resource.
Bug 3138001
Change-Id: Ib93fb9d6e9592ebd0c297f83c3dee2358a80508f
* The situation is that putCursor() is called from a reading thread
while invalidate() is called from a writing thread
* putCursor() must not hold the monitor lock on ContentCache while
moving the underlying cursor to position 0
Bug: 3224203
Change-Id: I35b798dccf245c761dc79c39ced4fc8c0cfb9d78
* Fix incomplete tracking of mLoaded flag
* Defer validation on automatic reload of fields (on rotation)
until reconstruction completes and we're ready to do validation.
* (For Incoming only) Split loadSettings into configure and reload phases;
We need to configure the UI every time we restart, but we don't want
to reload & overwrite user-entered values on rotation.
* (For Exchange only) Properly show/hide trust certificates options on
rotation, and show/hide divider too.
Bug: 3170922
Change-Id: If3de30ee2d4d5668b29698af73f545510692777e
* We used this to ensure that messages placed in the Outbox would
trigger a sync, but this is already handled by a call to
startSync on the Outbox
Change-Id: I90e1b56dd437bbb9e3341bbe4b1ae8245aede891
- Fix the XL layout: Don't refer to "GONE" views in RelativeLayout.
- Don't always (re-)load message on onResume().
This will make it lose all state (e.g. webview's zoom level) when coming
back from other activities.
- Change the default visibility of some views so that it'll look okay
while loading the message.
- Remove the use of obsolete fragment APIs.
- And some other minor cleanups...
Bug 3221066
Change-Id: I475bc229f4ea9e0e480f528389f5180e1d63fcd6
Call clearContent() in onDestroy(), instead of cancelAllTasks().
(This is what I thought I was doing.)
Calling clearContent() tells the BG thread that the activity has already
been destroyed, and prevents them from loading a message.
Also as a precaution, don't load a message if getActivity() returns null,
which means the activity has already been destroyed.
Bug 3134403
Change-Id: I0d591e0dd147f73e70b0c027dc8037482197f7b4
* Hoist wipe() method from AbstractSyncParser to AbstractSyncAdapter
* Add deleteAccountPIMData(accountId) to the EmailService API
* Implement deleteAccountPIMData for EAS
Change-Id: I1037cde25fc2b24419f399446cfa0906dc0174d1
- We used to (re-)load the content on every onStart(),
which is called too when coming back from other actibities.
So if you go home and come back with the task switcher,
all state get reset, including webview zoom/pan and the current tab.
- Introduce a new flag, mLoadWhenResumed, to tell if we really need to
load a message.
Also:
- Start loading a message in onResume() rather than onStart()
to keep it consistent with other fragments.
Bug 3215269
Change-Id: I1cc6e12c3cc3c08065da3696603a3247f341469a
- Show them when the mailbox list is hidden
- Data flow:
MailboxListFragment ->(Callback)-> MessageListXL ->
MessageListXLFragmentManager, which controls the action bar.
(I'm not too happy with this flow, but we can at least avoid
issuing yet another query to get these data.)
Also related:
- On the combined view, show the unread count for account rows
Bug 3137891
Change-Id: I37fa1258d946329905bbbc0da905928bcf2f4cb1
- Make the home icon on action bar clickable, and show the back arrow with it.
- When clicked, it'll navigate you back to the main screen.
Bug 3138037
Change-Id: Ice783e6b594347bd73b94e71d29a61ad4f5ef972
- Removed opener/collapser
- Now the "fogged glass" is 100% transparent
- Move the landscape layout to layout-land
Bug 3137919
Change-Id: I4918f905aca698c78489e340dd330c7d4da8b106