diff options
author | Michael Jurka <mikejurka@google.com> | 2012-05-29 03:44:18 -0700 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2012-05-29 03:44:18 -0700 |
commit | b2a5d9e546fc99510a87403a619bbc55a115c0f4 (patch) | |
tree | 96d747d40fb32726295ea946ec1a0cb0176bde0c /packages | |
parent | c3a5cf9aab3d409445accb2a93c09e6b4140d196 (diff) | |
download | frameworks_base-b2a5d9e546fc99510a87403a619bbc55a115c0f4.zip frameworks_base-b2a5d9e546fc99510a87403a619bbc55a115c0f4.tar.gz frameworks_base-b2a5d9e546fc99510a87403a619bbc55a115c0f4.tar.bz2 |
Adding debugging code for bug where recycled views still had parent
Bug: 6499508
Change-Id: Iaf95ee6a0836c5f1e863d6a5b969e032d36a2b27
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java | 15 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java | 15 |
2 files changed, 30 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java index 9f801b0..1302c1f 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java @@ -83,6 +83,12 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView setLayoutTransition(null); mLinearLayout.removeAllViews(); + for (int i = 0; i < mRecycledViews.size(); i++) { + View child = mRecycledViews.get(i); + if (child.getParent() != null) { + throw new RuntimeException("Recycled child has a parent"); + } + } for (int i = 0; i < mAdapter.getCount(); i++) { View old = null; if (mRecycledViews.size() != 0) { @@ -183,6 +189,9 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView public void onChildDismissed(View v) { mRecycledViews.add(v); mLinearLayout.removeView(v); + if (v.getParent() != null) { + throw new RuntimeException("Recycled child has parent"); + } mCallback.handleSwipe(v); // Restore the alpha/translation parameters to what they were before swiping // (for when these items are recycled) @@ -354,9 +363,15 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView mNumItemsInOneScreenful = (int) FloatMath.ceil(dm.widthPixels / (float) child.getMeasuredWidth()); mRecycledViews.add(child); + if (child.getParent() != null) { + throw new RuntimeException("First recycled child has parent"); + } for (int i = 0; i < mNumItemsInOneScreenful - 1; i++) { mRecycledViews.add(mAdapter.createView(mLinearLayout)); + if (mRecycledViews.get(mRecycledViews.size() - 1).getParent() != null) { + throw new RuntimeException("Recycled child has parent"); + } } } diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java index c1597e0..3c71784 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java @@ -84,6 +84,12 @@ public class RecentsVerticalScrollView extends ScrollView setLayoutTransition(null); mLinearLayout.removeAllViews(); + for (int i = 0; i < mRecycledViews.size(); i++) { + View child = mRecycledViews.get(i); + if (child.getParent() != null) { + throw new RuntimeException("Recycled child has parent"); + } + } // Once we can clear the data associated with individual item views, // we can get rid of the removeAllViews() and the code below will // recycle them. @@ -190,6 +196,9 @@ public class RecentsVerticalScrollView extends ScrollView public void onChildDismissed(View v) { mRecycledViews.add(v); mLinearLayout.removeView(v); + if (v.getParent() != null) { + throw new RuntimeException("Recycled child has parent"); + } mCallback.handleSwipe(v); // Restore the alpha/translation parameters to what they were before swiping // (for when these items are recycled) @@ -363,9 +372,15 @@ public class RecentsVerticalScrollView extends ScrollView mNumItemsInOneScreenful = (int) FloatMath.ceil(dm.heightPixels / (float) child.getMeasuredHeight()); mRecycledViews.add(child); + if (child.getParent() != null) { + throw new RuntimeException("First recycled child has parent"); + } for (int i = 0; i < mNumItemsInOneScreenful - 1; i++) { mRecycledViews.add(mAdapter.createView(mLinearLayout)); + if (mRecycledViews.get(mRecycledViews.size() - 1).getParent() != null) { + throw new RuntimeException("Recycled child has parent"); + } } } |