DO NOT MERGE Workaround for java.lang.IllegalArgumentException in android.util.ArrayMap
am: a94a117971

* commit 'a94a1179714f6a79a6d9d7ae542458b8e6d742e7':
  DO NOT MERGE Workaround for java.lang.IllegalArgumentException in android.util.ArrayMap
diff --git a/src/com/android/incallui/DialpadFragment.java b/src/com/android/incallui/DialpadFragment.java
index abe8fb9..371f5c5 100644
--- a/src/com/android/incallui/DialpadFragment.java
+++ b/src/com/android/incallui/DialpadFragment.java
@@ -361,7 +361,7 @@
     public boolean onKey(View v, int keyCode, KeyEvent event) {
         Log.d(this, "onKey:  keyCode " + keyCode + ", view " + v);
 
-        if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
+        if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER || keyCode == KeyEvent.KEYCODE_ENTER) {
             int viewId = v.getId();
             if (mDisplayMap.containsKey(viewId)) {
                 switch (event.getAction()) {
diff --git a/src/com/android/incallui/PostCharDialogFragment.java b/src/com/android/incallui/PostCharDialogFragment.java
index 09b626a..400e8d7 100644
--- a/src/com/android/incallui/PostCharDialogFragment.java
+++ b/src/com/android/incallui/PostCharDialogFragment.java
@@ -29,9 +29,15 @@
  */
 public class PostCharDialogFragment extends DialogFragment {
 
+    private static final String STATE_CALL_ID = "CALL_ID";
+    private static final String STATE_POST_CHARS = "POST_CHARS";
+
     private String mCallId;
     private String mPostDialStr;
 
+    public PostCharDialogFragment() {
+    }
+
     public PostCharDialogFragment(String callId, String postDialStr) {
         mCallId = callId;
         mPostDialStr = postDialStr;
@@ -41,6 +47,11 @@
     public Dialog onCreateDialog(Bundle savedInstanceState) {
         super.onCreateDialog(savedInstanceState);
 
+        if (mPostDialStr == null && savedInstanceState != null) {
+            mCallId = savedInstanceState.getString(STATE_CALL_ID);
+            mPostDialStr = savedInstanceState.getString(STATE_POST_CHARS);
+        }
+
         final StringBuilder buf = new StringBuilder();
         buf.append(getResources().getText(R.string.wait_prompt_str));
         buf.append(mPostDialStr);
@@ -71,4 +82,12 @@
 
         TelecomAdapter.getInstance().postDialContinue(mCallId, false);
     }
+
+    @Override
+    public void onSaveInstanceState(Bundle outState) {
+        super.onSaveInstanceState(outState);
+
+        outState.putString(STATE_CALL_ID, mCallId);
+        outState.putString(STATE_POST_CHARS, mPostDialStr);
+    }
 }