When a video attachment from MMS is saved to the device, the content is not displayed on the Gallery app

Bug 9578924

This is bug reported on the GS4. Fix by removing leading periods from the
saved filename.

Change-Id: I6f025efc567c33dfdfd926ecf5131b258047315a
diff --git a/src/com/android/mms/ui/ComposeMessageActivity.java b/src/com/android/mms/ui/ComposeMessageActivity.java
index 3b55a59..12b421c 100644
--- a/src/com/android/mms/ui/ComposeMessageActivity.java
+++ b/src/com/android/mms/ui/ComposeMessageActivity.java
@@ -1616,6 +1616,9 @@
                 if (isDrm) {
                     extension += DrmUtils.getConvertExtension(type);
                 }
+                // Remove leading periods. The gallery ignores files starting with a period.
+                fileName = fileName.replaceAll("^.", "");
+
                 File file = getUniqueDestination(dir + fileName, extension);
 
                 // make sure the path is valid and directories created for this file.