Fix "pi" input issues.  Added a popup for greek capital pi.  Bug: 2220892

Change-Id: Ie465e2ed93c79b0efe9d518cc44df1028f1bb392
diff --git a/java/res/xml/kbd_symbols_shift.xml b/java/res/xml/kbd_symbols_shift.xml
index 09b5c3f..ca431fc 100755
--- a/java/res/xml/kbd_symbols_shift.xml
+++ b/java/res/xml/kbd_symbols_shift.xml
@@ -34,7 +34,10 @@
                 android:popupCharacters="♪♥♠♦♣"
         />
         <Key android:keyLabel="√"/>
-        <Key android:keyLabel="π"/>
+        <Key android:keyLabel="π"
+                android:popupKeyboard="@xml/kbd_popup_template"
+                android:popupCharacters="Π"
+        />
         <Key android:keyLabel="÷"/>
         <Key android:keyLabel="×"/>
         <Key android:keyLabel="{"/>
diff --git a/java/res/xml/kbd_symbols_shift_black.xml b/java/res/xml/kbd_symbols_shift_black.xml
index dc84251..a8acb9d 100755
--- a/java/res/xml/kbd_symbols_shift_black.xml
+++ b/java/res/xml/kbd_symbols_shift_black.xml
@@ -34,7 +34,10 @@
                 android:popupCharacters="♪♥♠♦♣"
         />
         <Key android:keyLabel="√"/>
-        <Key android:keyLabel="π"/>
+        <Key android:keyLabel="π"
+                android:popupKeyboard="@xml/kbd_popup_template"
+                android:popupCharacters="Π"
+        />
         <Key android:keyLabel="÷"/>
         <Key android:keyLabel="×"/>
         <Key android:keyLabel="{"/>
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index b863a70..6af8c4f 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1144,7 +1144,9 @@
             }
         }
         if (mPredicting) {
-            if (mKeyboardSwitcher.getInputView().isShifted() && mComposing.length() == 0) {
+            if (mKeyboardSwitcher.getInputView().isShifted()
+                    && mKeyboardSwitcher.isAlphabetMode()
+                    && mComposing.length() == 0) {
                 mWord.setCapitalized(true);
             }
             mComposing.append((char) primaryCode);