diff --git a/res/layout/compose_message_view.xml b/res/layout/compose_message_view.xml
index fd60e2a..8bb8249 100644
--- a/res/layout/compose_message_view.xml
+++ b/res/layout/compose_message_view.xml
@@ -88,8 +88,8 @@
             android:layout_height="wrap_content"
             android:orientation="horizontal">
 
-            <!-- Contains compose message bubble and character counter for SMS which should be left
-            aligned -->
+            <!-- Contains compose message bubble and character counter for SMS or attachments size
+                 for MMS which should be left aligned -->
             <LinearLayout
                 android:layout_width="0dp"
                 android:layout_weight="1"
@@ -128,8 +128,8 @@
                 </LinearLayout>
 
                 <TextView
-                    android:id="@+id/char_counter"
-                    style="@style/ComposeMessageViewTextCounterStyle"
+                    android:id="@+id/message_body_size"
+                    style="@style/ComposeMessageViewMessageBodySizeStyle"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:singleLine="true"
diff --git a/res/values-ldrtl/styles.xml b/res/values-ldrtl/styles.xml
index bd270c7..de4d9e8 100644
--- a/res/values-ldrtl/styles.xml
+++ b/res/values-ldrtl/styles.xml
@@ -171,9 +171,9 @@
         <item name="android:layout_marginStart">4dp</item>
     </style>
 
-    <style name="ComposeMessageViewTextCounterStyle">
-        <item name="android:textColor">@color/message_text_counter_color</item>
-        <item name="android:textSize">@dimen/message_text_counter_size</item>
+    <style name="ComposeMessageViewMessageBodySizeStyle">
+        <item name="android:textColor">@color/message_body_size_text_color</item>
+        <item name="android:textSize">@dimen/message_body_size_text_size</item>
         <item name="android:fontFamily">sans-serif</item>
         <item name="android:layout_gravity">end|center_vertical</item>
         <item name="android:paddingEnd">@dimen/compose_message_text_box_padding_side</item>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index f33e105..035ed81 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -128,7 +128,7 @@
     <color name="fab_pressed_color">#3ea4dc</color>
     <color name="fab_ripple">#40ffffff</color>
 
-    <color name="message_text_counter_color">#555555</color>
+    <color name="message_body_size_text_color">#555555</color>
     <color name="mms_indicator_color">#8BC34A</color>
     <color name="list_empty_text">#6d6d6d</color>
     <color name="low_storage_action_item_color">#ff000000</color>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 5ff0eb7..5c34b6f 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -116,7 +116,7 @@
     <dimen name="fab_elevation_pressed">6dp</dimen>
     <dimen name="fab_bottom_margin">12dp</dimen>
     <dimen name="fab_left_right_margin">14dp</dimen>
-    <dimen name="message_text_counter_size">12sp</dimen>
+    <dimen name="message_body_size_text_size">12sp</dimen>
 
     <dimen name="vcard_detail_group_indicator_width">40dp</dimen>
     <dimen name="mms_indicator_size">12sp</dimen>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 442818d..46533af 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -365,9 +365,9 @@
       <item name="android:dividerHeight">0dp</item>
     </style>
 
-    <style name="ComposeMessageViewTextCounterStyle">
-        <item name="android:textColor">@color/message_text_counter_color</item>
-        <item name="android:textSize">@dimen/message_text_counter_size</item>
+    <style name="ComposeMessageViewMessageBodySizeStyle">
+        <item name="android:textColor">@color/message_body_size_text_color</item>
+        <item name="android:textSize">@dimen/message_body_size_text_size</item>
         <item name="android:fontFamily">sans-serif</item>
         <item name="android:layout_gravity">right|center_vertical</item>
         <item name="android:paddingRight">@dimen/compose_message_text_box_padding_side</item>
