doInBackground() returned a string[] when error, but onPostExecute() expects
null.
Also added isCancelled() check, just in case.
Bug 2918930
Change-Id: Ie87ff2e2e5b7c3fd77a062944759d03f8f09d3d9
Some tests create mock controllers. They register themselves to
MessagingController when instantiated, but never unregister.
Added a cleanup method, and call it for each instance.
(I was hoping it would spped up unit tests, but it didn't. Still
it's a nice thing to do.)
Change-Id: Ia90f0380aef388d22f7cfcf6e9203e05444b3285
- Now MessageListFragment uses loaders to load data.
- Now that we use Loader's auto-requery with throttling,
removed the throttling timer from MessagesAdapter.
- Simplified footer mode. (now only "no footer" or "load more")
- Removed saving/restoring list state code.
These method don't really look like working, or at least
not always working. Now that UI's lifecycle is changing,
we'd better redo it from scratch.
- Removed MessageListUnitTests.
It only has tests for onSaveInstanceState/restore of the fragment,
which I virtually disabled.
And minor clean-ups
- Moved the code to save/restore selected state from the fragment
to Adapter.
Bug 2911766
Bug 2897500
Change-Id: I16c7aefecc5409c57fc5fc8c59b5c80d9b7fc164
Don't use restartLoader(). Use initLoader() with stopLoader() when necessary.
This allows us to make use of LoaderManager's "retaining" feature.
i.e. We won't have to requery when the screen orientation changes.
Also, don't start loading in onStart(). Fragment manager seems to kick
exisiting loaders after onStart(), so you'll end up getting onLoadFinished()
twice.
(Looks like I got unluck with this--there was no strong reason to start loading
in onStart rather than onResume, but I think we can leave other fragments as-is
as long as they don't use loaders.)
Seems to be working.
Change-Id: Ib4f72098bd0fcbfce284ae6e16055d20ee410cf3
Apparently IMAP servers may return multiple SEARCH responses for a
single SEARCH command, and we need to handle all of them.
Before the IMAP rework there was 3 methods that issued the SEARCH command.
Two of them ware doing it right, but the other wasn't, which was what
I copied from, unfortunately!
In case you're wondering, originally the test for this method was done through
upper methods, e.g. getMessage().
Bug 2911647
Change-Id: Ia50072944d5b01c1e59541c3a966067b13910cc4
* Apps trying to open attachments using AttachmentProvider were
seeing SecurityExceptions due to the fact that internal calls
from AttachmentProvider to EmailProvider didn't have their
calling identity saved/restored.
* Updated provider calls so that these calls use the Email
process' identity.
Bug: 2908737
Change-Id: Ifb71ad834530c6232728e1aad31439991f8ed379
There's something weird going on when you add an Exchange account
and we try to look up the inbox. Add log for investigation.
- Log class name
- Log normal path (MAILBOX_FOUND) as well if debug is enabled.
(Other paths are always logged. These paths shouldn't be used often,
so I think it's okay.)
Change-Id: Iff5a28a1240896f8e2b991b891cbc696e7901f06
- mConnection.destroyResponses() should be protected with
if (mConnection != null).
When we get an IOException, we close the connection and null it out in
ioExceptionHandler(). So mConnection can be null at any point after
where ioExceptionHandler() first appears.
- ioExceptionHandler should close its parent ImapFolder only if the argument
connection is mConnection.
Methods like exists() may pass an ImapConnection which is not mConnection
to ioExceptionHandler. In which case we don't have to close the ImapFolder.
Bug 2898211
Change-Id: I8f9f45d91f596bb8da1a1575593e652d66deb643
Fix for crashes caused by an incomplete account
which typically a crashed unit test leaves behind.
- "Delete account" now works for incomplete accounts
- AccountBackupRestore won't crash.
Change-Id: Ie235aa15cf9b970fd184c60f14406aa7353c6f00
- Implemented "account settings".
- Added "add account" menu. It's not clear how to get to the screen at
this point, so just added a menu item for this for testing.
Change-Id: I78cfa54f2533917cc742b6ec027c2a0624cf0c1a
- After adding an account, and when a shortcut to an account is clicked,
launch Welcome instead of MessageList.
- Then welcome launches the appropriate activity.
(MessageList or MessageListXL)
- Welcome no longer launches AccountFolderList, which will be gone
according to the current plan.
Always going through Welcome makes sure that the account backup/restore
and the reconciler will always get kicked.
Change-Id: Ia57027eba16e98c5d8854e8d3c1d8773bcfbf1e5
It's related to the use of Activity.manageQuery().
This may be a regression in the framework, but it's annoying enough and
causing a problem with testing, let's just not use managedQuery().
Bug 2901309.
Change-Id: I8ae5b6ffe17979a094d5a23d49f42e8de04ed4f0
This is phase 1, which simply replaces the phone UX with a fragment-based
equivalent. A subsequent CL will convert it to a large-format multi-pane
version.
Also fix a latent bug in the signatures of the Incoming & Outgoing
settings, both in the reflection code and in the proguard flags.
Change-Id: I86e857af8b9573c0d6070bb21053ce65bb7fe8a0
- Don't swallow exception information.
- If the file exists but can't read, try to remove it.
- Don't use createNewFile. Just overwrite.
Bug 2898372
Change-Id: I7c0802f751a020c546aa07fa932b41ead31a8dc8
Unfortunately software-keyboard is disabled on master for some reason,
so we can't use the R key hack any longer...
Change-Id: Ide73e11742e5de70fec45009eee20a1a74fcbfd1
It's the int version of getFirstRowLong.
Because getFirstRowLong returns a Long as opposed to a long, and the return
value can be null, it's a pain to cast to Integer. So added this variant.
Change-Id: I2a3190e49db480e6d594be4b1fcef9a71e56cb2f
- Fixed account selector default account look-up
- Renamed MessageListFragment.onRestoreInstanceState
to loadState.
(Activity.onRestoreInstanceState is called after onStart,
but this one is called in onCreate, so it wasn't a good
idea to use the same name.)
- Changed mailbox cursur requery timeout to 3 seconds
- Added some TODOs.
Change-Id: Ia2242cd9f74936d24756b800eacd126958eed330
This is a {@link CursorLoader} variant that takes {@code timeoutSecond}
in the constructor.
When it detects changes in the underlying data, it'll wait until the timeout
before doing a requery.
We use this to throttle # of queries. We don't want to issue a query every
time something changes in the DB while we're syncing.
Change-Id: I098366bce923c3242c42964bc166493610ee0f6f