Merge "Fix 3148496: Update LockScreen layouts on large device"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 7f04228..9523c61 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -689,23 +689,13 @@
             </intent-filter>
         </activity>
 
-        <activity android:name="ChooseLockPattern"
-                android:label="@string/lockpattern_change_lock_pattern_label"
-                android:exported="false">
-        </activity>
+        <activity android:name="ChooseLockPattern" android:exported="false"/>
 
-        <activity android:name="ChooseLockPassword"
-                android:label="@string/lockpattern_change_lock_pin_label"
-            android:exported="false">
-        </activity>
+        <activity android:name="ChooseLockPassword" android:exported="false"/>
 
-        <activity android:name="ChooseLockPatternTutorial"
-            android:label="@string/lockpattern_change_lock_pattern_label">
-        </activity>
+        <activity android:name="ChooseLockPatternTutorial"/>
 
-        <activity android:name="ChooseLockPatternExample"
-            android:label="@string/lockpattern_change_lock_pattern_label">
-        </activity>
+        <activity android:name="ChooseLockPatternExample"/>
 
         <!-- Runs in the phone process since it needs access to the Phone object -->
         <activity android:name=".deviceinfo.Status"
diff --git a/res/layout-xlarge-land/choose_lock_password.xml b/res/layout-xlarge-land/choose_lock_password.xml
index 1276681..5f7cfaf 100644
--- a/res/layout-xlarge-land/choose_lock_password.xml
+++ b/res/layout-xlarge-land/choose_lock_password.xml
@@ -16,15 +16,16 @@
 ** limitations under the License.
 */
 -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+
+<RelativeLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:orientation="vertical"
-    android:gravity="center_horizontal">
+    android:layout_height="fill_parent">
 
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
+        android:layout_marginTop="72dip"
         android:orientation="horizontal">
 
         <!-- "Enter PIN(Password) to unlock" -->
@@ -61,12 +62,31 @@
         />
     </LinearLayout>
 
-    <!-- Spacer between password entry and keyboard -->
-    <View
-        android:layout_width="match_parent"
-        android:layout_height="0dip"
-        android:layout_weight="1" />
+    <!-- confirm / restart buttons -->
+    <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentRight="true"
+        android:layout_alignParentBottom="true"
+        android:orientation="horizontal">
 
+        <!-- left / top button: skip, or re-try -->
+        <Button android:id="@+id/cancel_button"
+            android:layout_width="140dip"
+            android:layout_height="wrap_content"
+            android:ellipsize="marquee"
+            android:singleLine="true"
+            android:text="@string/lockpassword_cancel_label"/>
+
+        <!-- right / bottom button: confirm or ok -->
+        <Button android:id="@+id/next_button"
+            android:layout_width="140dip"
+            android:layout_height="wrap_content"
+            android:ellipsize="marquee"
+            android:singleLine="true"
+            android:text="@string/lockpassword_continue_label"/>
+
+    </LinearLayout>
     <!-- Alphanumeric keyboard -->
     <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
         android:layout_alignParentBottom="true"
@@ -77,33 +97,4 @@
         android:visibility="gone"
     />
 
-    <RelativeLayout
-        android:layout_width="match_parent"
-        android:layout_height="0dip"
-        android:layout_weight="1">
-
-        <Button android:id="@+id/cancel_button"
-            android:layout_height="wrap_content"
-            android:layout_width="140dip"
-            android:ellipsize="marquee"
-            android:singleLine="true"
-            android:layout_alignParentBottom="true"
-            android:layout_toLeftOf="@id/next_button"
-            android:text="@string/lockpassword_cancel_label"
-        />
-
-        <Button android:id="@+id/next_button"
-            android:layout_width="140dip"
-            android:layout_height="wrap_content"
-            android:ellipsize="marquee"
-            android:singleLine="true"
-            android:layout_alignParentRight="true"
-            android:layout_alignParentBottom="true"
-            android:text="@string/lockpassword_continue_label"
-        />
-
-    </RelativeLayout>
-
-</LinearLayout>
-
-
+</RelativeLayout>
\ No newline at end of file
diff --git a/res/layout-xlarge-land/choose_lock_pattern.xml b/res/layout-xlarge-land/choose_lock_pattern.xml
index fa2498f..e2cbdab 100644
--- a/res/layout-xlarge-land/choose_lock_pattern.xml
+++ b/res/layout-xlarge-land/choose_lock_pattern.xml
@@ -21,62 +21,69 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 
-    <!-- left side: lock pattern -->
-    <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
-         android:layout_width="wrap_content"
-         android:layout_height="wrap_content"/>
-
-     <!-- right side: pattern and messages -->
-    <LinearLayout
-        android:orientation="vertical"
+    <RelativeLayout
         android:layout_width="0dip"
         android:layout_height="match_parent"