diff --git a/src/com/android/messaging/ui/conversation/ComposeMessageView.java b/src/com/android/messaging/ui/conversation/ComposeMessageView.java
index 5db1292..0f36e9a 100644
--- a/src/com/android/messaging/ui/conversation/ComposeMessageView.java
+++ b/src/com/android/messaging/ui/conversation/ComposeMessageView.java
@@ -27,6 +27,7 @@
 import android.text.InputFilter.LengthFilter;
 import android.text.TextUtils;
 import android.text.TextWatcher;
+import android.text.format.Formatter;
 import android.util.AttributeSet;
 import android.view.ContextThemeWrapper;
 import android.view.KeyEvent;
@@ -67,7 +68,9 @@
 import com.android.messaging.util.LogUtil;
 import com.android.messaging.util.MediaUtil;
 import com.android.messaging.util.OsUtil;
+import com.android.messaging.util.SafeAsyncTask;
 import com.android.messaging.util.UiUtils;
+import com.android.messaging.util.UriUtil;
 
 import java.util.Collection;
 import java.util.List;
@@ -112,7 +115,7 @@
 
     private PlainTextEditText mComposeEditText;
     private PlainTextEditText mComposeSubjectText;
-    private TextView mCharCounter;
+    private TextView mMessageBodySize;
     private TextView mMmsIndicator;
     private SimIconView mSelfSendIcon;
     private ImageButton mSendButton;
@@ -171,7 +174,7 @@
 
         final int counterColor = mHost.overrideCounterColor();
         if (counterColor != -1) {
-            mCharCounter.setTextColor(counterColor);
+            mMessageBodySize.setTextColor(counterColor);
         }
     }
 
@@ -309,7 +312,7 @@
         mAttachmentPreview = (AttachmentPreview) findViewById(R.id.attachment_draft_view);
         mAttachmentPreview.setComposeMessageView(this);
 
-        mCharCounter = (TextView) findViewById(R.id.char_counter);
+        mMessageBodySize = (TextView) findViewById(R.id.message_body_size);
         mMmsIndicator = (TextView) findViewById(R.id.mms_indicator);
     }
 
@@ -480,6 +483,8 @@
         final String subject = data.getMessageSubject();
         final String message = data.getMessageText();
 
+        boolean hasAttachmentsChanged = false;
+
         if ((changeFlags & DraftMessageData.MESSAGE_SUBJECT_CHANGED) ==
                 DraftMessageData.MESSAGE_SUBJECT_CHANGED) {
             mComposeSubjectText.setText(subject);
@@ -500,12 +505,13 @@
                 DraftMessageData.ATTACHMENTS_CHANGED) {
             final boolean haveAttachments = mAttachmentPreview.onAttachmentsChanged(data);
             mHost.onAttachmentsChanged(haveAttachments);
+            hasAttachmentsChanged = true;
         }
 
         if ((changeFlags & DraftMessageData.SELF_CHANGED) == DraftMessageData.SELF_CHANGED) {
             updateOnSelfSubscriptionChange();
         }
-        updateVisualsOnDraftChanged();
+        updateVisualsOnDraftChanged(hasAttachmentsChanged);
     }
 
     @Override   // From DraftMessageDataListener
@@ -624,7 +630,44 @@
                 mConversationDataModel.getData().getParticipantsLoaded();
     }
 
