Commit Graph

3173 Commits

Author SHA1 Message Date
Makoto Onuki
c2d0049167 Merge "Suppress warnings from mime4j by default." 2010-08-06 10:55:26 -07:00
Makoto Onuki
3cc02d3e68 Suppress warnings from mime4j by default.
It's now controlled by the debug setting.

Bug 2829962

Change-Id: I700c83e5a193d2f013fcca14092e4eed6a127f97
2010-08-06 10:54:47 -07:00
Makoto Onuki
b0ca30d4d1 Add action buttons to actionbar on MessageListXL
- Now able to compose a new message.

Change-Id: I53cd7cc6fe850063946824748e11ccde89d7decf
2010-08-06 10:48:14 -07:00
Makoto Onuki
fd8a2e8afb Automatically open Inbox when account is selected.
Change-Id: I3dc43d804d39b925ee62bebbf85911cb258aafd7
2010-08-06 10:44:45 -07:00
Makoto Onuki
9531931c7e Don't auto-requery account list.
Prevent CursorLoader's auto-reuqery.  Instead, refresh the loader
when adding/removing accounts.

Change-Id: I63091c23f8c06c32dd42669fdfbd9e783ff9eccb
2010-08-06 10:38:34 -07:00
Makoto Onuki
94506fdaf6 Small fixes/clean-ups.
- 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
2010-08-06 10:11:36 -07:00
Eric Fischer
8ac10f28cb Merge "Import revised translations." 2010-08-05 16:51:08 -07:00
Eric Fischer
fa46f81340 Import revised translations.
Change-Id: I4a5a032aae33280650495f9231870d79908b1e21
2010-08-05 16:05:38 -07:00
Makoto Onuki
191448b430 Make Welcome launch MessageListXL
Also added the "1 pane" activity to test the phone UI.

Change-Id: I1c86d2088a2298ada5028b7a266bd090b593593c
2010-08-05 13:58:20 -07:00
Eric Fischer
6333e15108 am 13b21c66: (-s ours) am f2f268a5: Import revised translations. DO NOT MERGE
Merge commit '13b21c660a6bba3681910d2bf37d603a7b534f95'

* commit '13b21c660a6bba3681910d2bf37d603a7b534f95':
  Import revised translations.  DO NOT MERGE
2010-08-05 11:44:27 -07:00
Dmitri Plotnikov
32358f5516 Upgrading to new GAL registration API.
Change-Id: I67eaeb50ba8629a85d056da031e3b48ea7ab3858
2010-08-05 11:22:58 -07:00
Makoto Onuki
8066a925b1 Merge "Introducing ThrottlingCursorLoader." 2010-08-04 11:19:31 -07:00
Eric Fischer
13b21c660a am f2f268a5: Import revised translations. DO NOT MERGE
Merge commit 'f2f268a59e658c0514b00b0cb5bb0138d013c1b1' into gingerbread-plus-aosp

* commit 'f2f268a59e658c0514b00b0cb5bb0138d013c1b1':
  Import revised translations.  DO NOT MERGE
2010-08-04 10:56:24 -07:00
Eric Fischer
f2f268a59e Import revised translations. DO NOT MERGE
Change-Id: I8d00ab574f8644ea3b2056e4d8310f453a8b8337
2010-08-04 10:42:51 -07:00
Marc Blank
b91eea0119 resolved conflicts for merge of fbf501fe to master
Change-Id: Ic68cbf2de1877ab06744287f57c1c33c4e0e573a
2010-08-04 10:28:40 -07:00
Makoto Onuki
630e31ef78 Introducing ThrottlingCursorLoader.
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
2010-08-03 17:45:51 -07:00
Makoto Onuki
907774e763 Merge "Aadd special boxes to mailbox list." 2010-08-03 17:21:14 -07:00
Makoto Onuki
833fe73b99 Aadd special boxes to mailbox list.
Change-Id: I36616f53555346ca7fbb6f3426a0c3196d7bacbc
2010-08-03 17:06:04 -07:00
Marc Blank
88000e8bdc Merge "Fix tests that broke due to DST changes in African countries" 2010-08-03 14:36:47 -07:00
Marc Blank
92861b5c2b Fix tests that broke due to DST changes in African countries
* 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
2010-08-03 11:32:58 -07:00
Makoto Onuki
77c6ccdd61 Merge "Clean up MailboxListFragment." 2010-08-03 11:03:38 -07:00
Marc Blank
fbf501fefd am 4e619a2d: am 2b2b3448: Handle inactivity timeout > maximum allowed properly
Merge commit '4e619a2d5051811262496e48ec99a0e916822d44' into gingerbread-plus-aosp

* commit '4e619a2d5051811262496e48ec99a0e916822d44':
  Handle inactivity timeout > maximum allowed properly
2010-08-02 20:43:50 -07:00
Marc Blank
4e619a2d50 am 2b2b3448: Handle inactivity timeout > maximum allowed properly
Merge commit '2b2b3448ec200f3d649e5f57309908d28ce3bfc7' into gingerbread

