Serialize the account just like we do for ALL THE OTHER CASES

we always put account in extras in a serialized format elsewhere

Do it here, too
Otherwise, it comes in serialized (json) but we look for it as a parcelable
but the upgrade serializes it...too confusing! Just use the same method everywhere.

Fixes b/7013037 Compose new email shortcut on Gmail widget incorrectly populates from and to

Change-Id: I3bb88f542fe802cdfcbbe3da1eb8207602110d44
diff --git a/src/com/android/mail/compose/ComposeActivity.java b/src/com/android/mail/compose/ComposeActivity.java
index c0c1f7e..8d6b571 100644
--- a/src/com/android/mail/compose/ComposeActivity.java
+++ b/src/com/android/mail/compose/ComposeActivity.java
@@ -423,6 +423,12 @@
             accountExtra = intent.getExtras().get(Utils.EXTRA_ACCOUNT);
             if (accountExtra instanceof Account) {
                 return (Account) accountExtra;
+            } else if (accountExtra instanceof String) {
+                // This is the Account attached to the widget compose intent.
+                account = Account.newinstance((String)accountExtra);
+                if (account != null) {
+                    return account;
+                }
             }
             accountExtra = intent.getStringExtra(EXTRA_SELECTED_ACCOUNT);
         }
diff --git a/src/com/android/mail/widget/WidgetService.java b/src/com/android/mail/widget/WidgetService.java
index c771bd5..442bff5 100644
--- a/src/com/android/mail/widget/WidgetService.java
+++ b/src/com/android/mail/widget/WidgetService.java
@@ -130,7 +130,7 @@
         // On click intent for Compose
         final Intent composeIntent = new Intent();
         composeIntent.setAction(Intent.ACTION_SEND);
-        composeIntent.putExtra(Utils.EXTRA_ACCOUNT, account);
+        composeIntent.putExtra(Utils.EXTRA_ACCOUNT, account.serialize());
         composeIntent.setData(account.composeIntentUri);
         composeIntent.putExtra(ComposeActivity.EXTRA_FROM_EMAIL_TASK, true);
         if (account.composeIntentUri != null) {