+    private static class AsyncUpdateMessageBodySizeTask
+            extends SafeAsyncTask<List<MessagePartData>, Void, Long> {
+
+        private final Context mContext;
+        private final TextView mSizeTextView;
+
+        public AsyncUpdateMessageBodySizeTask(final Context context, final TextView tv) {
+            mContext = context;
+            mSizeTextView = tv;
+        }
+
+        @Override
+        protected Long doInBackgroundTimed(final List<MessagePartData>... params) {
+            final List<MessagePartData> attachments = params[0];
+            long totalSize = 0;
+            for (final MessagePartData attachment : attachments) {
+                final Uri contentUri = attachment.getContentUri();
+                if (contentUri != null) {
+                    totalSize += UriUtil.getContentSize(attachment.getContentUri());
+                }
+            }
+            return totalSize;
+        }
+
+        @Override
+        protected void onPostExecute(Long size) {
+            if (mSizeTextView != null) {
+                mSizeTextView.setText(Formatter.formatFileSize(mContext, size));
+                mSizeTextView.setVisibility(View.VISIBLE);
+            }
+        }
+    }
+
     private void updateVisualsOnDraftChanged() {
+        updateVisualsOnDraftChanged(false);
+    }
+
+    private void updateVisualsOnDraftChanged(boolean hasAttachmentsChanged) {
         final String messageText = mComposeEditText.getText().toString();
         final DraftMessageData draftMessageData = mBinding.getData();
         draftMessageData.setMessageText(messageText);
@@ -640,26 +683,39 @@
         final boolean hasWorkingDraft = hasMessageText || hasSubject ||
                 mBinding.getData().hasAttachments();
 
-        // Update the SMS text counter.
-        final int messageCount = draftMessageData.getNumMessagesToBeSent();
-        final int codePointsRemaining = draftMessageData.getCodePointsRemainingInCurrentMessage();
-        // Show the counter only if:
-        // - We are not in MMS mode
-        // - We are going to send more than one message OR we are getting close
-        boolean showCounter = false;
-        if (!draftMessageData.getIsMms() && (messageCount > 1 ||
-                 codePointsRemaining <= CODEPOINTS_REMAINING_BEFORE_COUNTER_SHOWN)) {
-            showCounter = true;
-        }
-
-        if (showCounter) {
-            // Update the remaining characters and number of messages required.
-            final String counterText = messageCount > 1 ? codePointsRemaining + " / " +
-                    messageCount : String.valueOf(codePointsRemaining);
-            mCharCounter.setText(counterText);
-            mCharCounter.setVisibility(View.VISIBLE);
-        } else {
-            mCharCounter.setVisibility(View.INVISIBLE);
+        final List<MessagePartData> attachments = draftMessageData.getReadOnlyAttachments();
+        if (draftMessageData.getIsMms()) { // MMS case
+            if (draftMessageData.hasAttachments()) {
+                if (hasAttachmentsChanged) {
+                    // Calculate message attachments size and show it.
+                    new AsyncUpdateMessageBodySizeTask(getContext(), mMessageBodySize)
+                            .executeOnThreadPool(attachments, null, null);
+                } else {
+                    // No update. Just show previous size.
+                    mMessageBodySize.setVisibility(View.VISIBLE);
+                }
+            } else {
+                mMessageBodySize.setVisibility(View.INVISIBLE);
+            }
+        } else { // SMS case
+            // Update the SMS text counter.
+            final int messageCount = draftMessageData.getNumMessagesToBeSent();
+            final int codePointsRemaining =
+                    draftMessageData.getCodePointsRemainingInCurrentMessage();
+            // Show the counter only if we are going to send more than one message OR we are getting
+            // close.
+            if (messageCount > 1
+                    || codePointsRemaining <= CODEPOINTS_REMAINING_BEFORE_COUNTER_SHOWN) {
+                // Update the remaining characters and number of messages required.
+                final String counterText =
+                        messageCount > 1
+                                ? codePointsRemaining + " / " + messageCount
+                                : String.valueOf(codePointsRemaining);
+                mMessageBodySize.setText(counterText);
+                mMessageBodySize.setVisibility(View.VISIBLE);
+            } else {
+                mMessageBodySize.setVisibility(View.INVISIBLE);
+            }
         }
 
         // Update the send message button. Self icon uri might be null if self participant data
@@ -699,7 +755,6 @@
         }
 
         // Update the text hint on the message box depending on the attachment type.
-        final List<MessagePartData> attachments = draftMessageData.getReadOnlyAttachments();
         final int attachmentCount = attachments.size();
         if (attachmentCount == 0) {
             final SubscriptionListEntry subscriptionListEntry =