-        android:layout_weight="1.0">
+        android:layout_weight="1">
 
+        <!-- left side: lock pattern -->
+        <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
+             android:layout_width="354dip"
+             android:layout_height="354dip"
+             android:layout_gravity="center_horizontal"
+             android:layout_marginTop="72dip"
+             android:layout_marginLeft="111dip"
+             aspect="square"/>
+
+        <!-- right side: instructions and buttons -->
         <!-- header message -->
         <TextView android:id="@+id/headerText"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:textSize="22sp"
-            android:gravity="left"/>
+            android:layout_width="542dip"
+            android:layout_height="78dip"
+            android:layout_marginTop="88dip"
+            android:layout_alignParentTop="true"
+            android:layout_toRightOf="@id/lockPattern"
+            android:layout_marginLeft="100dip"
+            android:textSize="22sp"/>
 
         <!-- footer message -->
         <TextView android:id="@+id/footerText"
-            android:layout_width="wrap_content"
+            android:layout_width="542dip"
             android:layout_height="wrap_content"
+            android:layout_below="@id/headerText"
+            android:layout_marginTop="16dip"
+            android:layout_toRightOf="@id/lockPattern"
+            android:layout_marginLeft="100dip"
             android:textSize="22sp"
-            android:layout_marginTop="40dip"
             android:visibility="gone"/>
 
         <!-- confirm / restart buttons -->
-        <RelativeLayout
-            android:layout_width="match_parent"
-            android:layout_height="0dip"
-            android:layout_weight="1">
-
-            <!-- right / bottom button: confirm or ok -->
-            <Button android:id="@+id/footerRightButton"
-                android:layout_height="wrap_content"
-                android:layout_width="140dip"
-                android:layout_alignParentRight="true"
-                android:layout_alignParentBottom="true"
-                android:ellipsize="marquee"
-                android:singleLine="true"
-                android:text="@string/lockpattern_confirm_button_text"/>
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentRight="true"
+            android:layout_alignParentBottom="true"
+            android:orientation="horizontal">
 
             <!-- left / top button: skip, or re-try -->
             <Button android:id="@+id/footerLeftButton"
-                android:layout_height="wrap_content"
                 android:layout_width="140dip"
-                android:layout_toLeftOf="@id/footerRightButton"
-                android:layout_alignParentBottom="true"
+                android:layout_height="wrap_content"
                 android:ellipsize="marquee"
                 android:singleLine="true"
                 android:text="@string/lockpattern_restart_button_text"/>
 
-        </RelativeLayout>
+            <!-- right / bottom button: confirm or ok -->
+            <Button android:id="@+id/footerRightButton"
+                android:layout_width="140dip"
+                android:layout_height="wrap_content"
+                android:ellipsize="marquee"
+                android:singleLine="true"
+                android:text="@string/lockpattern_confirm_button_text"/>
 
-    </LinearLayout>
+        </LinearLayout>
+
+    </RelativeLayout>
 
 </com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
 
diff --git a/res/layout-xlarge-land/confirm_lock_password.xml b/res/layout-xlarge-land/confirm_lock_password.xml
index cbfe88c..d03923e 100644
--- a/res/layout-xlarge-land/confirm_lock_password.xml
+++ b/res/layout-xlarge-land/confirm_lock_password.xml
@@ -17,16 +17,16 @@
 */
 -->
 
-<!-- This is the same layout as choose_lock_password. TODO: find out why merge fails -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<!-- This is the same layout as choose_lock_password. TODO: find out why merge tag fails -->
+<RelativeLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:orientation="vertical"
-    android:gravity="center_horizontal">
+    android:layout_height="fill_parent">
 
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
+        android:layout_marginTop="72dip"
         android:orientation="horizontal">
 
         <!-- "Enter PIN(Password) to unlock" -->
@@ -63,12 +63,31 @@
         />
     </LinearLayout>
 
-    <!-- Spacer between password entry and keyboard -->
-    <View
-        android:layout_width="match_parent"
-        android:layout_height="0dip"
-        android:layout_weight="1" />
+    <!-- confirm / restart buttons -->
+    <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentRight="true"
+        android:layout_alignParentBottom="true"
+        android:orientation="horizontal">
 
