summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorChristoph Studer <chstuder@google.com>2014-04-08 17:43:07 -0400
committerChristoph Studer <chstuder@google.com>2014-04-08 22:19:25 +0000
commit068f5929d10a2daf93d6a0aa26e48b1185c36c98 (patch)
tree9b13392c68d8c0071d1e57a87494db231a38afe3 /packages/SystemUI
parent821129f228527511c961cd03daa571bdeef236cc (diff)
downloadframeworks_base-068f5929d10a2daf93d6a0aa26e48b1185c36c98.zip
frameworks_base-068f5929d10a2daf93d6a0aa26e48b1185c36c98.tar.gz
frameworks_base-068f5929d10a2daf93d6a0aa26e48b1185c36c98.tar.bz2
Fix memory leak in NotificationStackScrollLayout
Bug: 13899792 Change-Id: I87d6c5e1f0f5052d45203df51284d828823dfd88
Diffstat (limited to 'packages/SystemUI')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollState.java4
2 files changed, 10 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
index 04b7f53..e2d6c5b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -31,7 +31,6 @@ import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
-import android.view.ViewParent;
import android.widget.OverScroller;
import com.android.systemui.ExpandHelper;
@@ -710,6 +709,12 @@ public class NotificationStackScrollLayout extends ViewGroup
super.onInterceptTouchEvent(ev);
}
+ @Override
+ protected void onViewRemoved(View child) {
+ super.onViewRemoved(child);
+ mCurrentStackScrollState.removeViewStateForView(child);
+ }
+
private boolean onInterceptTouchEventScroll(MotionEvent ev) {
/*
* This method JUST determines whether we want to intercept the motion.
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollState.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollState.java
index 881730a..67a1735 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollState.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollState.java
@@ -72,6 +72,10 @@ public class StackScrollState {
return mStateMap.get(requestedView);
}
+ public void removeViewStateForView(View child) {
+ mStateMap.remove(child);
+ }
+
/**
* Apply the properties saved in {@link #mStateMap} to the children of the {@link #mHostView}.
* The properties are only applied if they effectively changed.