Merge commit 'f2f268a59e658c0514b00b0cb5bb0138d013c1b1' into gingerbread-plus-aosp
* commit 'f2f268a59e658c0514b00b0cb5bb0138d013c1b1':
Import revised translations. DO NOT MERGE
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
* In particular, "Africa/Casablanca" has DST in 2010 now, so it can't
be used as a test for non-DST time zones
Bug: 2882900
Change-Id: I3026ae4816fc068bd6c783fa3ca879666e796fc9
* In a recent change, we mistakenly removed the logic for handling
too-long inactivity timeouts; we should just fall back to the maximum
since this is stricter than what we're being asked to enforce
* Restore this logic and update the unit test
* The regression was caused by change Ida5663a9, to wit:
Backport: Handle "Allow non-provisionable devices" properly
Bug: 2886746
Change-Id: I99cf9a37441b80477cc1c2c7ec2a78f8a14a83da
- Remove AsyncTasks, and use CursorLoader to load data.
- Get message counts for the drafts/trash mailboxes directly from
the db column.
- Remove obsolete code from MailboxesAdapter.
Change-Id: I93c72977c19b60581e1169ba9bd429912ba3e68f
Forgot to fix the resource file.
Two-pane is okay because we don't put the class name in layouts.
(We create fragments at runtime.)
Bug 2887134
Change-Id: I033c2283be4b104941af34a1fbb5e4663337ef68
- Use trrigers to keep them up-to-date.
- Batch-update them upon upgrade.
- Motivation:
On the mailbox list, we show the number of messages in trash/drafts.
We currently do this with count(*) on the fly, which is okay
because MailboxList is really shown right now.
However, on the 2 pane, it's always shown and constantly refreshed,
so the use of count(*) can be a huge penalty.
It also make the code significantly simpler.
Change-Id: I26efa238d5183df43420a65925876248ef6c6cb6
Break MessageViewFragment up into two fragments, MessageViewFragment, which
is used to show regular messages, and MessageFileViewFragment, which shows
EML messages. (And their base class, MessageViewFragmentBase.)
MessageViewFragmentBase's javadoc has a class diagram.
MessageViewFragment is actually named MessageViewFragment2 at this point
so that GIT correctly finds out the rename from MessageViewFragment to
MessageViewFragmentBase. I'll rename it back in a following CL.
Also added very basic unit tests for MessageView and MessageFileView.
At this point, they just make sure the activities really open and show
messages without exceptions.
I feel like the current naming schema for the activities/fragments is
kinda confusing. Let me know if you come up with better names.
Change-Id: Iff948f4b68cfdb7c1e68f225927b0ce58d34766b
The logic came from ProviderTestCase2, but it can be used with other
kind of test cases, such as InstrumentationTestCase.
Extracted from an existing class. We'll need it for new activity tests.
Change-Id: I5741f01d4749fd397704cef330082470f6051bcf
Merge commit '4f12c25ed9e0e3c0884da642e1fc3450eb781b98' into gingerbread-plus-aosp
* commit '4f12c25ed9e0e3c0884da642e1fc3450eb781b98':
Release held mailboxes after policy refresh
Merge commit '05b0bb56254d9ed924dff4c09ad227eec611a695' into gingerbread
* commit '05b0bb56254d9ed924dff4c09ad227eec611a695':
Release held mailboxes after policy refresh
This new class MailboxFinder is responsible for looking for a mailbox
by an account id and a mailbox type.
If a mailbox is not found on the first try, it'll tell Controller
to refresh the mailbox list, and try again later.
This will be used by MessageListXL.
Change-Id: I4adc3db025fb271c254aa2b58b3b753281dc7398
Also
- Renamed MessageListXLFragmentManager.setStart to onStart. (was typo)
- Fixed flag handling bug in MailboxListFragment
- Fixed the R key handling code. (The first R key was always ignored,
because the default requested orientation was neither landscape or
portrait.)
Change-Id: I0e14ce9f4fc5be973f7c0091f88fd4551a4329fa
The problem was that we didn't close the LocalStores created in these
testDbUpgradeXxx tests.
Also,
- Make sure to close databases.
- Make sure to close cursors.
- Cleard up warnings (unnecessary casts, etc.)
Bug 2859264
Change-Id: Ifaddbb6cf07794a7b5978564ea8fbb3cbf75b978
- Added unit tests
- I see the "open a cursor, move to the first row, read a column" pattern over
and over. Added a utility method for this. (Let's try not to bloat the
binary by copying code around!)
- Added helper classes for database related tests
- Removed code dup
Change-Id: I380959215cc1661b252158f0f6e35369b499cdf8
MessageView for regular messages and MessageFileView for EML files.
I'll break down MessageViewFragment too.
Change-Id: Iae66f33d8fb5de58084ab4aef31588e9743c5a18
I always thought our Activities are way too fat, meaning we've put too many
things into activities without any structure.
The major problems with this are:
- They have too many fields, which are not final and not even orthogonal.
This makes them very hard to understand/maintain. Changing one tiny bit
can always cause unanticipated side-effects.
- Very hard, or almost impossible to test.
I really think we should break them into independent and self-contained
subcomponents which can be tested separately.
Introducing MessageListXLStateManager, which manages the current account,
mailbox and message, and show/hide/update fragments accordingly
for MessageListXL.
With this class, MessageListXL will be able to switch accounts/mailboxes/
messages by just calling the methods such as selectAccount(), without
worrying about when to show/hide what fragment and how to initialize them.
(In other words, MessageListXLStateManager encapsulates the two-pane screen
transition. It's not intended to be reused for the phone UI.)
I didn't make it a nested class in MessageListXL, because nested classes can't
have real private members (private member are accessible from outer classes and
even brother classes!!), and I wanted it to be really self-contained anyway.
Change-Id: I1c121e99e30f12cc118e1c35abc9b30f49939a4a
* When a sync fails due to a provisioning error (on initial sync
or after policies are refreshed on the server), sync mailboxes go
into a "hold" state until the security error is resolved. Meanwhile,
the account mailbox handles provisioning. If this is NOT successful,
we put a hold on the account and go through the UI steps of setting
up security on the device. When this is done, we release the hold on
the account, which releases the hold on the mailboxes.
* If provisioning IS successful, however, a refresh of the existing
settings would be an example, we do NOT release the adapters, and
this is the bug we're seeing.
* This CL simply causes any held mailboxes in a successfully provisioned
to be released from the hold
Bug: 2865623
Change-Id: I59e780e9bd4ea908182b786dfd0e5851f5bf5f3b
- Added parameter check to openXxx methods.
- Clear the list before (re-)load the data, to make ListFragment show the
"Loading..." animation.
- Moved a few lines around in MailboxListFragment.
Change-Id: I48d9759e118976bf9f8cce10069e2b9b5c253342