+        <!-- left / top button: skip, or re-try -->
+        <Button android:id="@+id/cancel_button"
+            android:layout_width="140dip"
+            android:layout_height="wrap_content"
+            android:ellipsize="marquee"
+            android:singleLine="true"
+            android:text="@string/lockpassword_cancel_label"/>
+
+        <!-- right / bottom button: confirm or ok -->
+        <Button android:id="@+id/next_button"
+            android:layout_width="140dip"
+            android:layout_height="wrap_content"
+            android:ellipsize="marquee"
+            android:singleLine="true"
+            android:text="@string/lockpassword_continue_label"/>
+
+    </LinearLayout>
     <!-- Alphanumeric keyboard -->
     <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
         android:layout_alignParentBottom="true"
@@ -79,30 +98,4 @@
         android:visibility="gone"
     />
 
-    <RelativeLayout
-        android:layout_height="wrap_content"
-        android:layout_width="match_parent"
-        android:visibility="visible">
-
-        <Button android:id="@+id/cancel_button"
-            android:layout_width="150dip"
-            android:layout_height="wrap_content"
-            android:layout_margin="5dip"
-            android:layout_toLeftOf="@id/next_button"
-            android:text="@string/lockpassword_cancel_label"
-        />
-
-        <Button android:id="@+id/next_button"
-            android:layout_width="150dip"
-            android:layout_height="wrap_content"
-            android:layout_margin="5dip"
-            android:layout_alignParentRight="true"
-            android:drawableRight="@drawable/ic_btn_next"
-            android:drawablePadding="10dip"
-            android:text="@string/lockpassword_continue_label"
-        />
-
-    </RelativeLayout>
-
-</LinearLayout>
-
+</RelativeLayout>
\ No newline at end of file
diff --git a/res/layout-xlarge-land/confirm_lock_pattern.xml b/res/layout-xlarge-land/confirm_lock_pattern.xml
index 29fc93e..04c3e85 100644
--- a/res/layout-xlarge-land/confirm_lock_pattern.xml
+++ b/res/layout-xlarge-land/confirm_lock_pattern.xml
@@ -21,33 +21,42 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 
-    <!-- left side: lock pattern -->
-    <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
-         android:layout_width="wrap_content"
-         android:layout_height="wrap_content" />
-
-    <!-- right side: instructions and buttons -->
-    <LinearLayout
-        android:orientation="vertical"
+    <RelativeLayout
         android:layout_width="0dip"
         android:layout_height="match_parent"
-        android:layout_weight="1.0">
+        android:layout_weight="1">
 
+        <!-- left side: lock pattern -->
+        <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
+             android:layout_width="354dip"
+             android:layout_height="354dip"
+             android:layout_gravity="center_horizontal"
+             android:layout_marginTop="72dip"
+             android:layout_marginLeft="111dip"
+             aspect="square"/>
+
+        <!-- right side: instructions and buttons -->
         <!-- header message -->
         <TextView android:id="@+id/headerText"
-            android:layout_width="match_parent"
+            android:layout_width="542dip"
             android:layout_height="wrap_content"
-            android:gravity="left"
+            android:layout_marginTop="88dip"
+            android:layout_alignParentTop="true"
+            android:layout_toRightOf="@id/lockPattern"
+            android:layout_marginLeft="100dip"
             android:textSize="22sp"/>
 
         <!-- footer message -->
         <TextView android:id="@+id/footerText"
-            android:layout_width="match_parent"
+            android:layout_width="542dip"
             android:layout_height="wrap_content"
-            android:layout_marginTop="40dip"
-            android:gravity="left"
+            android:layout_below="@id/headerText"
+            android:layout_marginTop="16dip"
+            android:layout_toRightOf="@id/lockPattern"
+            android:layout_marginLeft="100dip"
             android:textSize="22sp"/>
-    </LinearLayout>
+
+    </RelativeLayout>
 
 </com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
 
diff --git a/res/layout-xlarge/choose_lock_password.xml b/res/layout-xlarge/choose_lock_password.xml
index 051229e..ef27a0f 100644
--- a/res/layout-xlarge/choose_lock_password.xml
+++ b/res/layout-xlarge/choose_lock_password.xml
@@ -20,7 +20,6 @@
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:orientation="vertical"
-    android:background="@android:color/background_dark"
     android:gravity="center_horizontal">
 
     <!-- header text ('Enter Pin') -->
@@ -72,6 +71,7 @@
         android:background="#00000000"
         android:layout_marginBottom="30dip"
         android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans"
+        android:visibility="gone"
     />
 
     <RelativeLayout
@@ -91,8 +91,6 @@
             android:layout_height="wrap_content"
             android:layout_margin="5dip"
             android:layout_alignParentRight="true"
-            android:drawableRight="@drawable/ic_btn_next"
-            android:drawablePadding="10dip"
             android:text="@string/lockpassword_continue_label"
         />
 
