* 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
* Backport from master branch
* Send policy key of "0" when validating; this gets us the policies
even if "Allow..." is enabled (currently, we simply don't see the
policies)
* If we don't support all of the policies, send back the response
code indicating support for partial support. If we get a positive
response back, then we're good to go - the server allows devices
with partial support. Otherwise, we fail as we always have - with
the toast indicating that the device doesn't support required
policies
* Remove PolicySet.isSupported() and ensure proper field ranges
within the constructor
* Update tests as appropriate
Bug: 2759782
Change-Id: Ida5663a9b35c75ecc61a5f442be0bd60b433cb73
* Handle status 5 for Ping command (heartbeat of out range)
* Write unit test for heartbeat reset
Bug: 2834195
Change-Id: Ic7952a4b296cf15c6ba895d6579fe7956b171e5b
- 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
- Broke down bindActivityInfo into setCallback and openMailboxes()
- openMailboxes() can be called multiple times against the same instance.
(We won't have to re-create the left pane on XL screen)
- Added EmptyCallback to avoid null checks
- Renamed a callback method
Change-Id: I3848a6f6da7f1782dcc9566967f8618ed79a878e
* Provide unused placeholder for account_settings_exchange_summary
* Bulk cleanup all other placeholders (no longer required)
Change-Id: I55d502eb725d721c9a893c17cf76f227489bb89f
There are two major, interrelated parts to this CL:
1) Clean up the activities to reduce the use of Intents to pass
information between activities; instead, we use a common
SetupData structure that automatically saved/restored as necessary
during the setup flow. A fair amount of code and inconsistent
use of Bundle extras has been eliminated in the process.
* Create SetupData structure, setters/getters, and initialization
methods to simplify the preservation of state during setup flow
* Remove all state/flow extras from Intents; Intents now only
specify the Activity to be started, which should greatly simplify
the transition to Fragments.
* Remove all state/flow fields from Activities
* Modify existing setup activity unit tests and confirm tests pass
2) Create AccountManager accounts for POP/IMAP email accounts to
provide consistency in user experience. Also, internal flows are
now identical as between account types.
* Move account reconciliation from SyncManager to MailService, so
that reconciliation is consistent between email and exchange
accounts; move unit tests as appropriate
* Add a "Sync Email" setting for POP/IMAP/EAS
* Change MailService to respect the "Sync Email" setting in
Settings -> Accounts & sync
* Create PopImapSyncAdapterService to handle manual POP/IMAP sync as
requested by SyncManager; add EmailSyncAdapterService to perform
the same function for EAS
* Use new PopImapAuthenticatorService to add AccountManager accounts
for POP/IMAP accounts; setup appropriate stanzas in AndroidManifest
and add related xml files
* Update AccountSettings to use SetupData
Miscellaneous other changes:
* Only allow valid port numbers in incoming/outgoing setup
Bug: 1712475
Change-Id: Ibdac52fb2c5578b86bf3992ddb1acd10f162391a
How to launch:
- Kick "Email 2 Pane" in the app drawer.
Major known issues:
- When you launches "Email 2 Pane", it starts directly; the logic in Welcom
won't be executed.
- There's no UI to add accounts. Use the old UI.
- There's no way to select non-default accounts.
- The on-screen buttons except for older/newer don't work.
- No contex menus work.
Change-Id: I38374acafafbae62e46f84294a7677e54686cfc2