Commit Graph

2603 Commits

Author SHA1 Message Date
Todd Kennedy d8bce7e731 DO NOT MERGE Add original HTML message to forward/reply
When replying or fowarding an HTML message, we now send both plain text and
HTML bodies as a multi-part mime message. We take special care to ensure the
message bodies are in their own multi-part block and do not interfere with
any additional attachments to the message.

bug 3060920

Backport-Of: I2fc3cb4e1f65bcc28486a62731b44b0ee0a99719

Change-Id: I89ec2795b55ceb7472a8ee3db2dc8f50cf537d9c
2011-03-03 15:27:09 -08:00
Andy Stadler 45e161bb5e Merge "Enable SD card encryption policy when emulated" 2011-03-02 20:45:53 -08:00
Makoto Onuki ace01c0fb1 Merge "Compose: Fix bug where attachments can't be removed" 2011-03-02 17:53:56 -08:00
Andy Stadler 7fd14be804 Enable SD card encryption policy when emulated
* This is is a minimal implementation that only supports the external
  encryption policy when there is no physical/removable storage, and
  the emulated external storage is located within an encrypted backing
  store.

Bug: 3351426
Change-Id: Id96e9277f810beeebf816a914acd3d733eb713ea
2011-03-02 16:41:19 -08:00
Andy Stadler 45d50a1ccf Don't send ID command to *.secureserver.net
Fixes connection failures with GoDaddy IMAP.

Bug: 3497713
Change-Id: I327d9b24598d7dead2d1b74f4e37d1e5885822a6
2011-03-02 16:13:23 -08:00
Makoto Onuki a54d8bb4ee Compose: Fix bug where attachments can't be removed
If the account supports smart-forward.  The old code assumed
attachments are not removable if the account supports smart-forward,
which is not true.  Locally-added attachments should still be removable.

Bug 3505684

Change-Id: Ie6703551800c617dd224957a098311f0c279b3f1
2011-03-02 15:45:36 -08:00
Makoto Onuki ee82e34a28 Fix ANR/crash when you open & close a large EML
The problem was:
- MessageFileViewFragment.clearContent (A) is called in onDestroy
- MessageFileViewFragment.openMessageSync (B) is called in a bg thread
  to load an eml file
- And both try to hold the same lock. (mLock)
- If EML is large enough, B takes _seconds_.  If you press back during this,
  onDestroy gets blocked trying to lock mLock.
- This could also cause a crash, because the task that runs openMessageSync
  won't get cancelled in this case, because that's done in clearContent.
  Because of this, the task's onPostExecute tries to touch a UI element
  when the fragment is actually being destroyed.

The lock was introduced to protect mFileEmailUri, only to keep the same
semantics for openMessage() as MessageViewFragment. i.e. openMessage can be
called multiple times for the same instance of the fragment.

However, in practice, this won't happen.  Unlike the regular message view,
we never reuse MessageFileViewFragment.  MessageFileViewFragment instances
are created per message.  This lock was just reminiscence from the early
developmen stage.

So, fix is simple -- just remove the lock.

Bug 3500487

Change-Id: If2b22a683666de535454bb1293563796fa7acfd7
2011-03-02 13:38:34 -08:00
Makoto Onuki 19b2a7ebc9 New debug setting to enable strict mode logging.
For now it only enables it for the main process.  I've added a flag
to EmailServiceProxy for EAS, but it's not used in the exchange side.

Bug 3500292

Change-Id: I5b27c69fe7cc995a430e9def54b2463076032c78
2011-03-02 10:41:48 -08:00
Marc Blank 833bf485a8 Merge "Fix typo and comment" 2011-03-02 09:37:27 -08:00
Marc Blank 25ab2df296 Fix typo and comment
Change-Id: Iffc69baf98c05a09693ba9a053c91d921fc1b423
2011-03-02 09:37:00 -08:00
Andy Stadler 2d6a98aedf Prevent NPE when account sender name is null
Bug: 3500373
Change-Id: Id07270f34d9cc0523c46104b3167711b71798623
2011-03-01 22:19:53 -08:00
Ying Wang 37f3385803 Split out emailcommon/Android.mk
Change-Id: I846ee2a4b541f4709e647aa537c61549db2bec2e
2011-03-01 15:56:27 -08:00
Andy Stadler 5297b452a2 Repair build break caused by gerrit non-rebase bug
* Undo the combination of I90653e86 & Ia07f2ae0
* By re-inserting the changes from I79d48bef