diff --git a/res/layout-xlarge/choose_lock_pattern.xml b/res/layout-xlarge/choose_lock_pattern.xml
index 97c647f..5995c26 100644
--- a/res/layout-xlarge/choose_lock_pattern.xml
+++ b/res/layout-xlarge/choose_lock_pattern.xml
@@ -14,78 +14,69 @@
      limitations under the License.
 -->
 <com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient
-        xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/topLayout"
     android:orientation="vertical"
-    android:layout_width="wrap_content"
+    android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="@color/black">
+    android:gravity="center_horizontal">
 
-    <!-- takes up all space above button bar at bottom -->
-    <LinearLayout
-        android:orientation="vertical"
+    <!-- top: instructions and buttons -->
+    <!-- header message -->
+    <TextView android:id="@+id/headerText"
+        android:layout_width="542dip"
+        android:layout_height="78dip"
+        android:layout_marginTop="96dip"
+        android:textSize="22sp"/>
+
+    <!-- footer message -->
+    <TextView android:id="@+id/footerText"
+        android:layout_width="542dip"
+        android:layout_height="78dip"
+        android:layout_marginTop="16dip"
+        android:textSize="22sp"
+        android:visibility="gone"/>
+
+    <!-- bottom: lock pattern -->
+    <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
+         android:layout_width="354dip"
+         android:layout_height="354dip"
+         android:layout_marginTop="80dip"
+         aspect="square"/>
+
+    <View
         android:layout_width="match_parent"
         android:layout_height="0dip"
-        android:layout_weight="1">
+        android:layout_weight="1"/>
 
-        <TextView android:id="@+id/headerText"
-            android:layout_width="match_parent"
-            android:layout_height="0dip"
-            android:layout_weight="1"
-            android:gravity="center"
-            android:textSize="18sp"/>
-
-        <View
-             android:background="@*android:drawable/code_lock_top"
-             android:layout_width="match_parent"
-             android:layout_height="2dip" />
-        <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
-             android:layout_width="wrap_content"
-             android:layout_height="wrap_content" />
-
-        <!-- bottom line looks bad when button bar is their too, omit in this case -->
-        <!--View
-             android:background="@*android:drawable/code_lock_bottom"
-             android:layout_width="match_parent"
-             android:layout_height="8dip" /-->
-
-        <TextView android:id="@+id/footerText"
-            android:layout_width="match_parent"
-            android:layout_height="0dip"
-            android:layout_weight="1"
-            android:gravity="center"
-            android:textSize="14sp"/>
-
-    </LinearLayout>
-
-
-    <LinearLayout style="@android:style/ButtonBar"
-        android:orientation="horizontal"
+    <RelativeLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content">
 
-        <Button android:id="@+id/footerLeftButton"
+        <LinearLayout
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_width="140dip"
-            android:ellipsize="marquee"
-            android:singleLine="true"
-            android:text="@string/lockpattern_restart_button_text"/>
+            android:layout_alignParentRight="true"
+            android:orientation="horizontal">
 
-        <View
-            android:visibility="invisible"
-            android:layout_height="0dip"
-            android:layout_width="1dip"
-            android:layout_weight="1" />
+            <!-- left / top button: skip, or re-try -->
+            <Button android:id="@+id/footerLeftButton"
+                android:layout_width="140dip"
+                android:layout_height="wrap_content"
+                android:ellipsize="marquee"
+                android:singleLine="true"
+                android:text="@string/lockpattern_restart_button_text"/>
 
-        <Button android:id="@+id/footerRightButton"
-            android:layout_height="wrap_content"
-            android:layout_width="140dip"
-            android:ellipsize="marquee"
-            android:singleLine="true"
-            android:drawableRight="@drawable/ic_btn_next"
-            android:drawablePadding="3dip"
-            android:text="@string/lockpattern_confirm_button_text"/>
+            <!-- right / bottom button: confirm or ok -->
+            <Button android:id="@+id/footerRightButton"
+                android:layout_width="140dip"
+                android:layout_height="wrap_content"
+                android:ellipsize="marquee"
+                android:singleLine="true"
+                android:text="@string/lockpattern_confirm_button_text"/>
 
-    </LinearLayout>
+        </LinearLayout>
+
+    </RelativeLayout>
 
 </com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
diff --git a/res/layout-xlarge/confirm_lock_password.xml b/res/layout-xlarge/confirm_lock_password.xml
index 7f563b1..5a5d6b2 100644
--- a/res/layout-xlarge/confirm_lock_password.xml
+++ b/res/layout-xlarge/confirm_lock_password.xml
@@ -23,7 +23,6 @@
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:orientation="vertical"
-    android:background="@android:color/background_dark"
     android:gravity="center_horizontal">
 
     <!-- header text ('Enter Pin') -->
