Preserving custom dialog state on rotation

Bug: 3263726
Change-Id: I79ff83dfa79ad469ee6897774f1f21aebe5e0c68
diff --git a/res/values/ids.xml b/res/values/ids.xml
index febfb36..fd82fe2 100644
--- a/res/values/ids.xml
+++ b/res/values/ids.xml
@@ -61,4 +61,7 @@
 
     <!-- Dialog ID for the date picker in event (birthday) editors -->
     <item type="id" name="dialog_event_date_picker" />
+
+    <!-- An ID to be used for contents of a custom dialog so that its state be preserved -->
+    <item type="id" name="custom_dialog_content" />
 </resources>
diff --git a/src/com/android/contacts/editor/LabeledEditorView.java b/src/com/android/contacts/editor/LabeledEditorView.java
index 8b2d277..971a023 100644
--- a/src/com/android/contacts/editor/LabeledEditorView.java
+++ b/src/com/android/contacts/editor/LabeledEditorView.java
@@ -389,6 +389,7 @@
      */
     private Dialog createCustomDialog() {
         final EditText customType = new EditText(mContext);
+        customType.setId(R.id.custom_dialog_content);
         customType.setInputType(INPUT_TYPE_CUSTOM);
         customType.setSaveEnabled(true);
         customType.requestFocus();