Change-Id: I70ac46c91f1ab5c90b74b0d43f293fb9741206cd
2011-03-01 15:29:45 -08:00
Ying Wang a07f2ae0b1 Revert "Split out emailcommon/Android.mk"
This reverts commit c28bf35319.
2011-03-01 14:52:05 -08:00
Ying Wang 39919cb5e0 Merge "Split out emailcommon/Android.mk" 2011-03-01 14:28:14 -08:00
Todd Kennedy 9ad3799fe4 Merge "Change "appendQuotedText" to "useSmartReply" in Rfc822Output" 2011-03-01 13:58:36 -08:00
Marc Blank 81273dfcee Fix deadlock issue in AttachmentDownloadService
* When a connectivity wait was added to processQueue, I neglected
  to consider that a lock was held during this time
* The fix is to move the check for connectivity out of processQueue

Bug: 3500702

Change-Id: I646cf899ff895d9838612e89b15b66f1084840b1
2011-03-01 13:43:44 -08:00
Todd Kennedy 0d49ef78eb Change "appendQuotedText" to "useSmartReply" in Rfc822Output
Slight API change to make it more clear what the method parameter is for.
Also add some additonal test conditions to the Rfc822Output tests.

Change-Id: I8888d6201e79136fa3420aa9d5f921772f374e56
2011-03-01 13:30:21 -08:00
Ying Wang c28bf35319 Split out emailcommon/Android.mk
Change-Id: I90653e8601ee3ee6a8719d87ffb93222a11a22c0
2011-03-01 12:29:05 -08:00
Makoto Onuki 23d6be4d21 Merge "Update screen properly when # of accounts becomes 1 from 2" 2011-03-01 11:20:31 -08:00
Andy Stadler 30793aa791 Merge "Add parent key to Mailbox schema" 2011-03-01 10:46:56 -08:00
Andy Stadler 3a58509b2a Add parent key to Mailbox schema
Bug: 2028418
Change-Id: I79d48befe7754692a3cab6c8851105bb399431f5
2011-03-01 10:45:50 -08:00
Todd Kennedy da8326dfe7 Disable zoom icons if device supports multitouch
On multitouch devices, the zoom icons are not needed (the user can pinch to
zoom in/out). So, we should disable the display of these icons on multitouch
devices.

bug 3405875

Change-Id: I45484cfc622f11c25d3ea7f4c378c3133d7f7de0
2011-03-01 07:52:27 -08:00
Todd Kennedy fe68c0e7c2 Use HostAuth to determine settings changes
There were two TODO's from a prior CL where deprecated HostAuth methods
were removed.

1. Do not use a generated URI to determine if account settings have changed.
   Instead, use the HostAuth structure for this purpose.
2. The account key in the HostAuth structure has been deprecated. Remove as
   much of it as possible (until the schema of the host auth database changes,
   we must still refer to it when adding rows).

In the process, HostAuth tests were broken out into a separate unit test
file.

Change-Id: I4075da09af168f734db7b20a9ef63d4178ac2064
2011-03-01 07:49:54 -08:00
Marc Blank e4481d4110 AccountServiceProxy.restoreAccountsIfNeeded should be synchronous
* In the case where there are no Exchange accounts, we can stop ExchangeService
  while restoreAccountsIfNeeded is still running, which can cause us to leak
  the connection
* Change the call to be synchronous.

Bug: 3495601
Change-Id: I4a396e8b1650bd15fabd2802d2ec8d4276c6e43a
2011-02-28 18:00:08 -08:00
Makoto Onuki fc156033d9 Update screen properly when # of accounts becomes 1 from 2
This happens when
- two accounts are configured
- select account 1
- remove account 1, and account 2 becomes active

