Revert "Don't add other's child as header or footer"

This reverts commit 358d0d329785a225449aa9c8aea7fcc2c7bec741.

This CL resulted in b/37933333 regression, so it'll have to re-land with a target API check.

Change-Id: I1c2e4de43a15c1851d98f6aff432585ada80fb5b
(cherry picked from commit 48fef8ce495dc140b8cda1d198de766f76709381)
diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java
index 1457d02..569fe01 100644
--- a/core/java/android/widget/ListView.java
+++ b/core/java/android/widget/ListView.java
@@ -49,7 +49,6 @@
 import android.widget.RemoteViews.RemoteView;
 
 import com.android.internal.R;
-import com.android.internal.util.Preconditions;
 
 import com.google.android.collect.Lists;
 
@@ -336,11 +335,6 @@
      * @param isSelectable whether the item is selectable
      */
     public void addHeaderView(View v, Object data, boolean isSelectable) {
-        Preconditions.checkState(
-                v.getParent() == null,
-                "The specified child already has a parent. "
-                + "You must call removeView() on the child's parent first.");
-
         final FixedViewInfo info = new FixedViewInfo();
         info.view = v;
         info.data = data;
@@ -435,11 +429,6 @@
      * @param isSelectable true if the footer view can be selected
      */
     public void addFooterView(View v, Object data, boolean isSelectable) {
-        Preconditions.checkState(
-                v.getParent() == null,
-                "The specified child already has a parent. "
-                + "You must call removeView() on the child's parent first.");
-
         final FixedViewInfo info = new FixedViewInfo();
         info.view = v;
         info.data = data;