@@ -75,6 +74,7 @@
         android:background="#00000000"
         android:layout_marginBottom="30dip"
         android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans"
+        android:visibility="gone"
     />
 
     <RelativeLayout
diff --git a/res/layout-xlarge/confirm_lock_pattern.xml b/res/layout-xlarge/confirm_lock_pattern.xml
index 01ef5b1..6bffaef 100644
--- a/res/layout-xlarge/confirm_lock_pattern.xml
+++ b/res/layout-xlarge/confirm_lock_pattern.xml
@@ -17,35 +17,35 @@
         xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/topLayout"
     android:orientation="vertical"
-    android:layout_width="wrap_content"
+    android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="@color/black">
+    android:gravity="center_horizontal">
 
+    <!-- top: instructions and buttons -->
+    <!-- header message -->
     <TextView android:id="@+id/headerText"
-        android:layout_width="match_parent"
-        android:layout_height="0dip"
-        android:layout_weight="1.0"
-        android:gravity="center"
-        android:textSize="18sp"/>
+        android:layout_width="542dip"
+        android:layout_height="78dip"
+        android:layout_marginTop="96dip"
+        android:textSize="22sp"/>
 
-    <View
-         android:background="@*android:drawable/code_lock_top"
-         android:layout_width="match_parent"
-         android:layout_height="2dip" />
-    <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
-         android:layout_width="wrap_content"
-         android:layout_height="wrap_content" />
-    <View
-         android:background="@*android:drawable/code_lock_bottom"
-         android:layout_width="match_parent"
-         android:layout_height="8dip" />
-
+    <!-- footer message -->
     <TextView android:id="@+id/footerText"
+        android:layout_width="542dip"
+        android:layout_height="78dip"
+        android:layout_marginTop="16dip"
+        android:textSize="22sp"/>
+
+    <!-- bottom: lock pattern -->
+    <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
+         android:layout_width="354dip"
+         android:layout_height="354dip"
+         android:layout_marginTop="80dip"
+         aspect="square"/>
+
+    <View
         android:layout_width="match_parent"
         android:layout_height="0dip"
-        android:layout_weight="1.0"
-        android:gravity="center"
-        android:textSize="14sp"/>
-
+        android:layout_weight="1"/>
 
 </com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
diff --git a/src/com/android/settings/ChooseLockPassword.java b/src/com/android/settings/ChooseLockPassword.java
index 08e382c..a37d3da 100644
--- a/src/com/android/settings/ChooseLockPassword.java
+++ b/src/com/android/settings/ChooseLockPassword.java
@@ -29,6 +29,7 @@
 import android.os.Handler;
 import android.preference.PreferenceActivity;
 import android.text.Editable;
+import android.text.InputType;
 import android.text.Selection;
 import android.text.Spannable;
 import android.text.TextUtils;
@@ -191,6 +192,10 @@
             mHeaderText = (TextView) view.findViewById(R.id.headerText);
             mKeyboardView.requestFocus();
 
+            int currentType = mPasswordEntry.getInputType();
+            mPasswordEntry.setInputType(mIsAlphaMode ? currentType
+                    : (currentType | InputType.TYPE_CLASS_NUMBER));
+
             Intent intent = getActivity().getIntent();
             final boolean confirmCredentials = intent.getBooleanExtra("confirm_credentials", true);
             if (savedInstanceState == null) {
diff --git a/src/com/android/settings/ConfirmLockPassword.java b/src/com/android/settings/ConfirmLockPassword.java
index 380e848..d824588 100644
--- a/src/com/android/settings/ConfirmLockPassword.java
+++ b/src/com/android/settings/ConfirmLockPassword.java
@@ -26,6 +26,7 @@
 import android.os.Bundle;
 import android.os.Handler;
 import android.preference.PreferenceActivity;
+import android.text.InputType;
 import android.view.KeyEvent;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -98,6 +99,11 @@
             mKeyboardHelper.setKeyboardMode(isAlpha ? PasswordEntryKeyboardHelper.KEYBOARD_MODE_ALPHA
                     : PasswordEntryKeyboardHelper.KEYBOARD_MODE_NUMERIC);
             mKeyboardView.requestFocus();
+
+            int currentType = mPasswordEntry.getInputType();
+            mPasswordEntry.setInputType(isAlpha ? currentType
+                    : (currentType | InputType.TYPE_CLASS_NUMBER));
+
             return view;
         }