In this case we failed to select account 2, and the fragments would keep
thinking account 1 was active.  (So no mailboxes would be shown--beacuse there
was of course no mailboxes for account 1!)

When the account list changes, the account loader (created in loadAccounts())
automatically reloads the account list, and calls updateAccountList().  If
there're still more than 1 account at this point, updateAccountList() updates
the account spinner on the action bar.  This will result in
ActionBarNavigationCallback getting called, which then updates the current
account as expected.

However, if there's only one account left, we hide the spinner and just
set the account name to the action bar title, so
ActionBarNavigationCallback won't get called and the current account
never changes.

In this case we shouldn't rely on ActionBarNavigationCallback but have to
explicitly update the current account.

Bug 3491567

Change-Id: Ia9ba3e1c11248ad5a1ba7e055717c5519d6e4884
2011-02-28 17:44:11 -08:00
Makoto Onuki 4d4bb9a849 Fix auto-refresh of mailboxes.
Removed the ugly doAutoRefresh() and byExplicitUserAction.

The intention for these was to supress auto-refresh when the message list
opens without any explicit user action, e.g. due to screen rotation.

However, now that we have the RefreshManager.isMailboxStale check with 5
minutes duration, this check is not really necessary.  Let's just always
refresh mailbox if it's stale.

Bug 3493134

Change-Id: I6d0365ed7f8092304117d5f619d570b828edf76f
2011-02-28 15:08:08 -08:00
Marc Blank 51a7151cfc Merge "Send logging information to Exchange when deviceId is retrieved" 2011-02-27 22:34:10 -08:00
Marc Blank fdec974c93 Send logging information to Exchange when deviceId is retrieved
* Clean up logging to indicate the actual Service being used

Change-Id: I55f87487389accb1aad9b0cc03eff945ea0b1f3e
2011-02-27 12:08:36 -08:00
Jesse Wilson 5d29dac806 React to LruCache.entryEvicted renamed to LruCache.entryRemoved
Change-Id: Iab20ce0386ee4dabc8490dbde5cd2208626c293c
http://b/3461302
2011-02-25 17:25:28 -08:00
Makoto Onuki f583bf66b2 Merge "Message view: Restore tab after screen rotation." 2011-02-25 14:37:25 -08:00
Marc Blank dc78a769fc Email split, part dix
* The coup de grĂ¢ce for Exchange in Email
* Remove Exchange bits from AndroidManifest
* Update Android.mk to create static jar for emailcommon
* Delete all com.android.exchange files
* Delete all exchange-only strings
* Change loadAttachment service method to take only attachment id and
  background flag
* Add code to AttachmentProvider.openFile() that opens an output file
  for attachment writes
* Make sure deviceId is determined in Email app (not Exchange)

Bug: 3442973
Change-Id: I775600252fd121f474d51cb26fefbfcc50e387af
2011-02-25 10:46:16 -08:00
Makoto Onuki a553559f37 Message view: Restore tab after screen rotation.
Restore current tab and "show pictures" state.

Bug 3384629

Change-Id: Ia7dca5f53b313f3f54781f6a061767d982773a9b
2011-02-24 14:39:52 -08:00
Todd Kennedy 5920989bde Fix NPE when restoring setup activity
If the setup activity ever needs to restore itself after being killed, we were
restoring the Activity object's state (i.e. rebuilding the UI) before we
restored the state of our class. Since the Activity necessarily depends upon
our object's state, Bad Things can [and will] happen.

The solution is simple -- save our object's state last, but, restore our state
first.

bug 3476039

Change-Id: I623f1938c2e0f50d660708a7a7ac3eeb4a8f9090
2011-02-24 12:44:07 -08:00
Makoto Onuki 3d2f22c7a6 Merge "Widget: Use unread count for inbox views." 2011-02-24 11:22:00 -08:00
Makoto Onuki fc4006b276 Widget: Use unread count for inbox views.
Bug 3431240