* commit '2b2b3448ec200f3d649e5f57309908d28ce3bfc7':
  Handle inactivity timeout > maximum allowed properly
2010-08-02 20:41:55 -07:00
Marc Blank
2b2b3448ec Handle inactivity timeout > maximum allowed properly
* 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
2010-08-02 19:39:09 -07:00
Dmitri Plotnikov
5ab18497f6 Adding support for a full-contact (entities) query.
Change-Id: Ib1cdd998dcc4f60124dbc37a42fd61ee0f6802fd
2010-08-02 18:19:25 -07:00
Makoto Onuki
7ef278202e Clean up MailboxListFragment.
- 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
2010-08-02 16:33:23 -07:00
Makoto Onuki
d0c2178063 Merge "Add the messageCount column to the mailbox table." 2010-08-02 16:01:32 -07:00
Makoto Onuki
2a9f783e34 Fix crash in one-pane message view
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
2010-08-02 11:47:10 -07:00
Makoto Onuki
574854b528 Add the messageCount column to the mailbox table.
- 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
2010-07-30 17:37:28 -07:00
Makoto Onuki
20bf78222b Merge "Fix failing tests." 2010-07-30 16:06:36 -07:00
Makoto Onuki
b6c1ad0f01 Rename MessageViewFragment2
Change-Id: I28e23c0ff18211db999396c5ba1ad9ef898d4515
2010-07-30 15:41:40 -07:00
Makoto Onuki
206d4e842d Split up MessageViewFragment like we did to MessageView.
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
2010-07-30 15:38:53 -07:00
Makoto Onuki
2d5b4f25f9 Fix failing tests.
Bug 2844798
Bug 2882894

Change-Id: I683c67ddc7ce7c22f06e4b39df330d3850513862
2010-07-30 10:34:00 -07:00
Makoto Onuki
b8f31d5490 Helper to create isolated context for provider tests.
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
2010-07-29 17:22:58 -07:00
Marc Blank
1f1be33191 am a95e40df: am 4f12c25e: am 05b0bb56: Release held mailboxes after policy refresh
Merge commit 'a95e40df2f4c6c17e53a438e1229199d823efca6'

* commit 'a95e40df2f4c6c17e53a438e1229199d823efca6':
  Release held mailboxes after policy refresh
2010-07-28 18:35:40 -07:00
Marc Blank
a95e40df2f am 4f12c25e: am 05b0bb56: Release held mailboxes after policy refresh
Merge commit '4f12c25ed9e0e3c0884da642e1fc3450eb781b98' into gingerbread-plus-aosp

* commit '4f12c25ed9e0e3c0884da642e1fc3450eb781b98':
  Release held mailboxes after policy refresh
2010-07-28 18:33:07 -07:00
Marc Blank
4f12c25ed9 am 05b0bb56: Release held mailboxes after policy refresh
Merge commit '05b0bb56254d9ed924dff4c09ad227eec611a695' into gingerbread

* commit '05b0bb56254d9ed924dff4c09ad227eec611a695':
  Release held mailboxes after policy refresh
2010-07-28 18:31:22 -07:00
Makoto Onuki
ec15f2356e Extract the mailbox lookup logic into an independent class
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
2010-07-28 16:36:34 -07:00
Makoto Onuki
d9907c7641 Merge "Adding account selector." 2010-07-28 14:12:37 -07:00
Makoto Onuki
4de80f22ae Merge "Move isSecurityHold/clearAccountHoldFlags to Account" 2010-07-28 13:44:42 -07:00
Makoto Onuki
ee216da74a Adding account selector.
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
2010-07-28 13:41:57 -07:00
Makoto Onuki
ae8fc30b41 Fix "disk I/O error" in LocalStoreUnitTests
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
2010-07-28 13:07:33 -07:00
Makoto Onuki
bcf32320e2 Move isSecurityHold/clearAccountHoldFlags to Account
- 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
2010-07-28 11:12:38 -07:00
Makoto Onuki
0943a75ba8 Merge "Refactoring MessageListXL" 2010-07-27 15:47:01 -07:00
Makoto Onuki
bccb10a5a8 Merge "Break MessageView into 2 separate activities." 2010-07-27 15:46:38 -07:00
Makoto Onuki
e105fbe510 Break MessageView into 2 separate activities.
MessageView for regular messages and MessageFileView for EML files.

I'll break down MessageViewFragment too.

Change-Id: Iae66f33d8fb5de58084ab4aef31588e9743c5a18
2010-07-27 15:45:58 -07:00
Makoto Onuki
02fa70aa18 Refactoring MessageListXL
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
2010-07-27 15:10:54 -07:00
Makoto Onuki
c435d7ad24 Workaround for bug 2873538
Prevent NPE.

Change-Id: I6d80e6f574d6c37adb9d7a402850c39e2a79f04a
2010-07-27 12:54:28 -07:00
Makoto Onuki
f08b061ea8 Merge "Rotate screen when the R key is pressed." 2010-07-26 12:47:45 -07:00
Makoto Onuki
3894be2fe0 Merge "Adding lifecycle log to fragments." 2010-07-26 12:46:50 -07:00