Remove KeyboardView in ChooseLockPassword

1. We actually use user installed keyboard
2. Request focus on the edittext instead of the keyboard

Bug: 24900754

Change-Id: I6257a592ad34875d46c5c05349098b891ef37d98
diff --git a/res/layout/choose_lock_password.xml b/res/layout/choose_lock_password.xml
index 84485d0..4b9f3e5 100644
--- a/res/layout/choose_lock_password.xml
+++ b/res/layout/choose_lock_password.xml
@@ -89,21 +89,6 @@
                     android:text="@string/lockpassword_continue_label" />
             </LinearLayout>
         </LinearLayout>
-
-        <!-- Spacer between password entry and keyboard -->
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="0dip"
-            android:layout_weight="1"/>
-
-        <!-- Alphanumeric keyboard -->
-        <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:background="#00000000"
-            android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans"
-            android:visibility="gone"/>
-
     </LinearLayout>
 
 </com.android.setupwizardlib.GlifLayout>
diff --git a/src/com/android/settings/ChooseLockPassword.java b/src/com/android/settings/ChooseLockPassword.java
index 246f7d5..5519e87 100644
--- a/src/com/android/settings/ChooseLockPassword.java
+++ b/src/com/android/settings/ChooseLockPassword.java
@@ -150,10 +150,6 @@
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
-        // TODO: Fix on phones
-        // Disable IME on our window since we provide our own keyboard
-        //getWindow().setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
-                //WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
         super.onCreate(savedInstanceState);
         CharSequence msg = getText(R.string.lockpassword_choose_your_password_header);
         setTitle(msg);
@@ -200,8 +196,6 @@
         private TextView mHeaderText;
         private String mFirstPin;
         private RecyclerView mPasswordRestrictionView;
-        private KeyboardView mKeyboardView;
-        private PasswordEntryKeyboardHelper mKeyboardHelper;
         private boolean mIsAlphaMode;
         private Button mCancelButton;
         private Button mNextButton;
@@ -313,22 +307,15 @@
 
             setupPasswordRequirementsView(view);
 
-            mKeyboardView = (PasswordEntryKeyboardView) view.findViewById(R.id.keyboard);
             mPasswordRestrictionView.setLayoutManager(new LinearLayoutManager(getActivity()));
             mPasswordEntry = (EditText) view.findViewById(R.id.password_entry);
             mPasswordEntry.setOnEditorActionListener(this);
             mPasswordEntry.addTextChangedListener(this);
+            mPasswordEntry.requestFocus();
             mPasswordEntryInputDisabler = new TextViewInputDisabler(mPasswordEntry);
 
             final Activity activity = getActivity();
-            mKeyboardHelper = new PasswordEntryKeyboardHelper(activity,
-                    mKeyboardView, mPasswordEntry);
-            mKeyboardHelper.setKeyboardMode(mIsAlphaMode ?
-                    PasswordEntryKeyboardHelper.KEYBOARD_MODE_ALPHA
-                    : PasswordEntryKeyboardHelper.KEYBOARD_MODE_NUMERIC);
-
             mHeaderText = (TextView) view.findViewById(R.id.headerText);
-            mKeyboardView.requestFocus();
 
             int currentType = mPasswordEntry.getInputType();
             mPasswordEntry.setInputType(mIsAlphaMode ? currentType
@@ -454,7 +441,7 @@
             if (mSaveAndFinishWorker != null) {
                 mSaveAndFinishWorker.setListener(this);
             } else {
-                mKeyboardView.requestFocus();
+                mPasswordEntry.requestFocus();
             }
         }