In landscape mode, set the type of digit area to PHONE[do not merge].
Backport from Ieb30191ace8a0d62adec4feaca8f81df7ac4e71b
Previously we blindely set the EditText to NULL to prevent the IME
keyboard to pop up in portrait mode. The issue is that in landscape
mode, the keyboard is not in numlock mode which is a pb on devices
where the 1st line is not made of numbers.
Bug: 2180808
diff --git a/src/com/android/contacts/TwelveKeyDialer.java b/src/com/android/contacts/TwelveKeyDialer.java
index 176997a..0eb9c94 100644
--- a/src/com/android/contacts/TwelveKeyDialer.java
+++ b/src/com/android/contacts/TwelveKeyDialer.java
@@ -185,7 +185,6 @@
mDigits.setKeyListener(DialerKeyListener.getInstance());
mDigits.setOnClickListener(this);
mDigits.setOnKeyListener(this);
- mDigits.setInputType(android.text.InputType.TYPE_NULL); // Don't show IME when focused.
maybeAddNumberFormatting();
@@ -214,7 +213,16 @@
view.setOnLongClickListener(this);
mDelete = view;
- mDialpad = findViewById(R.id.dialpad); // This is null in landscape mode
+ mDialpad = findViewById(R.id.dialpad); // This is null in landscape mode.
+
+ // In landscape we put the keyboard in phone mode.
+ // In portrait we prevent the soft keyboard to show since the
+ // dialpad acts as one already.
+ if (null == mDialpad) {
+ mDigits.setInputType(android.text.InputType.TYPE_CLASS_PHONE);
+ } else {
+ mDigits.setInputType(android.text.InputType.TYPE_NULL);
+ }
// Set up the "dialpad chooser" UI; see showDialpadChooser().
mDialpadChooser = (ListView) findViewById(R.id.dialpadChooser);