Change-Id: I61a91462cdd864604f5ddc06ff93c0ecf3001e20
2011-02-23 17:25:07 -08:00
Makoto Onuki 6842c5768f Merge "Remove com.android.email.widget.ViewType" 2011-02-23 17:10:40 -08:00
Todd Kennedy 2428ea767e Merge "Properly clear "next" button de-bounce flags" 2011-02-23 17:07:15 -08:00
Todd Kennedy 64c7a437ac Properly clear "next" button de-bounce flags
In some cases, the de-bounce flags were not being properly cleared. Namely, on
the outgoing settings screen. We now consistently clear the flags to ensure the
"next" button is always actionalble when it should be.

bug 3425395

Change-Id: Ib8085fb96522158198d9f33a12effef8f65c0d19
2011-02-23 16:41:36 -08:00
Makoto Onuki 64c914a6a1 Remove com.android.email.widget.ViewType
WidgetView has took over this, but I forgot to remove it.

Change-Id: I6a5012263f81223904907eb78ff22472ff5d8f85
2011-02-23 16:27:17 -08:00
Makoto Onuki a08fa43b85 Merge "Fix the attachement view layout." 2011-02-23 15:30:20 -08:00
Makoto Onuki 88c8044586 Fix the attachement view layout.
The progress bar is not meant to be GONE.  Encapsulated the progress view
in MessageViewAttachmentInfo to make sure that won't happen.

Bug 3417034

Change-Id: I1efee089cc7921f4428a38fcbcdc2e8aa3cec9fd
2011-02-23 15:16:29 -08:00
Makoto Onuki 47bdd174dc Merge "SizeBoundingFrameLayout: framelayout with max width/height" 2011-02-23 15:12:41 -08:00
Makoto Onuki fc8a65aecf Merge "Refactoring widget part 2" 2011-02-23 15:12:22 -08:00
Makoto Onuki 9299d6082c Merge "Pixel pefect: account spinner." 2011-02-23 15:12:08 -08:00
Todd Kennedy ffe6ef342a fix UnsupportedOperationException in tests
We're using the mock context to prevent modifying the real databases. However,
we need the real context to create intents. Use the real context in the few
places we must use it.

Change-Id: Icb8d289239218921c0b4b5c93ac7983830d90394
2011-02-23 14:51:45 -08:00
Makoto Onuki 897a0ea81c Refactoring widget part 2
- Extracted the loader
- Extracted ViewType and introduced WidgetView.
  WidgetView is ViewType + mutable fields, such as account id.
  WidgetView now owns the method to switch views.

These two are basically in preparation to address the message count bug.
(we're showing total message count where it should be the unread count,
which is a bit tricky because it'll require two different queries.)

- Also simplified the threading model in EmailWidget to fix potential
  theading issues. (now (almost) everything works on the UI thread)

Bug 3431240

Change-Id: I9f8a268210995f1135baabe88b49b274272708d4
2011-02-23 14:20:00 -08:00
Makoto Onuki b3c3f1afc6 Pixel pefect: account spinner.
The expanded account spinner is completed, but the collapsed view
needs some more work.  (That'll probably be a rather large CL, so I'll
finish it in a separate CL.)

Bug 3434135

Change-Id: Ia732e6b57b8c0d3e1609c3134b26411539ab6a18
2011-02-23 13:59:11 -08:00
Makoto Onuki de9e706ed9 SizeBoundingFrameLayout: framelayout with max width/height
This will be used to set the max width to the account name spinner.

I gave up on writing tests for onMeasure.  It wasn't easy without adding
a dummy activity and layout.

It'll be used for a fix to bug 3439694.

Change-Id: Ie7569b0661eb732e270e4521fa0d3306f1bdd12c
2011-02-23 13:32:36 -08:00
Todd Kennedy 8c89674b64 Always set a delete policy for legacy accounts
The delete policy can only be set for POP3 accounts. However, the delete policy
is used for all legacy accounts (that includes IMAP). As such, we need to make
sure IMAP accounts also have their policy set; even though the setting is not
configurable by the user.

The delete policy does not mean anything for Exchange accounts, so, we do not
need to modify the account setup code for them.

bug 3074164

Change-Id: Iab10d2997404b3b0c10a60a64fb652540c0d2d1a
2011-02-23 11:00:19 -08:00