Merge "Mms: Add initialization the mLayoutType parameter."
diff --git a/src/com/android/mms/model/LayoutModel.java b/src/com/android/mms/model/LayoutModel.java
index 97b1637..0280534 100644
--- a/src/com/android/mms/model/LayoutModel.java
+++ b/src/com/android/mms/model/LayoutModel.java
@@ -110,6 +110,11 @@
         if (mTextRegion == null) {
             createDefaultTextRegion();
         }
+        // LayoutModel will re-construct when orientation changes, so we need to
+        // initialize mLayoutType here. Otherwise, the mLayoutType is alway default
+        // value (LAYOUT_BOTTOM_TEXT) after LayoutModel re-construct.
+        mLayoutType =
+                (mImageRegion.getTop() == 0) ? LAYOUT_BOTTOM_TEXT : LAYOUT_TOP_TEXT;
     }
 
     public RegionModel getRootLayout() {