Only use fullscreen mode if the number of inches in height is less than 2.5in
diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml
index 5b2095c..f057c16 100644
--- a/java/res/values/dimens.xml
+++ b/java/res/values/dimens.xml
@@ -23,4 +23,7 @@
     <dimen name="bubble_pointer_offset">22dip</dimen>
     <dimen name="candidate_strip_height">42dip</dimen>
     <dimen name="spacebar_vertical_correction">4dip</dimen>
+    <!-- If the screen height in landscape is larger than the below value, then the keyboard
+         will not go into extract (fullscreen) mode. -->
+    <dimen name="max_height_for_fullscreen">2.5in</dimen>
 </resources>
\ No newline at end of file
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 38313c0..db0a822 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -42,6 +42,7 @@
 import android.speech.SpeechRecognizer;
 import android.text.ClipboardManager;
 import android.text.TextUtils;
+import android.util.DisplayMetrics;
 import android.util.Log;
 import android.util.PrintWriterPrinter;
 import android.util.Printer;
@@ -719,6 +720,19 @@
     }
 
     @Override
+    public boolean onEvaluateFullscreenMode() {
+        DisplayMetrics dm = getResources().getDisplayMetrics();
+        float displayHeight = dm.heightPixels;
+        // If the display is more than X inches high, don't go to fullscreen mode
+        float dimen = getResources().getDimension(R.dimen.max_height_for_fullscreen);
+        if (displayHeight > dimen) {
+            return false;
+        } else {
+            return super.onEvaluateFullscreenMode();
+        }
+    }
+
+    @Override
     public boolean onKeyDown(int keyCode, KeyEvent event) {
         switch (keyCode) {
             case KeyEvent.KEYCODE_BACK: